aboutsummaryrefslogtreecommitdiffhomepage
path: root/demux/demux.h
Commit message (Collapse)AuthorAge
* demux: add function to read packets asychronouslyGravatar wm42014-07-18
|
* demux: drop some unused definitionsGravatar wm42014-07-17
|
* demux: add a demuxer threadGravatar wm42014-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a thread to the demuxer which reads packets asynchronously. It will do so until a configurable minimum packet queue size is reached. (See options.rst additions.) For now, the thread is disabled by default. There are some corner cases that have to be fixed, such as fixing cache behavior with webradios. Note that most interaction with the demuxer is still blocking, so if e.g. network dies, the player will still freeze. But this change will make it possible to remove most causes for freezing. Most of the new code in demux.c actually consists of weird caches to compensate for thread-safety issues (with the previously single-threaded design), or to avoid blocking by having to wait on the demuxer thread. Most of the changes in the player are due to the fact that we must not access the source stream directly. the demuxer thread already accesses it, and the stream stuff is not thread-safe. For timeline stuff (like ordered chapters), we enable the thread for the current segment only. We also clear its packet queue on seek, so that the remaining (unconsumed) readahead buffer doesn't waste memory. Keep in mind that insane subtitles (such as ASS typesetting muxed into mkv files) will practically disable the readahead, because the total queue size is considered when checking whether the minimum queue size was reached.
* demux: remove accurate_seek fieldGravatar wm42014-07-08
| | | | It's unused now. (Only the dvd code used it until recently.)
* Remove stream_pts stuffGravatar wm42014-07-06
| | | | | This was used by DVD/BD, but its usage was removed with one of the previous commits.
* dvd: fix first subtitle with delayed subtitle streamsGravatar wm42014-07-06
| | | | | | This was accidentally broken with moving the DVD code to demux_disc.c. Also remove an abort() call meant for debugging.
* demux: minor simplificationGravatar wm42014-07-06
| | | | Oops, should have been part of commit 37085788.
* demux: minor simplification to internal APIGravatar wm42014-07-05
| | | | Also some other unrelated minor changes.
* dvd: move angle switching codeGravatar wm42014-07-05
| | | | | No need to provide a "nice" API for it; just do this stuff directly in the command code.
* dvd, bluray, cdda: add demux_disc containing all related hacksGravatar wm42014-07-05
| | | | | | | | | | | | DVD and Bluray (and to some extent cdda) require awful hacks all over the codebase to make them work. The main reason is that they act like container, but are entirely implemented on the stream layer. The raw mpeg data resulting from these streams must be "extended" with the container-like metadata transported via STREAM_CTRLs. The result were hacks all over demux.c and some higher-level parts. Add a "disc" pseudo-demuxer, and move all these hacks and special-cases to it.
* demux: make start time a simple fieldGravatar wm42014-07-05
| | | | Simpler, especially for later changes.
* demux, stream: change metadata notificationGravatar wm42014-07-05
| | | | | | | | | | | | (Again.) This time, we simply make it event-based, as it should be. This is done for both demuxer metadata and stream metadata. For some ogg-over-icy streams, 2 updates are reported on stream start. This is because libavformat reports an update right on start, while including the same info in the "static" metadata. I don't know if that's a bug or a feature.
* demux: make replaygain per-trackGravatar wm42014-07-05
| | | | | | It's unlikely that files with multiple audio tracks and with replaygain actually happen, but this change might help avoid minor corner cases with later changes.
* demux: move packet functions to a separate source fileGravatar wm42014-07-05
|
* demux: move packet list functionsGravatar wm42014-07-05
| | | | Move them to the only place where they are used, demux_subreader.c.
* demux: minor cleanupsGravatar wm42014-07-01
|
* demux: simplify packet resizingGravatar wm42014-06-13
| | | | | Actually we don't need to resize packets; we just need to make them shorter.
* demux: fix compilation with FFmpeg gitGravatar wm42014-06-12
| | | | | | | | | FFmpeg requires a bullshit padding after each input buffer, and they just increased that padding without warning and without ABI or API bump. We need this only in one file (although mp_image hardcodes something similar, for which no FFmpeg API define is available), so drop our own define.
* command: redo ancient TV/DVB/PVR commandsGravatar wm42014-06-11
| | | | | | | | | | | | | | | | | | Convert all these commands to properties. (Except tv_last_channel, not sure what to do with this.) Also, internally, don't access stream details directly, but dispatch commands with stream ctrls. Many of the new properties are a bit strange, because they're write- only. Also remove some OSD output these commands produced, because I couldn't be bothered to port these. In general, this makes everything much cleaner, and will also make it easier to e.g. move the demuxer to its own thread. Don't bother updating input.conf, but changes.rst documents how old commands map to the new ones. Mostly untested, due to lack of hardware.
* mp_tags: move generic mp_tags stuff into its own .c/.h files in common/Gravatar Kevin Mitchell2014-04-13
| | | | | | rename add_metadata to the more genera/descriptive mp_tags_copy_items_from_av_dictionary Signed-off-by: wm4 <wm4@nowhere>
* demux: add replaygain_data field to demuxer_tGravatar Alessandro Ghedini2014-04-04
|
* player: remove demuxer chapoter API wrappersGravatar wm42014-03-25
| | | | | | Instead, always use the mpctx->chapters array. Before this commit, this array was used only for ordered chapters and such, but now it's always populated if there are chapters.
* demux_libass: change how external ASS subtitles are loadedGravatar wm42014-03-15
| | | | | | | | | | Instead of parsing the ASS file in demux_libass.c and trying to pass the ASS_Track to the subtitle renderer, just read all file data in demux_libass.c, and let the subtitle renderer pass the file contents to ass_process_codec_private(). (This happens to parse full files too.) Makes the code simpler, though it also relies harder on the (messy) probe logic in demux_libass.c.
* client API: add event for metadata changesGravatar wm42014-02-19
|
* demux: expose stream_type_name() functionGravatar wm42014-02-16
|
* demux: fill metadata directly, instead of using wrapper functionsGravatar wm42014-02-06
| | | | | | Get rid of demux_info_add[_bstr] and demuxer_add_chapter_info. Make demuxer_add_chapter_info return the chapter index for convenience.
* demux_lavf: clear metadata on update, instead of merging itGravatar wm42014-02-06
| | | | | Assume a metadata update is a full update. Clear the previous metadata, so that tags which existed only in the previous metadata are removed.
* demux: handle tag updates differentlyGravatar wm42014-02-06
| | | | | | | | | | | | | | | | Instead of printing lines like: Demuxer info GENRE changed to Alternative Rock Just output all tags once they change. The assumption is that individual tags rarely change, while all tags change in the common case. This changes tag updates to use polling. This could be fixed later, although the ICY stuff makes it a bit painful, so maybe it will remain this way. Also remove DEMUXER_CTRL_UPDATE_INFO. This was intended to check for tag updates, but now we use a different approach.
* demux_mkv: nicer edition outputGravatar wm42014-01-23
| | | | | | | | | | | If there's more than one edition, print the list of editions, including the edition name, whether the edition is selected, whether the edition is default, and the command line option to select the edition. (Similar to stream list.) Move reading the tags to a separate function process_tags(), which is called when all other state is parsed. Otherwise, that tags will be lost if chapters are read after the tags.
* demux_subreader: reject file if not opened by --subGravatar wm42014-01-04
| | | | | | | demux_subreader.c contains the old MPlayer subtitle parser, and I have absolutely no confidence in this (very crappy) code. There might be one or two security risks associated with running that code on arbitrary input.
* demux: don't prefix tag output with demuxer nameGravatar wm42013-12-21
| | | | Add a separate mp_log instance for this purpose.
* demux: mp_msg conversionsGravatar wm42013-12-21
| | | | | | | The TV code pretends to be part of stream/, but it's actually demuxer code too. The audio_in code is shared between the TV code and stream_radio.c, so stream_radio.c needs a small hack until stream.c is converted.
* Split mpvcore/ into common/, misc/, bstr/Gravatar wm42013-12-17
|
* demux: export dts from demux_lavf, use it for aviGravatar wm42013-11-25
| | | | | | | | | Having the DTS directly can be useful for restoring PTS values. The avi file format doesn't actually store PTS values, just DTS. An older hack explicitly exported the DTS as PTS (ignoring the [I assume] genpts generated non-sense PTS), which is not necessary anymore due to this change.
* demux: rename demux_packet.h to packet.hGravatar wm42013-11-18
| | | | This always bothered me.
* demux: remove unused commandsGravatar wm42013-11-16
| | | | These were replaced with DEMUXER_CTRL_SWITCHED_TRACKS a while ago.
* demux: remove movi_start/movi_end fieldsGravatar wm42013-11-03
| | | | | | | Pointless, using stream->start_pos/end_pos instead. demux_mf was the only place where this was used specially, but we can rely on timestamps instead for this case.
* matroska: store segment/edition uids in a single structureGravatar Ben Boeckel2013-10-07
| | | | | | To support edition references in matroska chapters, editions need to be remembered for each chapter and source. To facilitate easier management of these now-paired uids, a single structure is used.
* cosmetics: replace "CTRL" defines by enumsGravatar wm42013-10-02
| | | | Because why not.
* matroska: fix uninitialized memory accesses with ordered chaptersGravatar Ben Boeckel2013-09-26
| | | | | | | There is uninitialized memory access if the actual size isn't passed along. In the worst case, this can cause a source to be loaded against the uninitialized memory, causing a false count of found versus required sources, preventing the "Failed to find ordered chapter part" message.
* demux: retrieve per-chapter metadataGravatar wm42013-09-08
| | | | | | | | | | Retrieve per-chapter metadata, but don't do much with it. We just make the metadata of the _current_ chapter available as chapter-metadata property. Returning the full chapter list with metadata would be no problem, except that the property interface isn't really good with structured data, so it's not available for now. Not sure if it's worth it, but it was requested via github issue #201.
* demux: refactor tag handlingGravatar wm42013-09-08
| | | | | Make the code somewhat reuseable, instead of bound to a single demuxer instance. The plan is to add support for per-chapter tags later.
* core: add a playlist demuxerGravatar wm42013-08-26
| | | | | | | | | Modeled after the old playlist_parser.c, but actually new code, and it works a bit differently. Demuxers (and sometimes streams) are the component that should be used to open files and to determine the file format. This was already done for subtitles, but playlists still use a separate code path.
* demux: remove unused audio_delay parameter from demux_seek()Gravatar wm42013-08-22
| | | | Used to be needed by demux_avi.
* core: move contents to mpvcore (2/2)Gravatar Stefano Pigozzi2013-08-06
| | | | Followup commit. Fixes all the files references.
* options: simplify --correct-pts handlingGravatar wm42013-07-26
| | | | | | Remove the (now unused) code for determining correct-pts mode based on the demuxer in use. Change its description in the manpage to reflect what this option does now.
* demux: assume correct-pts mode by defaultGravatar wm42013-07-12
| | | | | | | | All demuxers make a reasonable effort to set packet timestamps, and thus support correct-pts mode. This commit also implicitly switches demux_rawvideo to correct-pts mode. We still allow demuxers to disable correct-pts mode in theory.
* demux: remove useless author/comment fieldsGravatar wm42013-07-12
| | | | Same deal as with previous commit.
* demux: rewrite probing and demuxer initializationGravatar wm42013-07-12
| | | | | | | | | | | | | | Get rid of the strange and messy reliance on DEMUXER_TYPE_ constants. Instead of having two open functions for the demuxer callbacks (which somehow are both optional, but you can also decide to implement both...), just have one function. This function takes a parameter that tells the demuxer how strictly it should check for the file headers. This is a nice simplification and allows more flexibility. Remove the file extension code. This literally did nothing (anymore). Change demux_lavf so that we check our other builtin demuxers first before libavformat tries to guess by file extension.
* core: change open_stream and demux_open signatureGravatar wm42013-07-12
| | | | | | | | | | | This removes the dependency on DEMUXER_TYPE_* and the file_format parameter from the stream open functions. Remove some of the playlist handling code. It looks like this was needed only for loading linked mov files with demux_mov (which was removed long ago). Delete a minor bit of dead network-related code from stream.c as well.