summaryrefslogtreecommitdiffstats
path: root/stream/stream.h
Commit message (Collapse)AuthorAgeFilesLines
* core, timeline: cache external ordered chapter files tooStefano Pigozzi2012-09-181-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Previously, Matroska source files other than the initially opened one were always accessed without caching. Enable cache for extra files too. A separate cache process/thread is started for each file, which is less than optimal but probably better than no caching if the user explicitly enabled cache. This commit only implements caching for Matroska ordered chapters (not for EDL timeline). To build the timeline we need to demux the files in the current directory to look for segments with matching uuid. This first demux is done with no cache since we don't need to read a lot of the stream. If the file is recognized as one of the needed sources it's reopened with cache enabled. Also move the stream_cache_size global variable to the options struct. Conflicts: cfg-mplayer.h mplayer.c stream/stream.h timeline/tl_matroska.c
* core: fix DVD subtitle selectionwm42012-09-181-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add all subtitle tracks as reported by libdvdread at playback start. Display language for subtitle and audio tracks. This commit restores these features to the state when demux_mpg was default for DVD playback, and makes them work with demux_lavf and the recent changes to subtitle selection in the frontend. demux_mpg, which was the default demuxer for DVD playback, reordered the subtitle streams according to the "logical" subtitle track number, which conforms to the track layout reported by libdvdread, and is what stream_dvd expects for the STREAM_CTRL_GET_LANG call. demux_lavf, on the other hand, adds the streams in the order it encounters them in the MPEG stream. It seems this order is essentially random, and can't be mapped easily to what stream_dvd expects. Solve this by making demux_lavf hand out the MPEG stream IDs (using the demuxer_id field). The MPEG IDs are mapped by mplayer.c by special casing DVD playback (map_id_from/to_demuxer() functions). This mapping is essentially the same what demux_mpg did. Making demux_lavf reorder the streams is out of the question, because its stream handling is already messy enough. (Note that demux_lavf doesn't export stream IDs for other formats, because most time libavformat demuxers do not set AVStream.id, and we don't know which demuxers do. But we know that MPEG is safe.) Another major complication is that subtitle tracks are added lazily, as soon as the demuxer encounters the first subtitle packet for a given subtitle stream. Add the streams in advance. If a yet non-existent stream is selected, demux_lavf must be made to auto-select that subtitle stream as soon as it is added. Otherwise, the first subtitle packet would be lost. This is done by DEMUXER_CTRL_PRESELECT_SUBTITLE. demux_mpg didn't need this: the frontend code could just set ds->id to the desired stream number. But demux_lavf's stream IDs don't map directly to the stream number as used by libdvdread, which is why this hack is needed.
* Remove support for LIVE555 RTSP streamingwm42012-08-201-4/+0
| | | | | | | | | | | | The main excuse for removing this is that LIVE555 deprecated the API the mplayer implementation was using. The old API still seems to be somewhat supported, but must be explicitly enabled at LIVE555 compilation, so mplayer won't always work on any user installation. The implementation was also very messy, in C++, and FFmpeg support is available as alternative. Remove it completely.
* Remove dvdnav support (DVD menus)wm42012-08-161-1/+0
| | | | | | | | | | | | | | | | When the internal mplayer MPEG demuxer was removed (commit 1fde09db), the default demuxer when using dvdnav was set to libavformat. Now it turns out that this doesn't work with libavformat. It will terminate playback right after the audio runs out (instead of looping it like the video, or whatever it's supposed to do). I'm not sure what exactly the problem is, but since 1. even mplayer-svn can't handle DVD menus directly (missing highlights), 2. DVD menus are essentially worthless, and 3. I don't directly watch DVDs, don't bother with it and remove it. For basic playback, there's still libdvdread support. Also, use pkg-config for libdvdread, and drop support for in-tree libdvdread. Remove support for in-tree libdvdcss as well.
* commands, dvd, dvdnav, bluray: cleanup sub/audio track language displaymplayer-svn2012-08-031-1/+12
| | | | | | | | | | | | | | | | | | | | | Code cleanup: Use a stream_control instead of global functions to get the language associate with a audio or subtitle stream from the streaming layer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34736 b3059339-0415-0410-9bf9-f77b7e298cf2 Support showing the stream language with br:// playback. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34737 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix DVDs showing the subtitle language as "unknown" for a long time. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34777 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar Note: heavily modified by wm4 for this fork of mplayer.
* cache2: allow cache sizes up to 4 TBmplayer-svn2012-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove variable that is only assigned but never used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34791 b3059339-0415-0410-9bf9-f77b7e298cf2 Allow using a cache size of up to 4 TB. Obviously anything close to 4 GB will always fail on 32 bit systems. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34792 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace off_t by int64_t in cache code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34793 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove casts that are no longer necessary. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34794 b3059339-0415-0410-9bf9-f77b7e298cf2 Fix header file after r34793. Patch by Stephen Sheldon, sfsheldo gmail com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34802 b3059339-0415-0410-9bf9-f77b7e298cf2 Put #include <inttypes.h> into the header file where it should be. Reported by Stephen Sheldon, sfsheldo gmail com. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34798 b3059339-0415-0410-9bf9-f77b7e298cf2 Correct r34798. The header only needs stdint.h while the C file needs inttypes.h. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34799 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: reimar
* stream: add new stream control command STREAM_CTRL_GET_NUM_TITLESmplayer-svn2012-08-031-0/+1
| | | | | | | | | This provides the total number of titles (aka tracks) of CDs / VCDs / DVDs. Additionally, add a titles property to the get_property slave command. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34474 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: ib
* Replace 'q' printf length modifier by 'll'mplayer-svn2012-08-031-1/+1
| | | | | | | 'q' is just a deprecated synonym of 'll' that should no longer be used. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34224 b3059339-0415-0410-9bf9-f77b7e298cf2 Author: diego
* mplayer: rip out --capture supportwm42012-08-021-2/+0
| | | | | | | While this was an interesting idea, it wasn't actually useful. Basically it dumped the raw data (as requested by the demuxer) into a file. The result is only useful if the file format was raw or maybe some MPEG packet stream, but not with most modern file formats.
* stream: show negative seek position value in error messagereimar2011-07-061-1/+2
| | | | | | | Make "Invalid seek to negative position" message more useful by printing the actual value. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33556 b3059339-0415-0410-9bf9-f77b7e298cf2
* cleanup: remove more warningsClément Bœsch2011-05-021-1/+2
|
* stream.[ch], ass_mp: new stream function for whole-file readsUoti Urpala2011-03-031-0/+10
| | | | | | Add new stream_read_complete() function which reads the complete contents of file. Use that in ass_mp.c which had custom code to do the same.
* cleanup: demuxer.[ch]: remove unused code, make functions staticUoti Urpala2011-02-221-0/+3
| | | | | | | Remove some unused lines from demuxer.h. Make some demuxer.c functions static. Move new_ds_stream() declaration from demuxer.h to stream.h (the function is defined in stream.c). Clean up some code in mplayer.c that had commented-out free_demuxer_stream() calls.
* stream.h: check against huge negative values in stream_seek()reimar2010-12-161-0/+4
| | | | | | | | Add validity check for stream_seek argument to avoid a integer overflow for huge negative values that would break the internal state of the stream buffer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32702 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: read up to 64 KiB at once from stream_filereimar2010-11-141-0/+1
| | | | | | | | | Make the file protocol read up to 64 KiB at once when the cache is used, assuming that files will generally be readable with high bandwidth. This should improve performance when playing e.g. from high-latency network shares. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32616 b3059339-0415-0410-9bf9-f77b7e298cf2
* options: move some demux options to option structClément Bœsch2010-11-111-1/+0
| | | | | Following options were moved: audiofile, audiofile-cache, subfile, demuxer, audio-demuxer, sub-demuxer, [no]extbased.
* cache, stream: avoid extra memcpy when using cachereimar2010-11-071-0/+4
| | | | | | | | | | Add a stream_read_internal() function that reads directly into a given buffer instead of the stream's internal one. Use this to read directly into cache memory, avoiding a memcpy(). This requires also adding a stream_seek_internal() as the normal seek function reads into the stream's buffer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32559 b3059339-0415-0410-9bf9-f77b7e298cf2
* Add a simple capture feature (-capture)Uoti Urpala2010-11-021-0/+3
| | | | | | | | | | | | | | | | | If a specified key is pressed during playback, the current stream is captured to a file, similar to what -dumpstream achieves. original patch by Pásztor Szilárd, don tricon hu Taken from the following svn commits, but with several fixes and modifications (one obvious user-visible difference is that the default key binding is 'C', not 'c'): git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32524 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32529 b3059339-0415-0410-9bf9-f77b7e298cf2 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32530 b3059339-0415-0410-9bf9-f77b7e298cf2
* cache: add sanity-check for sector sizereimar2010-11-021-1/+2
| | | | | | | Add sanity-check for sector size to avoid strange crashes if it is too large. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31914 b3059339-0415-0410-9bf9-f77b7e298cf2
* configure: Rename "network" variable and option to "networking"diego2010-11-021-2/+2
| | | | | | This avoids conflicts with the FFmpeg variable of the same name. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31749 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream_bluray: add unencrypted Blu-ray playbackben2010-11-021-0/+4
| | | | | | | Support for unencrypted Blu-ray playback through libbluray. Use it through: mplayer br:////path/to/disc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31631 b3059339-0415-0410-9bf9-f77b7e298cf2
* stream.h: support backswards stream_skip() within bufferreimar2010-11-021-1/+1
| | | | | | | Never just ignore a backwards skip, even if the stream is not seekable it might still be in a buffer. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31465 b3059339-0415-0410-9bf9-f77b7e298cf2
* Merge svn changes up to r31256Uoti Urpala2010-05-301-1/+2
|\
| * Document time scale for stream_check_interrupt argument.reimar2010-05-281-1/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31253 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Drop pointless _st suffix from 'struct stream'.diego2010-05-271-8/+8
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31237 b3059339-0415-0410-9bf9-f77b7e298cf2
* | stream.h: remove bad EOF check in stream_seek()Uoti Urpala2010-05-221-2/+0
| | | | | | | | Also remove a redundant stream->eof = 0 in demuxer.c.
* | options: move -chapter values to option structUoti Urpala2010-04-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | -chapter can optionally take a range with a start and an end. Add a new option type which supports such values and use that instead of a custom per-option function. This commit also fixes a build configuration bug: before the availability of the -chapter option depended on DVD functionality being enabled in the binary, even though the option works with other sources too.
* | stream_ffmpeg, demux_lavf: Use flv demuxer for rtmp streamsUoti Urpala2010-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | Use lavf's flv demuxer for rtmp/rtmps/... stream types. Letting generic format probing handle this could work, but with the current probing implementation it'd at least depend on not-really-guaranteed details of the stream layer (probing different formats and then decoding depends on seeking back in between; rtmp streams don't support such seeking directly so would need to rely on details of caching behavior).
* | Merge svn changes up to r30876Uoti Urpala2010-03-101-0/+5
|\|
| * Define O_BINARY in stream/stream.h unless it is defined yet, and use itkomh2010-03-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | in other places. This removes platform specific checks and prevents repeated definitions of O_BINARY. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30850 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30815Uoti Urpala2010-03-101-1/+1
|\|
| * Extend stream_read_line to support reading lines from UTF-16 encoded filesreimar2010-02-281-1/+1
| | | | | | | | | | | | | | and use this to support reading UTF-16 encoded subtitle files in subreader.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30799 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30798Uoti Urpala2010-03-101-24/+1
|\|
| * Move stream_read_line implementation from stream.h to stream.c,reimar2010-02-281-26/+1
| | | | | | | | | | | | | | | | it is not speed critical and the function call overhead is not relevant for its overall speed anyway. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30796 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Simplify handling of 0-termination in stream_read_linereimar2010-02-281-3/+5
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30795 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30748Uoti Urpala2010-03-101-3/+5
|\|
| * Mark stream open filename parameter as const, the filename string is notreimar2010-02-251-3/+3
| | | | | | | | | | | | | | modified by these functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30739 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30702Uoti Urpala2010-03-101-4/+26
|\|
| * Declare functions from network.c in network.h.diego2010-02-221-1/+0
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30698 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Move struct streaming_control from network.h to stream.h, where it is used.diego2010-02-221-3/+23
| | | | | | | | | | | | | | This will help in declaring some public functions where they really belong. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30697 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30694Uoti Urpala2010-03-101-1/+2
|\|
| * Declare stream_fill_buffer() and stream_seek_long() unconditionally.diego2010-02-211-2/+3
| | | | | | | | | | | | | | | | They are public functions that are unconditionally compiled, so they should not be declared conditionally. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30691 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30672Uoti Urpala2010-03-101-0/+2
|\|
| * Do not discard stream buffer on eof, instead reuse it to slightly improvereimar2010-02-201-0/+2
| | | | | | | | | | | | | | format autodetection with -nocache and non-seekable streams. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30668 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+18
|\|
| * Add license header to all files missing it in the stream subdirectory.diego2010-01-301-0/+18
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30468 b3059339-0415-0410-9bf9-f77b7e298cf2
* | stream: improve EOF handling in seeksUoti Urpala2010-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reset stream 'eof' flag when a seek succeeds, and allow seeking to a position at or past EOF (in the sense that the seek succeeds and stream_tell() then returns that position). This fixes at least some demuxer problems where an attempt to read the index from the end of an incomplete file would set the 'eof' flag and cause subsequent reads to fail, even if failure to read the index would otherwise be nonfatal and demuxing could continue after seeking back. Partially based on a patch from Laurent <laurent.aml@gmail.com>.
* | Merge svn changes up to r30216Uoti Urpala2010-01-081-0/+1
|\|
| * Add a few missing header #includes and #defines.diego2010-01-041-0/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30207 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29962Uoti Urpala2009-11-231-5/+9
|\|
| * Finally rename the STREAM_SEEK define to MP_STREAM_SEEK, there are just too manyreimar2009-11-221-5/+5
| | | | | | | | | | | | | | name clashes, in particular with Windows headers (which define STREAM_SEEK as an enum type). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29962 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Deobfuscate the special hack to disable cache for live555.reimar2009-11-171-0/+4
| | | | | | | | | | | | | | | | | | Cache can not be used for it, since it does not provide any data stream, the data is provided to the demuxer "behind MPlayer's back". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29930 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-3/+3
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-3/+3
| |
* | Merge svn changes up to r28641Uoti Urpala2009-02-181-1/+1
|\| | | | | | | | | | | | | | | Convert vo_x11_border (used in vo_gl/gl2 though the vo_gl_border macro) to use a wrapper macro in old-st