diff options
author | wm4 <wm4@nowhere> | 2013-04-14 19:19:35 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-20 23:28:24 +0200 |
commit | 654c34f77166d24914d3ff0a2923c128d846430d (patch) | |
tree | 8b0cde907cfe3e55a0ecbe86256703582d671d21 /demux/demux.h | |
parent | 06eee1b6751c43189efd994fa296c9753a89b89c (diff) | |
download | mpv-654c34f77166d24914d3ff0a2923c128d846430d.tar.bz2 mpv-654c34f77166d24914d3ff0a2923c128d846430d.tar.xz |
demux: add functions to simplify demuxers
Some preparations to simplify demux_mkv and demux_lavf.
struct demux_stream manages state for each stream type that is being
demuxed (audio/video/sub). demux_stream is rather annoying, especially
the id and sh members, which are often used by the demuxers to determine
current stream and so on. Demuxers don't really have to access this,
except for testing whether a stream is selected and to add packets.
Add a new_sh_stream(), which allows creating streams without having the
caller specify any kind of stream ID. Demuxers should just use sh_stream
pointers, instead of multiple kinds of IDs and indexes.
Diffstat (limited to 'demux/demux.h')
-rw-r--r-- | demux/demux.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/demux/demux.h b/demux/demux.h index d5f269aa7c..f3dee7bf86 100644 --- a/demux/demux.h +++ b/demux/demux.h @@ -311,6 +311,8 @@ void free_demuxer(struct demuxer *demuxer); struct sh_stream *ds_gsh(struct demux_stream *ds); +void demuxer_add_packet(demuxer_t *demuxer, struct sh_stream *stream, + demux_packet_t *dp); void ds_add_packet(struct demux_stream *ds, struct demux_packet *dp); void ds_read_packet(struct demux_stream *ds, struct stream *stream, int len, double pts, int64_t pos, bool keyframe); @@ -419,4 +421,6 @@ int demuxer_angles_count(struct demuxer *demuxer); struct sh_stream *demuxer_stream_by_demuxer_id(struct demuxer *d, enum stream_type t, int id); +bool demuxer_stream_is_selected(struct demuxer *d, struct sh_stream *stream); + #endif /* MPLAYER_DEMUXER_H */ |