avi: implement index scanning

Implement scanning of the file when we can parse the index.
Some refactoring of common code.
Cleanups and comments.
Remove some reimplemented code.
Remove index massage code and put a FIXME where we should do something
equivalent later.
This commit is contained in:
Wim Taymans 2009-09-22 22:12:58 +02:00 committed by Wim Taymans
parent 8aa3830852
commit ceb7d66e25
2 changed files with 310 additions and 761 deletions

File diff suppressed because it is too large Load diff

View file

@ -57,9 +57,9 @@ typedef struct {
} GstAviIndexEntry; } GstAviIndexEntry;
#define GST_AVI_KEYFRAME 1 #define GST_AVI_KEYFRAME 1
#define ENTRY_IS_KEYFRAME(e) (((e)->flags & GST_AVI_KEYFRAME) == GST_AVI_KEYFRAME) #define ENTRY_IS_KEYFRAME(e) ((e)->flags == GST_AVI_KEYFRAME)
#define ENTRY_SET_KEYFRAME(e) ((e)->flags |= GST_AVI_KEYFRAME) #define ENTRY_SET_KEYFRAME(e) ((e)->flags = GST_AVI_KEYFRAME)
#define ENTRY_UNSET_KEYFRAME(e) ((e)->flags &= ~(GST_AVI_KEYFRAME)) #define ENTRY_UNSET_KEYFRAME(e) ((e)->flags = 0)
typedef struct { typedef struct {
/* index of this streamcontext */ /* index of this streamcontext */
@ -149,6 +149,8 @@ typedef struct _GstAviDemux {
guint64 offset; guint64 offset;
gboolean abort_buffering; gboolean abort_buffering;
/* when we loaded the indexes */
gboolean have_index;
/* index offset in the file */ /* index offset in the file */
guint64 index_offset; guint64 index_offset;