gst/asfdemux/: Add some more GUIDs and make debug log more readable and easier to follow when parsing the headers.

Original commit message from CVS:
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_identify_guid),
(gst_asf_demux_process_header), (gst_asf_demux_push_obj),
(gst_asf_demux_pop_obj), (gst_asf_demux_process_object),
(gst_asf_demux_change_state):
* gst/asfdemux/gstasfdemux.h:
Add some more GUIDs and make debug log more readable
and easier to follow when parsing the headers.
This commit is contained in:
Tim-Philipp Müller 2006-07-07 19:26:40 +00:00
parent 8d65dca6e9
commit 0a27252bb5
6 changed files with 93 additions and 24 deletions

View file

@ -1,3 +1,15 @@
2006-07-07 Tim-Philipp Müller <tim at centricular dot net>
* gst/asfdemux/asfheaders.c:
* gst/asfdemux/asfheaders.h:
* gst/asfdemux/gstasfdemux.c: (gst_asf_demux_identify_guid),
(gst_asf_demux_process_header), (gst_asf_demux_push_obj),
(gst_asf_demux_pop_obj), (gst_asf_demux_process_object),
(gst_asf_demux_change_state):
* gst/asfdemux/gstasfdemux.h:
Add some more GUIDs and make debug log more readable
and easier to follow when parsing the headers.
2006-06-30 Tim-Philipp Müller <tim at centricular dot net>
* ext/dvdread/dvdreadsrc.c: (gst_dvd_read_src_init),

2
common

@ -1 +1 @@
Subproject commit 123195d3bbcc0b6e1cf867d3a180685f8766a0be
Subproject commit dd173e2720ac21e4a47c97705d7ff32271a0ee66

View file

@ -25,11 +25,10 @@ const ASFGuidHash asf_correction_guids[] = {
{ASF_CORRECTION_ON, "ASF_CORRECTION_ON",
{0xBFC3CD50, 0x11CF618F, 0xAA00B28B, 0x20E2B400}
},
/*
{ ASF_CORRECTION_OFF, "ASF_CORRECTION_OFF",
{0x20FB5700, 0x11CF5B55, 0x8000FDA8, 0x2B445C5F}
},
*/
{ASF_CORRECTION_OFF, "ASF_CORRECTION_OFF",
{0x20FB5700, 0x11CF5B55, 0x8000FDA8, 0x2B445C5F}
},
/* CHECKME: where does this 49F1A440... GUID come from? (tpm) */
{ASF_CORRECTION_OFF, "ASF_CORRECTION_OFF",
{0x49F1A440, 0x11D04ECE, 0xA000ACA3, 0xF64803C9}
},
@ -50,15 +49,6 @@ const 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
*/
const ASFGuidHash asf_object_guids[] = {
{ASF_OBJ_STREAM, "ASF_OBJ_STREAM",
{0xB7DC0791, 0x11CFA9B7, 0xC000E68E, 0x6553200C}
@ -114,6 +104,21 @@ const ASFGuidHash asf_object_guids[] = {
{ASF_OBJ_EXTENDED_STREAM_PROPS, "ASF_OBJ_EXTENDED_STREAM_PROPS",
{0x14e6a5cb, 0x4332c672, 0x69a99983, 0x5a5b0652}
},
{ASF_OBJ_COMPATIBILITY, "ASF_OBJ_COMPATIBILITY",
{0x26f18b5d, 0x47ec4584, 0x650e5f9f, 0xc952041f}
},
{ASF_OBJ_INDEX_PLACEHOLDER, "ASF_OBJ_INDEX_PLACEHOLDER",
{0xd9aade20, 0x4f9c7c17, 0x558528bc, 0xa2e298dd}
},
{ASF_OBJ_INDEX_PARAMETERS, "ASF_OBJ_INDEX_PARAMETERS",
{0xd6e229df, 0x11d135da, 0xa0003490, 0xbe4903c9}
},
{ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION, "ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION",
{0xa08649cf, 0x46704775, 0x356e168a, 0xcd667535}
},
{ASF_OBJ_STREAM_PRIORITIZATION, "ASF_OBJ_STREAM_PRIORITIZATION",
{0xd4fed15b, 0x454f88d3, 0x5cedf081, 0x249e9945}
},
{ASF_OBJ_UNDEFINED, "ASF_OBJ_UNDEFINED",
{0, 0, 0, 0}
}

View file

@ -54,7 +54,12 @@ enum {
ASF_OBJ_BITRATE_MUTEX,
ASF_OBJ_LANGUAGE_LIST,
ASF_OBJ_METADATA_OBJECT,
ASF_OBJ_EXTENDED_STREAM_PROPS
ASF_OBJ_EXTENDED_STREAM_PROPS,
ASF_OBJ_COMPATIBILITY,
ASF_OBJ_INDEX_PLACEHOLDER,
ASF_OBJ_INDEX_PARAMETERS,
ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION,
ASF_OBJ_STREAM_PRIORITIZATION
};
enum {

View file

@ -419,12 +419,11 @@ gst_asf_demux_identify_guid (GstASFDemux * demux,
{
guint32 ret;
GST_LOG ("identifying 0x%08x-0x%08x-0x%08x-0x%08x",
guid->v1, guid->v2, guid->v3, guid->v4);
ret = gst_asf_identify_guid (guids, guid);
GST_LOG ("identified as %s", gst_asf_get_guid_nick (guids, ret));
GST_LOG ("%s 0x%08x-0x%08x-0x%08x-0x%08x",
gst_asf_get_guid_nick (guids, ret),
guid->v1, guid->v2, guid->v3, guid->v4);
return ret;
}
@ -1388,7 +1387,8 @@ gst_asf_demux_process_header (GstASFDemux * demux, guint8 ** p_data,
/* Loop through the header's objects, processing those */
for (i = 0; i < object.num_objects; ++i) {
GST_DEBUG ("reading header part %u: data=%p", i, *p_data);
GST_DEBUG ("reading header part %u: offset=0x%" G_GINT64_MODIFIER "x",
i, gst_asf_demux_get_current_offset (demux, *p_data));
ret = gst_asf_demux_process_object (demux, p_data, p_size);
if (ret != GST_FLOW_OK) {
GST_WARNING ("process_object returned %s", gst_asf_get_flow_name (ret));
@ -1585,6 +1585,41 @@ gst_asf_demux_process_header_ext (GstASFDemux * demux, guint8 ** p_data,
return ret;
}
static const gchar *
gst_asf_demux_push_obj (GstASFDemux * demux, guint32 obj_id)
{
const gchar *nick;
nick = gst_asf_get_guid_nick (asf_object_guids, obj_id);
if (g_str_has_prefix (nick, "ASF_OBJ_"))
nick += strlen ("ASF_OBJ_");
if (demux->objpath == NULL) {
demux->objpath = g_strdup (nick);
} else {
gchar *newpath;
newpath = g_strdup_printf ("%s/%s", demux->objpath, nick);
g_free (demux->objpath);
demux->objpath = newpath;
}
return (const gchar *) demux->objpath;
}
static void
gst_asf_demux_pop_obj (GstASFDemux * demux)
{
gchar *s;
if ((s = g_strrstr (demux->objpath, "/"))) {
*s = '\0';
} else {
g_free (demux->objpath);
demux->objpath = NULL;
}
}
static GstFlowReturn
gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
guint64 * p_size)
@ -1606,8 +1641,9 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
return ASF_FLOW_NEED_MORE_DATA;
}
GST_INFO ("processing object %s with size %" G_GUINT64_FORMAT,
gst_asf_get_guid_nick (asf_object_guids, obj_id),
gst_asf_demux_push_obj (demux, obj_id);
GST_INFO ("%s, size %" G_GUINT64_FORMAT, demux->objpath,
obj_size + ASF_DEMUX_OBJECT_HEADER_SIZE);
switch (obj_id) {
@ -1645,6 +1681,11 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
case ASF_OBJ_LANGUAGE_LIST:
case ASF_OBJ_METADATA_OBJECT:
case ASF_OBJ_EXTENDED_STREAM_PROPS:
case ASF_OBJ_COMPATIBILITY:
case ASF_OBJ_INDEX_PLACEHOLDER:
case ASF_OBJ_INDEX_PARAMETERS:
case ASF_OBJ_ADVANCED_MUTUAL_EXCLUSION:
case ASF_OBJ_STREAM_PRIORITIZATION:
default:
/* Unknown/unhandled object read. Just ignore
* it, people don't like fatal errors much */
@ -1657,7 +1698,9 @@ gst_asf_demux_process_object (GstASFDemux * demux, guint8 ** p_data,
break;
}
GST_DEBUG ("ret = %s", gst_asf_get_flow_name (ret));
GST_LOG ("ret = %s (%s)", gst_asf_get_flow_name (ret), demux->objpath);
gst_asf_demux_pop_obj (demux);
return ret;
}
@ -2543,6 +2586,8 @@ gst_asf_demux_change_state (GstElement * element, GstStateChange transition)
demux->taglist = NULL;
}
demux->state = GST_ASF_DEMUX_STATE_HEADER;
g_free (demux->objpath);
demux->objpath = NULL;
break;
}
default:

View file

@ -125,6 +125,8 @@ struct _GstASFDemux {
guint16 ds_chunk_size;
guint16 ds_data_size;
/* for debugging only */
gchar *objpath;
};
struct _GstASFDemuxClass {