diff options
Diffstat (limited to 'libmpdemux/demuxer.h')
-rw-r--r-- | libmpdemux/demuxer.h | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 8cea2ace78..be4339b62e 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -7,9 +7,8 @@ #include <string.h> #include "stream/stream.h" -#ifdef USE_ASS -#include "libass/ass_types.h" -#endif + +struct MPOpts; #define MAX_PACKS 4096 #ifdef HAVE_TV_BSDBT848 @@ -96,7 +95,7 @@ #define MP_INPUT_BUFFER_PADDING_SIZE 8 // Holds one packet/frame/whatever -typedef struct demux_packet_st { +typedef struct demux_packet { int len; double pts; double endpts; @@ -105,11 +104,11 @@ typedef struct demux_packet_st { unsigned char* buffer; int flags; // keyframe, etc int refcount; //refcounter for the master packet, if 0, buffer can be free()d - struct demux_packet_st* master; //pointer to the master packet if this one is a cloned one - struct demux_packet_st* next; + struct demux_packet *master; //pointer to the master packet if this one is a cloned one + struct demux_packet *next; } demux_packet_t; -typedef struct { +typedef struct demux_stream { int buffer_pos; // current buffer position int buffer_size; // current buffer size unsigned char* buffer; // current buffer, never free() it, always use free_demux_packet(buffer_ref); @@ -127,7 +126,7 @@ typedef struct { demux_packet_t *last; // append new packets from input stream to here demux_packet_t *current;// needed for refcounting of the buffer int id; // stream ID (for multiple audio/video streams) - struct demuxer_st *demuxer; // parent demuxer structure (stream handler) + struct demuxer *demuxer; // parent demuxer structure (stream handler) // ---- asf ----- demux_packet_t *asf_packet; // read asf fragments here int asf_seq; @@ -137,7 +136,7 @@ typedef struct { void* sh; } demux_stream_t; -typedef struct demuxer_info_st { +typedef struct demuxer_info { char *name; char *author; char *encoder; @@ -149,15 +148,12 @@ typedef struct demuxer_info_st { #define MAX_V_STREAMS 256 #define MAX_S_STREAMS 32 -struct demuxer_st; - -extern int correct_pts; -extern int user_correct_pts; +struct demuxer; /** * Demuxer description structure */ -typedef struct demuxers_desc_st { +typedef struct demuxer_desc { const char *info; ///< What is it (long name and/or description) const char *name; ///< Demuxer name, used with -demuxer switch const char *shortdesc; ///< Description printed at demuxer detection @@ -168,26 +164,26 @@ typedef struct demuxers_desc_st { int safe_check; ///< If 1 detection is safe and fast, do it before file extension check /// Check if can demux the file, return DEMUXER_TYPE_xxx on success - int (*check_file)(struct demuxer_st *demuxer); ///< Mandatory if safe_check == 1, else optional + int (*check_file)(struct demuxer *demuxer); ///< Mandatory if safe_check == 1, else optional /// Get packets from file, return 0 on eof - int (*fill_buffer)(struct demuxer_st *demuxer, demux_stream_t *ds); ///< Mandatory + int (*fill_buffer)(struct demuxer *demuxer, demux_stream_t *ds); ///< Mandatory /// Open the demuxer, return demuxer on success, NULL on failure - struct demuxer_st* (*open)(struct demuxer_st *demuxer); ///< Optional + struct demuxer* (*open)(struct demuxer *demuxer); ///< Optional /// Close the demuxer - void (*close)(struct demuxer_st *demuxer); ///< Optional + void (*close)(struct demuxer *demuxer); ///< Optional // Seek - void (*seek)(struct demuxer_st *demuxer, float rel_seek_secs, float audio_delay, int flags); ///< Optional + void (*seek)(struct demuxer *demuxer, float rel_seek_secs, float audio_delay, int flags); ///< Optional // Control - int (*control)(struct demuxer_st *demuxer, int cmd, void *arg); ///< Optional + int (*control)(struct demuxer *demuxer, int cmd, void *arg); ///< Optional } demuxer_desc_t; -typedef struct demux_chapter_s +typedef struct demux_chapter { uint64_t start, end; char* name; } demux_chapter_t; -typedef struct demux_attachment_s +typedef struct demux_attachment { char* name; char* type; @@ -195,7 +191,7 @@ typedef struct demux_attachment_s unsigned int data_size; } demux_attachment_t; -typedef struct demuxer_st { +typedef struct demuxer { const demuxer_desc_t *desc; ///< Demuxer description structure off_t filepos; // input stream current pos. off_t movi_start; @@ -214,9 +210,9 @@ typedef struct demuxer_st { demux_stream_t *sub; // dvd subtitle buffer/demuxer // stream headers: - void* a_streams[MAX_A_STREAMS]; // audio streams (sh_audio_t) - void* v_streams[MAX_V_STREAMS]; // video sterams (sh_video_t) - void *s_streams[MAX_S_STREAMS]; // dvd subtitles (flag) + struct sh_audio *a_streams[MAX_A_STREAMS]; + struct sh_video *v_streams[MAX_V_STREAMS]; + struct sh_sub *s_streams[MAX_S_STREAMS]; demux_chapter_t* chapters; int num_chapters; @@ -226,6 +222,7 @@ typedef struct demuxer_st { void* priv; // fileformat-dependent data char** info; + struct MPOpts *opts; } demuxer_t; typedef struct { @@ -307,8 +304,8 @@ static inline void *realloc_struct(void *ptr, size_t nmemb, size_t size) { return realloc(ptr, nmemb * size); } -demux_stream_t* new_demuxer_stream(struct demuxer_st *demuxer,int id); -demuxer_t* new_demuxer(stream_t *stream,int type,int a_id,int v_id,int s_id,char *filename); +demux_stream_t* new_demuxer_stream(struct demuxer *demuxer,int id); +demuxer_t* new_demuxer(struct MPOpts *opts, stream_t *stream,int type,int a_id,int v_id,int s_id,char *filename); void free_demuxer_stream(demux_stream_t *ds); void free_demuxer(demuxer_t *demuxer); @@ -371,7 +368,7 @@ static inline int avi_stream_id(unsigned int id){ return a*10+b; } -demuxer_t* demux_open(stream_t *stream,int file_format,int aid,int vid,int sid,char* filename); +demuxer_t* demux_open(struct MPOpts *opts, stream_t *stream,int file_format,int aid,int vid,int sid,char* filename); void demux_flush(demuxer_t *demuxer); int demux_seek(demuxer_t *demuxer,float rel_seek_secs,float audio_delay,int flags); demuxer_t* new_demuxers_demuxer(demuxer_t* vd, demuxer_t* ad, demuxer_t* sd); |