summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-11 19:17:51 +0200
committerwm4 <wm4@nowhere>2013-07-11 19:17:51 +0200
commit6ede485e4b2ea1093e84d8589a1c321fe8a8462a (patch)
tree83ae0b1b63c682b47bcba5a8c6607467adbd79b0 /demux/demux.h
parentfa74be880c27b350615f62dd4a0d6a32be56c60e (diff)
downloadmpv-6ede485e4b2ea1093e84d8589a1c321fe8a8462a.tar.bz2
mpv-6ede485e4b2ea1093e84d8589a1c321fe8a8462a.tar.xz
core: don't access demux_stream outside of demux.c, make it private
Generally remove all accesses to demux_stream from all the code, except inside of demux.c. Make it completely private to demux.c. This simplifies the code because it removes an extra concept. In demux.c it is reduced to a simple packet queue. There were other uses of demux_stream, but they were removed or are removed with this commit. Remove the extra "ds" argument to demux fill_buffer callback. It was used by demux_avi and the TV pseudo-demuxer only. Remove usage of d_video->last_pts from the no-correct-pts code. This field contains the last PTS retrieved after a packet that is not NOPTS. We can easily get this value manually because we read the packets ourselves. Reuse sh_video->last_pts to store the packet PTS values. It was used only by the correct-pts code before, and like d_video->last_pts, it is reset on seek. The behavior should be exactly the same.
Diffstat (limited to 'demux/demux.h')
-rw-r--r--demux/demux.h24
1 files changed, 2 insertions, 22 deletions
diff --git a/demux/demux.h b/demux/demux.h
index 4d4d861b7d..a3e48a24f3 100644
--- a/demux/demux.h
+++ b/demux/demux.h
@@ -88,22 +88,6 @@ enum timestamp_type {
// demux_lavf can pass lavf buffers using FF_INPUT_BUFFER_PADDING_SIZE instead
#define MP_INPUT_BUFFER_PADDING_SIZE 16
-typedef struct demux_stream {
- enum stream_type stream_type;
- double last_pts; // pts of the last packet that was read
- int last_pts_bytes; // number of bytes read after last pts stamp
- int eof; // end of demuxed stream? (true if all buffer empty)
-//---------------
- int fill_count; // number of unsuccessful tries to get a packet
- int packs; // number of packets in buffer
- int bytes; // total bytes of packets in buffer
- struct demux_packet *head;
- struct demux_packet *tail;
- struct demuxer *demuxer; // parent demuxer structure (stream handler)
-// ---- stream header ----
- struct sh_stream *gsh;
-} demux_stream_t;
-
#define MAX_SH_STREAMS 256
struct demuxer;
@@ -126,7 +110,7 @@ typedef struct demuxer_desc {
// Mandatory if safe_check == 1, else optional
int (*check_file)(struct demuxer *demuxer);
/// Get packets from file, return 0 on eof. Mandatory
- int (*fill_buffer)(struct demuxer *demuxer, struct demux_stream *ds);
+ int (*fill_buffer)(struct demuxer *demuxer);
/// Open the demuxer, return demuxer on success, NULL on failure
struct demuxer *(*open)(struct demuxer *demuxer); // Optional
/// Close the demuxer
@@ -249,15 +233,11 @@ void free_demuxer(struct demuxer *demuxer);
int 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);
-
-int demux_fill_buffer(struct demuxer *demux, struct demux_stream *ds);
-
-void ds_free_packs(struct demux_stream *ds);
struct demux_packet *demux_read_packet(struct sh_stream *sh);
double demux_get_next_pts(struct sh_stream *sh);
bool demux_has_packet(struct sh_stream *sh);
+bool demux_stream_eof(struct sh_stream *sh);
struct demuxer *demux_open(struct MPOpts *opts, struct stream *stream,
int file_format, char *filename);