avi: rewrite index playback

disable code, start on reimplementing loop based operation.
Rewrite the index handling so that all streams use their own index for decoding
media.
This commit is contained in:
Wim Taymans 2009-09-21 18:04:25 +02:00 committed by Wim Taymans
parent 89bcbbbe7c
commit 9c37611dfa
2 changed files with 631 additions and 391 deletions

File diff suppressed because it is too large Load diff

View file

@ -49,19 +49,6 @@ G_BEGIN_DECLS
#define GST_AVI_INDEX_ENTRY_FLAG_KEYFRAME 1
/* 48 bytes */
typedef struct {
guint index_nr; /* = (entry-index_entries)/sizeof(gst_avi_index_entry); */
guchar stream_nr;
guchar flags;
guint64 ts;
guint64 dur; /* =entry[1].ts-entry->ts */
guint64 offset;
guint64 bytes_before; /* calculated */
guint32 frames_before; /* calculated */
guint32 size; /* could be read from the chunk (if we don't split) */
} gst_avi_index_entry;
/* new index entries 24 bytes */
typedef struct {
guint32 flags;
@ -88,15 +75,21 @@ typedef struct {
GstBuffer *extradata, *initdata;
gchar *name;
/* the start/step/stop entries */
guint start_entry;
guint step_entry;
guint stop_entry;
/* current position (byte, frame, time) and other status vars */
guint current_entry;
guint current_frame;
guint64 current_byte;
guint64 current_time;
GstFlowReturn last_flow;
gboolean discont;
/* stream length */
guint64 total_bytes;
guint32 total_frames;
guint32 total_blocks;
guint n_keyframes;
/* stream length according to index */
@ -119,7 +112,7 @@ typedef struct {
guint idx_max; /* max allocated size of entries */
GstTagList *taglist;
} avi_stream_context;
} GstAviStream;
typedef enum {
GST_AVI_DEMUX_START,
@ -148,22 +141,16 @@ typedef struct _GstAviDemux {
guint64 offset;
gboolean abort_buffering;
/* index */
gst_avi_index_entry *index_entries;
guint index_size;
/* index offset in the file */
guint64 index_offset;
guint current_entry;
guint reverse_start_index;
guint reverse_stop_index;
/* streams */
GstAviStream stream[GST_AVI_DEMUX_MAX_STREAMS];
guint num_streams;
guint num_v_streams;
guint num_a_streams;
guint num_t_streams; /* subtitle text streams */
avi_stream_context stream[GST_AVI_DEMUX_MAX_STREAMS];
/* for streaming mode */
gboolean streaming;
gboolean have_eos;
@ -180,7 +167,6 @@ typedef struct _GstAviDemux {
GstEvent *seek_event;
GstTagList *globaltags;
gboolean got_tags;
} GstAviDemux;
typedef struct _GstAviDemuxClass {