mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-05 23:59:55 +00:00
gst/asfdemux/: - fix ASF_OBJ_PADDING guid
Original commit message from CVS: * gst/asfdemux/asfheaders.c : * gst/asfdemux/asfheaders.h : * gst/asfdemux/gstasfdemux.c : - fix ASF_OBJ_PADDING guid - add 3 new object guids (language list, metadata, extended stream properties) - add a function to parse extended header objects
This commit is contained in:
parent
88a86abb3d
commit
a381bca202
4 changed files with 82 additions and 16 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2004-05-18 Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
|
||||
|
||||
* gst/asfdemux/asfheaders.c :
|
||||
* gst/asfdemux/asfheaders.h :
|
||||
* gst/asfdemux/gstasfdemux.c :
|
||||
- fix ASF_OBJ_PADDING guid
|
||||
- add 3 new object guids (language list, metadata,
|
||||
extended stream properties)
|
||||
- add a function to parse extended header objects
|
||||
|
||||
2004-05-18 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||
|
||||
* sys/oss/gstosselement.c: (gst_osselement_sync_parms):
|
||||
|
|
|
@ -46,6 +46,15 @@ ASFGuidHash asf_stream_guids[] = {
|
|||
,
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
2 unknown GUIDs found in an extended header object :
|
||||
|
||||
(0x26f18b5d/0x47ec4584/0x650e5f9f/0xc952041f) with size=26
|
||||
(0xd9aade20/0x4f9c7c17/0x558528bc/0xa2e298dd) with size=34
|
||||
|
||||
*/
|
||||
|
||||
ASFGuidHash asf_object_guids[] = {
|
||||
{ASF_OBJ_STREAM, {0xB7DC0791, 0x11CFA9B7, 0xC000E68E, 0x6553200C}
|
||||
}
|
||||
|
@ -80,7 +89,7 @@ ASFGuidHash asf_object_guids[] = {
|
|||
{ASF_OBJ_HEAD2, {0xabd3d211, 0x11cfa9ba, 0xC000E68e, 0x6553200c}
|
||||
}
|
||||
,
|
||||
{ASF_OBJ_PADDING, {0x1806D474, 0x4509CADF, 0xAB9ABAA4, 0xE8AA96CD}
|
||||
{ASF_OBJ_PADDING, {0x1806D474, 0x4509CADF, 0xAB9ABAA4, 0xE8AA96CB}
|
||||
}
|
||||
,
|
||||
{ASF_OBJ_BITRATE_PROPS, {0x7bf875ce, 0x11d1468d, 0x6000828d, 0xb2a2c997}
|
||||
|
@ -92,6 +101,16 @@ ASFGuidHash asf_object_guids[] = {
|
|||
{ASF_OBJ_BITRATE_MUTEX, {0xd6e229dc, 0x11d135da, 0xa0003490, 0xbe4903c9}
|
||||
}
|
||||
,
|
||||
{ASF_OBJ_LANGUAGE_LIST, {0x7c4346a9, 0x4bfcefe0, 0x3e3929b2, 0x855c41de}
|
||||
}
|
||||
,
|
||||
{ASF_OBJ_METADATA_OBJECT, {0xc5f8cbea, 0x48775baf, 0x8caa6784, 0xca4cfa44}
|
||||
}
|
||||
,
|
||||
{ASF_OBJ_EXTENDED_STREAM_PROPS, {0x14e6a5cb, 0x4332c672, 0x69a99983,
|
||||
0x5a5b0652}
|
||||
}
|
||||
,
|
||||
{ASF_OBJ_UNDEFINED, {0, 0, 0, 0}
|
||||
}
|
||||
,
|
||||
|
|
|
@ -51,6 +51,9 @@ enum {
|
|||
ASF_OBJ_BITRATE_PROPS,
|
||||
ASF_OBJ_EXT_CONTENT_DESC,
|
||||
ASF_OBJ_BITRATE_MUTEX,
|
||||
ASF_OBJ_LANGUAGE_LIST,
|
||||
ASF_OBJ_METADATA_OBJECT,
|
||||
ASF_OBJ_EXTENDED_STREAM_PROPS,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -77,6 +80,14 @@ struct _asf_obj_header {
|
|||
|
||||
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;
|
||||
|
|
|
@ -376,6 +376,14 @@ _read_obj_header (GstASFDemux * asf_demux, asf_obj_header * header)
|
|||
_read_uint8 (asf_demux, &header->unknown2));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_read_obj_header_ext (GstASFDemux * asf_demux, asf_obj_header_ext * header_ext)
|
||||
{
|
||||
return (_read_guid (asf_demux, &header_ext->reserved1) &&
|
||||
_read_uint16 (asf_demux, &header_ext->reserved2) &&
|
||||
_read_uint32 (asf_demux, &header_ext->data_size));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_read_obj_stream (GstASFDemux * asf_demux, asf_obj_stream * stream)
|
||||
{
|
||||
|
@ -596,7 +604,6 @@ fail:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
static gboolean
|
||||
gst_asf_demux_process_header (GstASFDemux * asf_demux, guint64 * obj_size)
|
||||
{
|
||||
|
@ -618,6 +625,28 @@ gst_asf_demux_process_header (GstASFDemux * asf_demux, guint64 * obj_size)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_asf_demux_process_header_ext (GstASFDemux * asf_demux, guint64 * obj_size)
|
||||
{
|
||||
asf_obj_header_ext object;
|
||||
guint64 original_offset;
|
||||
|
||||
/* Get the rest of the header's header */
|
||||
_read_obj_header_ext (asf_demux, &object);
|
||||
|
||||
GST_INFO ("Object is an extended header with a size of %u bytes",
|
||||
object.data_size);
|
||||
|
||||
original_offset = asf_demux->bs->offset;
|
||||
|
||||
while ((asf_demux->bs->offset - original_offset) < object.data_size) {
|
||||
if (!gst_asf_demux_process_object (asf_demux))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_asf_demux_process_segment (GstASFDemux * asf_demux,
|
||||
asf_packet_info * packet_info)
|
||||
|
@ -1006,25 +1035,23 @@ gst_asf_demux_process_object (GstASFDemux * asf_demux)
|
|||
break;
|
||||
case ASF_OBJ_COMMENT:
|
||||
return gst_asf_demux_process_comment (asf_demux, &obj_size);
|
||||
case ASF_OBJ_CODEC_COMMENT:
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
case ASF_OBJ_INDEX:
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
case ASF_OBJ_HEAD1:
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
return gst_asf_demux_process_header_ext (asf_demux, &obj_size);
|
||||
case ASF_OBJ_HEAD2:
|
||||
break;
|
||||
case ASF_OBJ_PADDING:
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
case ASF_OBJ_EXT_CONTENT_DESC:
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
case ASF_OBJ_BITRATE_PROPS:
|
||||
return gst_asf_demux_process_bitrate_props_object (asf_demux, &obj_size);
|
||||
case ASF_OBJ_BITRATE_MUTEX:
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
case ASF_OBJ_UNDEFINED:
|
||||
case ASF_OBJ_CODEC_COMMENT:
|
||||
case ASF_OBJ_INDEX:
|
||||
case ASF_OBJ_PADDING:
|
||||
case ASF_OBJ_EXT_CONTENT_DESC:
|
||||
case ASF_OBJ_BITRATE_MUTEX:
|
||||
case ASF_OBJ_LANGUAGE_LIST:
|
||||
case ASF_OBJ_METADATA_OBJECT:
|
||||
case ASF_OBJ_EXTENDED_STREAM_PROPS:
|
||||
default:
|
||||
/* unknown object read, just ignore it, we hate fatal errors */
|
||||
/* unknown/unhandled object read, just ignore it, we hate fatal errors */
|
||||
return gst_asf_demux_skip_object (asf_demux, &obj_size);
|
||||
}
|
||||
|
||||
|
@ -1185,7 +1212,7 @@ gst_asf_demux_process_chunk (GstASFDemux * asf_demux,
|
|||
(GST_SECOND / 1000) * asf_demux->pts;
|
||||
|
||||
/*!!! Should handle flush events here? */
|
||||
GST_DEBUG ("Sending strem %d of size %d", stream->id,
|
||||
GST_DEBUG ("Sending stream %d of size %d", stream->id,
|
||||
segment_info->chunk_size);
|
||||
|
||||
GST_INFO ("Pushing pad");
|
||||
|
@ -1789,7 +1816,6 @@ gst_asf_demux_setup_pad (GstASFDemux * asf_demux,
|
|||
|
||||
GST_INFO ("Adding pad for stream %u", asf_demux->num_streams);
|
||||
|
||||
|
||||
asf_demux->num_streams++;
|
||||
|
||||
gst_element_add_pad (GST_ELEMENT (asf_demux), src_pad);
|
||||
|
|
Loading…
Reference in a new issue