gst/asfdemux/: Make asfdemux work in pull mode where possible. If there's an index at the end of the file, read it an...

Original commit message from CVS:
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_free_stream),
(gst_asf_demux_reset), (gst_asf_demux_init),
(gst_asf_demux_activate), (gst_asf_demux_activate_push),
(gst_asf_demux_activate_pull), (gst_asf_demux_sink_event),
(gst_asf_demux_seek_index_lookup),
(gst_asf_demux_reset_stream_state_after_discont),
(gst_asf_demux_handle_seek_event),
(gst_asf_demux_handle_src_event), (gst_asf_demux_chain_headers),
(gst_asf_demux_chain), (gst_asf_demux_pull_data),
(gst_asf_demux_pull_indices),
(gst_asf_demux_parse_data_object_start),
(gst_asf_demux_pull_headers), (gst_asf_demux_loop),
(gst_asf_demux_setup_pad), (gst_asf_demux_process_file),
(gst_asf_demux_process_simple_index),
(gst_asf_demux_process_object),
(gst_asf_demux_send_event_unlocked), (gst_asf_demux_push_buffer),
(gst_asf_demux_handle_data), (gst_asf_demux_change_state):
* gst/asfdemux/gstasfdemux.h:
Make asfdemux work in pull mode where possible. If there's an index
at the end of the file, read it and use it for seeking purposes.
This commit is contained in:
Tim-Philipp Müller 2007-04-12 13:38:03 +00:00
parent 96d8fd786b
commit d0483656b3
5 changed files with 683 additions and 207 deletions

View file

@ -1,3 +1,28 @@
2007-04-12 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_free_stream),
(gst_asf_demux_reset), (gst_asf_demux_init),
(gst_asf_demux_activate), (gst_asf_demux_activate_push),
(gst_asf_demux_activate_pull), (gst_asf_demux_sink_event),
(gst_asf_demux_seek_index_lookup),
(gst_asf_demux_reset_stream_state_after_discont),
(gst_asf_demux_handle_seek_event),
(gst_asf_demux_handle_src_event), (gst_asf_demux_chain_headers),
(gst_asf_demux_chain), (gst_asf_demux_pull_data),
(gst_asf_demux_pull_indices),
(gst_asf_demux_parse_data_object_start),
(gst_asf_demux_pull_headers), (gst_asf_demux_loop),
(gst_asf_demux_setup_pad), (gst_asf_demux_process_file),
(gst_asf_demux_process_simple_index),
(gst_asf_demux_process_object),
(gst_asf_demux_send_event_unlocked), (gst_asf_demux_push_buffer),
(gst_asf_demux_handle_data), (gst_asf_demux_change_state):
* gst/asfdemux/gstasfdemux.h:
Make asfdemux work in pull mode where possible. If there's an index
at the end of the file, read it and use it for seeking purposes.
2007-04-12 Wim Taymans <wim@fluendo.com>
* gst/synaesthesia/gstsynaesthesia.c: (gst_synaesthesia_init),

View file

@ -74,9 +74,12 @@ const ASFGuidHash asf_object_guids[] = {
{ASF_OBJ_CODEC_COMMENT1, "ASF_OBJ_CODEC_COMMENT1",
{0x86d15241, 0x11d0311d, 0xA000A4a3, 0xF64803c9}
},
{ASF_OBJ_INDEX, "ASF_OBJ_INDEX",
{ASF_OBJ_SIMPLE_INDEX, "ASF_OBJ_SIMPLE_INDEX",
{0x33000890, 0x11cfe5b1, 0xA000F489, 0xCB4903c9}
},
{ASF_OBJ_INDEX, "ASF_OBJ_INDEX",
{0xd6e229d3, 0x11d135da, 0xa0003490, 0xbe4903c9}
},
{ASF_OBJ_HEAD1, "ASF_OBJ_HEAD1",
{0x5fbf03b5, 0x11cfa92e, 0xC000E38e, 0x6553200c}
},

View file

@ -45,6 +45,7 @@ typedef enum {
ASF_OBJ_COMMENT,
ASF_OBJ_CODEC_COMMENT,
ASF_OBJ_CODEC_COMMENT1,
ASF_OBJ_SIMPLE_INDEX,
ASF_OBJ_INDEX,
ASF_OBJ_HEAD1,
ASF_OBJ_HEAD2,

File diff suppressed because it is too large Load diff

View file

@ -51,8 +51,6 @@ typedef struct
guint64 last_pts;
GstBuffer *payload;
gboolean need_newsegment; /* do we need to send a new-segment event? */
/* video-only */
guint64 last_buffer_timestamp; /* timestamp of last buffer sent out */
gboolean is_video;
@ -62,6 +60,8 @@ typedef struct
GstCaps *caps;
GstTagList *pending_tags;
gboolean discont;
} asf_stream_context;
typedef enum {
@ -83,10 +83,11 @@ struct _GstASFDemux {
GstTagList *taglist;
GstAsfDemuxState state;
guint64 data_offset; /* byte offset where packets start */
guint64 data_size; /* total size of packet data in bytes */
guint64 num_packets; /* total number of data packets */
guint64 packet; /* current packet */
guint64 index_offset; /* byte offset where index might be, or 0 */
guint64 data_offset; /* byte offset where packets start */
guint64 data_size; /* total size of packet data in bytes, or 0 */
guint64 num_packets; /* total number of data packets, or 0 */
guint64 packet; /* current packet */
/* bitrates are unused at the moment */
guint32 bitrate[GST_ASF_DEMUX_NUM_STREAM_IDS];
@ -102,8 +103,8 @@ struct _GstASFDemux {
guint32 num_streams;
asf_stream_context stream[GST_ASF_DEMUX_NUM_STREAMS];
guint32 packet_size; /* -1 if not fixed or not known */
guint32 timestamp; /* in milliseconds */
guint32 packet_size;
guint32 timestamp; /* in milliseconds */
guint64 play_time;
guint64 preroll;
@ -112,7 +113,11 @@ struct _GstASFDemux {
gboolean seekable;
gboolean broadcast;
GstSegment segment; /* configured play segment */
GstSegment segment; /* configured play segment */
gboolean need_newsegment; /* do we need to send a new-segment event? */
gboolean segment_running; /* if we've started the current segment */
gboolean streaming; /* TRUE if we are operating chain-based */
/* Descrambler settings */
guint8 span;
@ -122,6 +127,11 @@ struct _GstASFDemux {
/* for debugging only */
gchar *objpath;
/* simple index, if available */
GstClockTime sidx_interval; /* interval between entries in ns */
guint sidx_num_entries; /* number of index entries */
guint32 *sidx_entries; /* packet number for each entry */
};
struct _GstASFDemuxClass {