summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-09-07 15:12:24 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitb9be20b529de8f47e795d9a869299548d8788528 (patch)
tree039e425a0a945a703b0ac8aee94b37308c7e74cc /demux/demux.h
parent8a83430ae77602feb0db4f9cacc8d6d9f63534ce (diff)
downloadmpv-b9be20b529de8f47e795d9a869299548d8788528.tar.bz2
mpv-b9be20b529de8f47e795d9a869299548d8788528.tar.xz
demux: return packets directly from demuxer instead of using sh_stream
Preparation for other potential changes to separate demuxer cache/thread and actual demuxers. Most things are untested, but it seems to work somewhat.
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/demux/demux.h b/demux/demux.h
index 3a4b7dd331..b8d5cb5ee0 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -111,7 +111,11 @@ typedef struct demuxer_desc {
// Return 0 on success, otherwise -1
int (*open)(struct demuxer *demuxer, enum demux_check check);
// The following functions are all optional
- int (*fill_buffer)(struct demuxer *demuxer); // 0 on EOF, otherwise 1
+ // Try to read a packet. Return false on EOF. If true is returned, the
+ // demuxer may set *pkt to a new packet (the reference goes to the caller).
+ // If *pkt is NULL (the value when this function is called), the call
+ // will be repeated.
+ bool (*read_packet)(struct demuxer *demuxer, struct demux_packet **pkt);
void (*close)(struct demuxer *demuxer);
void (*seek)(struct demuxer *demuxer, double rel_seek_secs, int flags);
int (*control)(struct demuxer *demuxer, int cmd, void *arg);
@@ -252,7 +256,6 @@ struct demux_free_async_state *demux_free_async(struct demuxer *demuxer);
void demux_free_async_force(struct demux_free_async_state *state);
bool demux_free_async_finish(struct demux_free_async_state *state);
-void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp);
void demuxer_feed_caption(struct sh_stream *stream, demux_packet_t *dp);
struct demux_packet *demux_read_packet(struct sh_stream *sh);