summaryrefslogtreecommitdiffstats
path: root/stream
Commit message (Collapse)AuthorAgeFilesLines
* core: add --stream-capturewm42013-05-123-0/+41
| | | | | | This is a partial revert of commit 7059c15, and basically re-adds --capture, just with different option names and slightly different semantics.
* Merge branch 'audio_changes'wm42013-05-121-4/+6
|\ | | | | | | | | Conflicts: audio/out/ao_lavc.c
| * core: use channel map on demuxer level toowm42013-05-121-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps passing the channel layout correctly from decoder to audio filter chain. (Because that part "reuses" the demuxer level codec parameters, which is very disgusting.) Note that ffmpeg stuff already passed the channel layout via mp_copy_lav_codec_headers(). So other than easier dealing with the demuxer/decoder parameters mess, there's no real advantage to doing this. Make the --channels option accept a channel map. Since simple numbers map to standard layouts with the given number of channels, this is downwards compatible. Likewise for demux_rawaudio.
* | stream_bluray: report chapter timeswm42013-05-091-0/+21
| | | | | | | | This was forgotten in commit 7294303.
* | stream_bluray: general timeline supportwm42013-05-091-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Uses the same mechanisms as stream_dvd to report the virtual playback time as known by libdvdread/libbluray, instead of the raw demuxer output. This should solve many problems with BD playback, like correct display of playback time and duration. On the other hand, this causes some new problems. For example, the reported stream time has a rather low resolution (1-2 seconds), so doing precise seeking on it is near impossible.
* | stream_bluray: make code a bit more obviouswm42013-05-091-4/+4
| |
* | stream: report chapter times, use time seeks for DVD chapterswm42013-05-063-6/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the stream layer to report chapter times. Extend stream_dvd to do this. I'm not 100% sure whether the re-used code is bug-free (because it was used for slave-mode and/or debugging only). MAke the frontend do time-based seeks when switching DVD chapters. I'm not sure if there's a real reason STREAM_CTRL_SEEK_TO_CHAPTER exists (maybe/hopefully not), but we will see. Note that querying chapter times in demuxer_chapter_time() with the new STREAM_CTRL_GET_CHAPTER_TIME could be excessively slow, especially with the cache enabled. The frontend likes to query chapter times very often. Additionally, stream_dvd uses some sort of quadratic algorithm to list times for all chapters. For this reason, we try to query all chapters on start (after the demuxer is opened), and add the chapters to the demuxer chapter list. demuxer_chapter_time() will get the time from that list, instead of asking the stream layer over and over again. This assumes stream_dvd knows the list of chapters at the start, and also that the list of chapters never changes during playback. This seems to be true, and the only exception, switching DVD titles, is not supported at runtime (and doesn't need to be supported).
* | Fix some cppcheck / scan-build warningswm42013-05-065-32/+5
| | | | | | | | | | | | | | | | These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.)
* | stream: fix bad cache behavior introduced by recent commitwm42013-05-051-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4d14a42, a seemingly harmless change, introduced very bad cache behavior when the cache isn't forked, such as on Windows, where it uses threads. Apparently the cache code was designed for forking, and an unknown obscure condition causes severe performance degradation if a STREAM_CTRL is sent to the cache on every frame. Since the cache code is literally insane (uses shared memory + fork(), and has hacks to make it work with threads, is messed into the stream code in extra-hacky ways), we just fix it by caching the STREAM_CTRL in question. This is also done for some other STREAM_CTRLs that are called on each frame, such as playback duration. This indicates that the cache code has some inherent problem with answering such requests in a timely matter, and that there's no easy way around this. (Even if the cache is eventually rewritten, these things will probably have to be cached, otherwise you'd have to forcibly block until the stream implementation is done with a blocking read. The real question is why it worked fine with the forked cache, though.)
* | stream: add start time reportingwm42013-05-053-0/+9
| | | | | | | | | | | | Will be needed to override the demuxer's start time reporting. We could be lazy and special-case it since the result is always 0 for the streams that care, but doing it properly is better.
* | core: don't report byte-based playback position with dvdwm42013-05-054-0/+17
| | | | | | | | | | | | | | | | | | | | DVD playback uses a demuxer that signals to the frontend that timestamp resets are possible. This made the frontend calculate the OSD playback position based on the byte position and the total size of the stream. This actually broke DVD playback position display. Since DVD reports a a linear playback position, we don't have to rely on the demuxer reported position, so disable this functionality in case of DVD playback. This reverts the OSD behavior with DVD to the old behavior.
* | stream: remove unused new_ds_stream()wm42013-05-032-13/+0
| |
* | stream_bluray: remove the broken -bluray-chapter optionreimar2013-04-272-16/+2
| | | | | | | | | | | | | | | | | | | | Remove the broken -bluray-chapter option. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36175 b3059339-0415-0410-9bf9-f77b7e298cf2 Conflicts: DOCS/man/en/mplayer.1 cfg-common.h
* | stream_bluray: fix querying current chapterreimar2013-04-271-3/+1
| | | | | | | | | | | | | | | | | | br://: Fix querying current chapter. This also fixes specifying an end chapter via -chapter. Based on patch by Olivier Rolland [billl users.sourceforge.net] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36173 b3059339-0415-0410-9bf9-f77b7e298cf2
* | options: untangle track range parsing for stream_cddawm42013-04-211-17/+14
|/ | | | | | | | | Remove the "object settings" based track range parsing (needed by stream_cdda only), and make stream_cdda use CONF_TYPE_INT_PAIR. This makes the -vf parsing code completely independent from other options. A bit of that code was used by the mechanism removed with this commit.
* stream_cddb: fix compilation on MinGW-w64Stephen Hutchinson2013-04-061-1/+1
| | | | | Like the VCD case, stream_cddb.c relies on ntddcdrm.h, which is no longer under the ddk directory.
* vcd_read_win32.h: fix compilation on MinGW-w64Stephen Hutchinson2013-04-061-1/+1
| | | | | | | ntddcdrm.h is no longer under the 'ddk' directory in MinGW-w64, and since MPV focuses on it instead of the old MinGW32, there's no reason to keep that dir prefix, as it stops VCD support from being built at all for Windows.
* http: handle broken QuickTime Streaming Server headersreimar2013-04-041-3/+9
| | | | | | | | | | | | | Handle the severely broken headers QuickTime Streaming Server sends. Instead of ending the header with \r\n\r\n it ends with \r\n<4 byte MP3 header>\r\n. And programs like wget just silently accept this without even printing a warning!! git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35988 b3059339-0415-0410-9bf9-f77b7e298cf2 Note: see previous commit.
* http: fix for broken SHOUTcast streamsreimar2013-04-041-0/+6
| | | | | | | | | | | | | Support broken icy-metaint response from QuickTime Streaming Server. The full version string is "QuickTime Streaming Server 6.1.0/532". It sends a HTTP response header that contains an MP3 header! Fixes bug #2133. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35987 b3059339-0415-0410-9bf9-f77b7e298cf2 Note that in mpv, "http://" is mapped to ffmpeg currently, and this code is unused by default.
* vcd_read: cleanup ifdefsreimar2013-04-041-14/+7
| | | | | | | | | Clean up ifdefs so they make sense even if none or multiple are defined. Also choose Linux as fallback case instead of failing, this allows the code to compile e.g. on Android. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35971 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream: silence clang empty statement warningswm42013-03-191-12/+8
| | | | | | | | | | clang printed warnings like: stream/stream.c:692:65: warning: if statement has empty body [-Wempty-body] GET_UTF16(c, src < end - 1 ? get_le16_inc(&src) : 0,; This macro expands to "if(cond) ;". Replace it with an empty statement that doesn't lead to a clang warning.
* network: set default user-agent to MPlayer'swm42013-02-261-1/+1
| | | | | | | SHOUTcast bans "Mozilla" in the user-agent, Vimeo bans "Lavf" (part of the libavformat normal user-agent). "MPlayer 1.1-..." seems to work everywhere, and is close to the intented use (mpv is based on MPlayer, after all).
* core: redo how codecs are mapped, remove codecs.confwm42013-02-101-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use codec names instead of FourCCs to identify codecs. Rewrite how codecs are selected and initialized. Now each decoder exports a list of decoders (and the codec it supports) via add_decoders(). The order matters, and the first decoder for a given decoder is preferred over the other decoders. E.g. all ad_mpg123 decoders are preferred over ad_lavc, because it comes first in the mpcodecs_ad_drivers array. Likewise, decoders within ad_lavc that are enumerated first by libavcodec (using av_codec_next()) are preferred. (This is actually critical to select h264 software decoding by default instead of vdpau. libavcodec and ffmpeg/avconv use the same method to select decoders by default, so we hope this is sane.) The codec names follow libavcodec's codec names as defined by AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders have names different from the canonical codec name. The AVCodecDescriptor API is relatively new, so we need a compatibility layer for older libavcodec versions for codec names that are referenced internally, and which are different from the decoder name. (Add a configure check for that, because checking versions is getting way too messy.) demux/codec_tags.c is generated from the former codecs.conf (minus "special" decoders like vdpau, and excluding the mappings that are the same as the mappings libavformat's exported RIFF tables). It contains all the mappings from FourCCs to codec name. This is needed for demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the codec as determined by libavformat, while the other demuxers have to do this on their own, using the mp_set_audio/video_codec_from_tag() functions. Note that the sh_audio/video->format members don't uniquely identify the codec anymore, and sh->codec takes over this role. Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which provide cover the functionality of the removed switched. Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure container/video combinations (e.g. the sample Film_200_zygo_pro.mov) are played flipped. ffplay/avplay doesn't handle this properly either, so we don't care and blame ffmeg/libav instead.
* Check return values of some mp_find_..._config_file function calls for NULLwm42013-02-091-2/+5
|
* Remove BSD legacy TV/radio support (BT848 stuff)wm42013-02-064-1053/+0
| | | | | FreeBSD actually supports V4L2, and V4L2 supports this chip. Also, this chip is from 1997. Farewell.
* build: make it work on somewhat older ffmpeg versionswm42013-01-311-1/+1
| | | | | | Tested with n0.10.4. All these version checks are rather tricky, because Libav and FFmpeg change the same thing at slightly different versions.
* stream: set default HTTP user agent to "Mozilla/5.0"wm42013-01-311-1/+1
| | | | | | | | | | | Playing vimeo links using quvi support didn't work, even though clive could. clive is using quvi and curl to download videos from streaming sites, so if clive works mpv should always work as well. It didn't, and it turned out that it was due to the user agent. Change the default from whatever Lavf sends to what clive and cclive use. This will probably always work, as c(c)live are by the same author as libquvi, and there's a high chance it has been tested with all the supported sites.
* stream: fix reconnecting on broken network connectionswm42013-01-243-21/+50
| | | | | | | | | | | | | | | | This didn't work properly for HTTP with libavformat. The builtin HTTP implementation reconnects automatically on its own, while libavformat doesn't. Fix this by adding explicit reconnection support to stream_lavf.c, which simply destroys and recreates the AVIO context. It mostly works, though sometimes it mysteriously fails, spamming crap all over the terminal and feeding broken data to the decoders. This is probably due to itneractions with the cache. Also, reconnecting to unseekable HTTP streams will make it read the entire stream until the previous playback position is reached again. It's not known whether this change makes behavior with "strange" protocols like RTP better or worse.
* stream: uncrustify stream.c/.hwm42013-01-242-582/+664
| | | | The formatting almost made me break out in tears.
* stream: implement some HTTP specific options for stream_lavfwm42013-01-247-7/+61
| | | | | | | | | | | | | | | | | | The "http:" protocol has been switched to use ffmpeg's HTTP implementation some time ago. One problem with this was that many HTTP specific options stopped working, because they were obviously implemented for the internal HTTP implementation only. Add the missing things. Note that many options will work for ffmpeg only, as Libav's HTTP implementation is missing these. They will silently be ignored on Libav. Some options we can't fix: --ipv4-only-proxy, --prefer-ipv4, --prefer-ipv6 As far as I can see, not even libavformat internals distinguish between ipv4 and ipv6. --user, --passwd ffmpeg probably supports specifying these in the URL directly.
* cookies: fix crashwm42013-01-241-3/+3
| | | | | This was broken in 3f85094 (probably merge mistake). I guess nobody ever uses this feature.
* stream_cdda: support latest libcdio versionUoti Urpala2013-01-241-1/+31
|
* Silence two compiler warningswm42013-01-161-3/+2
| | | | Both should be harmless.
* video: decouple internal pixel formats from FourCCswm42013-01-135-84/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mplayer's video chain traditionally used FourCCs for pixel formats. For example, it used IMGFMT_YV12 for 4:2:0 YUV, which was defined to the string 'YV12' interpreted as unsigned int. Additionally, it used to encode information into the numeric values of some formats. The RGB formats had their bit depth and endian encoded into the least significant byte. Extended planar formats (420P10 etc.) had chroma shift, endian, and component bit depth encoded. (This has been removed in recent commits.) Replace the FourCC mess with a simple enum. Remove all the redundant formats like YV12/I420/IYUV. Replace some image format names by something more intuitive, most importantly IMGFMT_YV12 -> IMGFMT_420P. Add img_fourcc.h, which contains the old IDs for code that actually uses FourCCs. Change the way demuxers, that output raw video, identify the video format: they set either MP_FOURCC_RAWVIDEO or MP_FOURCC_IMGFMT to request the rawvideo decoder, and sh_video->imgfmt specifies the pixel format. Like the previous hack, this is supposed to avoid the need for a complete codecs.cfg entry per format, or other lookup tables. (Note that the RGB raw video FourCCs mostly rely on ffmpeg's mappings for NUT raw video, but this is still considered better than adding a raw video decoder - even if trivial, it would be full of annoying lookup tables.) The TV code has not been tested. Some corrective changes regarding endian and other image format flags creep in.
* Remove netstream supportwm42013-01-133-472/+0
| | | | | | | | | | | | | | | | | | | | | | This allowed to move the input stream layer across the network, allowing the user to play anything that mplayer could play remotely. For example, playing a DVD related on a remote server (say, with the host name "remotehost1") could be done by starting the netstream server on that remote server, and then running: mplayer mpst://remotehost1/dvd:// This would open the DVD on the remote host, and transfer the raw DVD sector reads over network. It works the same for other protocols, and all accesses to the stream layer are marshaled over network. It's comparable to the way the cache layer (--cache) works. It has questionable use and most likely was barely used at all. There's lots of potential for breakage, because it doesn't translate the stream CTRLs to network packets. Just get rid of it. The server used to be in TOOLS/netstream.c, and was accidentally removed earlier.
* Fix lots of bugs in mp_http URL handlingRudolf Polzer2013-01-102-7/+10
| | | | | Many instances of "http" were not changed to "mp_http", which made many aspects of the mp_http protocol handler broken.
* stream_lavf: warn if protocol not foundwm42012-12-281-1/+6
| | | | | | | | If ffmpeg returns AVERROR_PROTOCOL_NOT_FOUND, print a warning that ffmpeg should be compiled with network support. Note that stream_lavf.c itself includes a whitelist of directly supported ffmpeg protocols, so it can't happen that a completely unknown/madeup protocol triggers this message. (Unless the ffmpeg:// or lavf:// prefixes are used.)
* stream_dvd: fix angle mathRudolf Polzer2012-12-221-8/+7
| | | | | Stop changing the dvd_angle variable while opening a DVD. Fixes issues with multiple dvd:// URLs on one command line.
* path: add mp_find_config_file and reorganize some of the codeStefano Pigozzi2012-12-152-30/+39
| | | | | | | | | | | | | | Add `mp_find_config_file` to search different known paths and use that in ass_mp to look for the fontconfig configuration file. Some incidental changes spawned by this feature where: * Buffer allocation for the strings containing the paths is now performed with talloc. All of the allocations are done on a NULL context, but it still improves readability of the code. * Move the OSX function for lookup inside of a bundle: this code path was currently not used by the bundle generated with `make osxbundle`. The plan is to use it again in a future commit to get a fontconfig config file.
* Fix compilation with Libavwm42012-12-111-0/+2
| | | | | | | | | | Doesn't define AVPROBE_SCORE_RETRY for some reason. They use AVPROBE_SCORE_MAX/4 directly internally. AV_DISPOSITION_ATTACHED_PIC is not defined with the most recent Libav release. AVIOContext.av_class exists in Libav, but is apparently disabled in old releases. Disable it for now until people stop torturing me with old crap releases.
* audio: remove support for native alaw/mulaw/adpcm outputwm42012-12-111-3/+0
| | | | | | This is considered a worthless feature. Note that alaw/mulaw/adpcm input is unaffected: such data is handed to libavcodec and "decoded" to linear PCM.
* stream_lavf/demux_lavf: export/use HTTP MIME typewm42012-12-113-15/+17
| | | | | | | | | | | | | | | | | This is a fix for web radio streams that send raw AAC [1]. libavformat's AAC demuxer probe is picky enough to request hundreds of KBs data, which makes for a slow startup. To speed up stream startup, try use the HTTP MIME type to identify the format. The webstream in question sends an AAC specific MIME type, for which demux_lavf will force the AAC demuxer, without probing anything. ffmpeg/ffplay do the same thing. Note that as of ffmpeg commit 76d851b, av_probe_input_buffer() does the mapping from MIME type to demuxer. The actual mapping is not publicly accessible, and can only be used by calling that function. This will hopefully be rectified, and ideally ffmpeg would provide a function like find_demuxer_from_mime_type(). [1] http://lr2mp0.latvijasradio.lv:8000
* stream: handle mms streaming with ffmpegwm42012-12-113-14/+23
| | | | | | | | | | | | | | | | | | | | Use ffmpeg (stream_lavf) instead of internal mms support (asf_streaming.c) for mms://, mmsh://, mmst:// URLs. The old implementation is available under mp_mms:// etc. There are some caveats with this: - mms:// now always maps to mmsh://. It won't try mmst://. (I'm not sure if mms:// URLs really can use the mmst protocol, though.) - MMS streams under the http:// prefix are not handled. (ffmpeg ticket #2001.) (Was already broken in mpv since c02f25.) - It downloads all video streams now. MMS streams often have redundant video streams, which encode the main stream at different quality. The client is supposed to select one according to its bandwidth requirements. (Explicit MMS stream selection has been broken in mpv for a while, because MPOpts.vid maps to the stream number, not the demuxer's stream ID - but the old logic doesn't work anyway when using demuxer_lavf as opposed to demux_asf.)
* stream_dvd: add a stream_seek() callRudolf Polzer2012-12-071-0/+2
| | | | | This fixes use of -chapter together with -correct-pts and demux_lavf and stream_dvd.
* stream_ftp: cleanupsal2012-12-031-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stream ftp: Pass full buffer size to snprintf Previously the buffer size was always passed as one less than the underlying buffer's size. This is not using the underlying buffer to its full potential according to the C99 standard. The last byte of the buffers were never used. No vulnerabilities should have been caused by this mistake because the strings stored in the buffers were zero terminated at all times. Neither were out-of-array writes nor reads possible. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35488 b3059339-0415-0410-9bf9-f77b7e298cf2 stream ftp: open_f: Mark parameter file_format unused We have nothing to say about it, so we do not set *file_format. No need for compilers to emit a warning about it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35489 b3059339-0415-0410-9bf9-f77b7e298cf2 stream ftp: Set type to STREAMTYPE_STREAM Previously this was not set at all from within the stream_ftp module. This caused the run-time warning message "Streams need a type!". The actual behaviour should not be affected by this change. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@