gst/asfdemux/: Refactor and clean up header parsing and chain function a bit; get rid of some cruft; make header pars...

Original commit message from CVS:
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_init),
(gst_asf_demux_sink_event), (gst_asf_demux_handle_seek_event),
(gst_asf_demux_identify_guid), (asf_demux_peek_object),
(gst_asf_demux_chain_headers), (gst_asf_demux_chain),
(gst_asf_demux_setup_pad), (gst_asf_demux_process_stream),
(gst_asf_demux_process_ext_content_desc),
(gst_asf_demux_get_object_header), (gst_asf_demux_process_header),
(gst_asf_demux_process_file), (gst_asf_demux_process_comment),
(gst_asf_demux_process_bitrate_props_object),
(gst_asf_demux_process_header_ext),
(gst_asf_demux_process_language_list),
(gst_asf_demux_process_ext_stream_props),
(gst_asf_demux_process_queued_extended_stream_objects),
(gst_asf_demux_process_object), (gst_asf_demux_change_state):
* gst/asfdemux/gstasfdemux.h:
Refactor and clean up header parsing and chain function a bit; get
rid of some cruft; make header parsing a tad more robust, fixing
#403188.
This commit is contained in:
Tim-Philipp Müller 2007-02-08 21:07:27 +00:00
parent 69f195f044
commit f8d7045fc8
6 changed files with 510 additions and 657 deletions

View file

@ -1,3 +1,26 @@
2007-02-08 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_init),
(gst_asf_demux_sink_event), (gst_asf_demux_handle_seek_event),
(gst_asf_demux_identify_guid), (asf_demux_peek_object),
(gst_asf_demux_chain_headers), (gst_asf_demux_chain),
(gst_asf_demux_setup_pad), (gst_asf_demux_process_stream),
(gst_asf_demux_process_ext_content_desc),
(gst_asf_demux_get_object_header), (gst_asf_demux_process_header),
(gst_asf_demux_process_file), (gst_asf_demux_process_comment),
(gst_asf_demux_process_bitrate_props_object),
(gst_asf_demux_process_header_ext),
(gst_asf_demux_process_language_list),
(gst_asf_demux_process_ext_stream_props),
(gst_asf_demux_process_queued_extended_stream_objects),
(gst_asf_demux_process_object), (gst_asf_demux_change_state):
* gst/asfdemux/gstasfdemux.h:
Refactor and clean up header parsing and chain function a bit; get
rid of some cruft; make header parsing a tad more robust, fixing
#403188.
2007-02-01 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_sink_event):

2
common

@ -1 +1 @@
Subproject commit 8ba5dffb5ee7e7daea1030f6b34bfef10f9801a3
Subproject commit de43a8f3c629983e0bea0b8eb617e52ed35a6cda

View file

@ -131,6 +131,9 @@ const ASFGuidHash asf_object_guids[] = {
{ASF_OBJ_SCRIPT_COMMAND, "ASF_OBJ_SCRIPT_COMMAND",
{0x1efb1a30, 0x11d00b62, 0xa0009ba3, 0xf64803c9}
},
{ASF_OBJ_MARKER, "ASF_OBJ_MARKER",
{0xf487cd01, 0x11cfa951, 0xc000e68e, 0x6553200c}
},
{ASF_OBJ_UNDEFINED, "ASF_OBJ_UNDEFINED",
{0, 0, 0, 0}
}

View file

@ -35,7 +35,7 @@ typedef struct {
ASFGuid guid;
} ASFGuidHash;
enum {
typedef enum {
ASF_OBJ_UNDEFINED = 0,
ASF_OBJ_STREAM,
ASF_OBJ_DATA,
@ -63,8 +63,9 @@ enum {
ASF_OBJ_CONTENT_ENCRYPTION,
ASF_OBJ_EXT_CONTENT_ENCRYPTION,
ASF_OBJ_DIGITAL_SIGNATURE_OBJECT,
ASF_OBJ_SCRIPT_COMMAND
};
ASF_OBJ_SCRIPT_COMMAND,
ASF_OBJ_MARKER
} AsfObjectID;
enum {
ASF_STREAM_UNDEFINED = 0,
@ -91,49 +92,6 @@ guint32 gst_asf_identify_guid (const ASFGuidHash * guids,
const gchar *gst_asf_get_guid_nick (const ASFGuidHash * guids,
guint32 obj_id);
struct _asf_obj_header {
guint32 num_objects;
guint8 unknown1;
guint8 unknown2;
};
typedef struct _asf_obj_header asf_obj_header;
struct _asf_obj_header_ext {
ASFGuid reserved1;
guint16 reserved2;
guint32 data_size;
};
typedef struct _asf_obj_header_ext asf_obj_header_ext;
struct _asf_obj_comment {
guint16 title_length;
guint16 author_length;
guint16 copyright_length;
guint16 description_length;
guint16 rating_length;
};
typedef struct _asf_obj_comment asf_obj_comment;
struct _asf_obj_file {
ASFGuid file_id;
guint64 file_size;
guint64 creation_time;
guint64 packets_count;
guint64 play_time;
guint64 send_time;
guint64 preroll;
guint32 flags;
guint32 min_pktsize;
guint32 max_pktsize;
guint32 min_bitrate;
};
typedef struct _asf_obj_file asf_obj_file;
struct _asf_obj_ext_stream_properties {
guint64 start_time;
guint64 end_time;
@ -183,16 +141,6 @@ struct _asf_stream_audio {
typedef struct _asf_stream_audio asf_stream_audio;
struct _asf_stream_correction {
guint8 span;
guint16 packet_size;
guint16 chunk_size;
guint16 data_size;
guint8 silence_data;
};
typedef struct _asf_stream_correction asf_stream_correction;
struct _asf_stream_video {
guint32 width;
guint32 height;
@ -218,16 +166,6 @@ struct _asf_stream_video_format {
typedef struct _asf_stream_video_format asf_stream_video_format;
struct _asf_obj_data {
ASFGuid file_id;
guint64 packets;
guint8 unknown1;
/* guint8 unknown2; FIXME: this object is supposed to be 26 bytes?! */
guint8 correction;
};
typedef struct _asf_obj_data asf_obj_data;
struct _asf_obj_data_correction {
guint8 type;
guint8 cycle;
@ -273,11 +211,4 @@ struct _asf_replicated_data {
typedef struct _asf_replicated_data asf_replicated_data;
struct _asf_bitrate_record {
guint16 stream_id;
guint32 bitrate;
};
typedef struct _asf_bitrate_record asf_bitrate_record;
#endif /* __ASFHEADERS_H__ */

File diff suppressed because it is too large Load diff

View file

@ -66,8 +66,7 @@ typedef struct
typedef enum {
GST_ASF_DEMUX_STATE_HEADER,
GST_ASF_DEMUX_STATE_DATA,
GST_ASF_DEMUX_STATE_EOS
GST_ASF_DEMUX_STATE_DATA
} GstAsfDemuxState;
#define GST_ASF_DEMUX_NUM_VIDEO_PADS 16
@ -84,13 +83,6 @@ struct _GstASFDemux {
GstTagList *taglist;
GstAsfDemuxState state;
/* The number of bytes needed for the next parsing unit. Set by
* parsing functions when they return ASF_FLOW_NEED_MORE_DATA.
* if not set after an ASF_FLOW_NEED_MORE_DATA, this indicates
* that we are parsing broken data and want to parse beyond an
* object or packet boundary. */
guint bytes_needed;
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 */
@ -118,12 +110,6 @@ struct _GstASFDemux {
gboolean seekable;
/* expected byte offset of next buffer to be received by chain
* function. Used to calculate the current byte offset into the
* file from the adapter state and the data parser state */
gint64 next_byte_offset;
GstSegment segment; /* configured play segment */
/* Descrambler settings */