gst/realmedia/rmdemux.c: Use debug category, fix EOS handling. filesrc ! rmdemux now works.

Original commit message from CVS:
* gst/realmedia/rmdemux.c: (gst_rmdemux_class_init),
(gst_rmdemux_init), (gst_rmdemux_handle_sink_event),
(gst_rmdemux_loop), (gst_rmdemux_add_stream), (re_hexdump_bytes),
(re_dump_pascal_string), (gst_rmdemux_dump__rmf),
(gst_rmdemux_dump_prop), (gst_rmdemux_parse_mdpr),
(gst_rmdemux_dump_mdpr), (gst_rmdemux_dump_indx),
(gst_rmdemux_dump_data):
Use debug category, fix EOS handling. filesrc ! rmdemux now
works.
This commit is contained in:
Ronald S. Bultje 2004-10-04 14:43:23 +00:00
parent d004fd4416
commit 0cc8c6a4fd
2 changed files with 114 additions and 111 deletions

View file

@ -1,3 +1,15 @@
2004-10-04 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/realmedia/rmdemux.c: (gst_rmdemux_class_init),
(gst_rmdemux_init), (gst_rmdemux_handle_sink_event),
(gst_rmdemux_loop), (gst_rmdemux_add_stream), (re_hexdump_bytes),
(re_dump_pascal_string), (gst_rmdemux_dump__rmf),
(gst_rmdemux_dump_prop), (gst_rmdemux_parse_mdpr),
(gst_rmdemux_dump_mdpr), (gst_rmdemux_dump_indx),
(gst_rmdemux_dump_data):
Use debug category, fix EOS handling. filesrc ! rmdemux now
works.
2004-10-04 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/avi/gstavidemux.c: (gst_avi_demux_stream_index),

View file

@ -116,6 +116,9 @@ GST_STATIC_PAD_TEMPLATE ("audio_%02d",
GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY);
GST_DEBUG_CATEGORY_STATIC (rmdemux_debug);
#define GST_CAT_DEFAULT rmdemux_debug
static GstElementClass *parent_class = NULL;
static void gst_rmdemux_class_init (GstRMDemuxClass * klass);
@ -204,11 +207,16 @@ gst_rmdemux_class_init (GstRMDemuxClass * klass)
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gstelement_class->change_state = gst_rmdemux_change_state;
GST_DEBUG_CATEGORY_INIT (rmdemux_debug, "rmdemux",
0, "Demuxer for Realmedia streams");
}
static void
gst_rmdemux_init (GstRMDemux * rmdemux)
{
GST_FLAG_SET (rmdemux, GST_ELEMENT_EVENT_AWARE);
rmdemux->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_rmdemux_sink_template), "sink");
@ -246,17 +254,20 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
switch (type) {
case GST_EVENT_EOS:
gst_bytestream_flush (rmdemux->bs, remaining);
gst_event_unref (event);
//gst_pad_event_default(rmdemux->sinkpad, event);
return FALSE;
case GST_EVENT_INTERRUPT:
gst_event_unref (event);
return FALSE;
case GST_EVENT_FLUSH:
g_warning ("flush event");
break;
case GST_EVENT_DISCONTINUOUS:
GST_DEBUG ("discontinuous event\n");
GST_DEBUG ("discontinuous event");
//gst_bytestream_flush_fast(rmdemux->bs, remaining);
break;
default:
g_warning ("unhandled event %d", type);
GST_WARNING ("unhandled event %d", type);
break;
}
@ -308,7 +319,6 @@ gst_rmdemux_loop (GstElement * element)
//int size;
int ret;
int rlen;
int debug = 1;
/* FIXME _tell gets the offset wrong */
//cur_offset = gst_bytestream_tell(rmdemux->bs);
@ -337,8 +347,8 @@ gst_rmdemux_loop (GstElement * element)
fourcc = RMDEMUX_FOURCC_GET (data + 0);
length = RMDEMUX_GUINT32_GET (data + 4);
g_print ("fourcc " GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (fourcc));
g_print ("length %08x\n", length);
GST_LOG ("fourcc " GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
GST_LOG ("length %08x", length);
rlen = MIN (length, 4096) - 8;
@ -346,46 +356,40 @@ gst_rmdemux_loop (GstElement * element)
case GST_MAKE_FOURCC ('.', 'R', 'M', 'F'):
gst_bytestream_read (rmdemux->bs, &buf, length);
data = GST_BUFFER_DATA (buf);
if (debug)
gst_rmdemux_dump__rmf (rmdemux, data + 8, rlen);
gst_rmdemux_dump__rmf (rmdemux, data + 8, rlen);
gst_rmdemux_parse__rmf (rmdemux, data + 8, rlen);
break;
case GST_MAKE_FOURCC ('P', 'R', 'O', 'P'):
gst_bytestream_read (rmdemux->bs, &buf, length);
data = GST_BUFFER_DATA (buf);
if (debug)
gst_rmdemux_dump_prop (rmdemux, data + 8, rlen);
gst_rmdemux_dump_prop (rmdemux, data + 8, rlen);
gst_rmdemux_parse_prop (rmdemux, data + 8, rlen);
break;
case GST_MAKE_FOURCC ('M', 'D', 'P', 'R'):
gst_bytestream_read (rmdemux->bs, &buf, length);
data = GST_BUFFER_DATA (buf);
if (debug)
gst_rmdemux_dump_mdpr (rmdemux, data + 8, rlen);
gst_rmdemux_dump_mdpr (rmdemux, data + 8, rlen);
gst_rmdemux_parse_mdpr (rmdemux, data + 8, rlen);
break;
case GST_MAKE_FOURCC ('I', 'N', 'D', 'X'):
gst_bytestream_read (rmdemux->bs, &buf, length);
data = GST_BUFFER_DATA (buf);
if (debug)
gst_rmdemux_dump_indx (rmdemux, data + 8, rlen);
gst_rmdemux_dump_indx (rmdemux, data + 8, rlen);
gst_rmdemux_parse_indx (rmdemux, data + 8, rlen);
break;
case GST_MAKE_FOURCC ('D', 'A', 'T', 'A'):
rmdemux->data_offset = rmdemux->offset + 10;
if (debug)
gst_rmdemux_dump_data (rmdemux, data + 8, rlen);
gst_rmdemux_dump_data (rmdemux, data + 8, rlen);
gst_rmdemux_parse_data (rmdemux, data + 8, rlen);
break;
case GST_MAKE_FOURCC ('C', 'O', 'N', 'T'):
gst_bytestream_read (rmdemux->bs, &buf, length);
data = GST_BUFFER_DATA (buf);
if (debug)
gst_rmdemux_dump_cont (rmdemux, data + 8, rlen);
gst_rmdemux_dump_cont (rmdemux, data + 8, rlen);
gst_rmdemux_parse_cont (rmdemux, data + 8, rlen);
break;
default:
g_print ("unknown fourcc " GST_FOURCC_FORMAT "\n",
GST_WARNING ("unknown fourcc " GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (fourcc));
break;
}
@ -406,30 +410,25 @@ gst_rmdemux_loop (GstElement * element)
case RMDEMUX_STATE_SEEKING_EOS:
{
guint8 *data;
int i;
for (i = 0; i < rmdemux->n_streams; i++) {
GstPad *pad = rmdemux->streams[i]->pad;
if (pad) {
gst_pad_push (pad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
for (;;) {
ret = gst_bytestream_peek_bytes (rmdemux->bs, &data, 1);
if (ret < 1) {
if (!gst_rmdemux_handle_sink_event (rmdemux))
break;
} else {
/* didn't expect this */
GST_WARNING ("expected EOS event");
break;
}
}
ret = gst_bytestream_peek_bytes (rmdemux->bs, &data, 1);
if (ret < 1) {
gst_rmdemux_handle_sink_event (rmdemux);
} else {
/* didn't expect this */
g_warning ("expected EOS event");
}
gst_element_set_eos (element);
gst_pad_event_default (rmdemux->sinkpad, gst_event_new (GST_EVENT_EOS));
rmdemux->state = RMDEMUX_STATE_EOS;
return;
}
case RMDEMUX_STATE_EOS:
g_warning ("spinning in EOS\n");
g_warning ("spinning in EOS");
return;
case RMDEMUX_STATE_PLAYING:
{
@ -452,7 +451,7 @@ gst_rmdemux_loop (GstElement * element)
id = RMDEMUX_GUINT16_GET (data + 4);
timestamp = RMDEMUX_GUINT32_GET (data + 6);
unknown1 = RMDEMUX_GUINT16_GET (data + 10);
g_print ("length %d stream id %d timestamp %d unknown %d\n",
GST_DEBUG ("length %d stream id %d timestamp %d unknown %d",
length, id, timestamp, unknown1);
gst_bytestream_flush (rmdemux->bs, 12);
@ -465,7 +464,7 @@ gst_rmdemux_loop (GstElement * element)
}
rmdemux->chunk_index++;
g_print ("chunk_index %d n_chunks %d\n", rmdemux->chunk_index,
GST_DEBUG ("chunk_index %d n_chunks %d", rmdemux->chunk_index,
rmdemux->n_chunks);
if (rmdemux->chunk_index < rmdemux->n_chunks) {
rmdemux->offset += length;
@ -473,7 +472,7 @@ gst_rmdemux_loop (GstElement * element)
GST_SEEK_METHOD_SET);
} else {
ret = gst_bytestream_seek (rmdemux->bs, 0, GST_SEEK_METHOD_END);
g_print ("seek to end returned %d\n", ret);
GST_DEBUG ("seek to end returned %d", ret);
rmdemux->state = RMDEMUX_STATE_SEEKING_EOS;
}
@ -526,7 +525,7 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
version = 4;
break;
default:
g_print ("Unknown video FOURCC code\n");
GST_WARNING ("Unknown video FOURCC code");
}
if (version) {
stream->caps =
@ -575,11 +574,11 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
/* Sony ATRAC3 */
case GST_RM_AUD_ATRC:
g_print ("Nothing known to decode this audio FOURCC code\n");
GST_WARNING ("Nothing known to decode this audio FOURCC code");
break;
default:
g_print ("Unknown audio FOURCC code\n");
GST_WARNING ("Unknown audio FOURCC code");
}
if (version) {
@ -595,14 +594,14 @@ gst_rmdemux_add_stream (GstRMDemux * rmdemux, GstRMDemuxStream * stream)
}
rmdemux->n_audio_streams++;
} else {
g_print ("not adding stream of type %d\n", stream->subtype);
GST_WARNING ("not adding stream of type %d", stream->subtype);
return;
}
GST_PAD_ELEMENT_PRIVATE (stream->pad) = stream;
rmdemux->streams[rmdemux->n_streams] = stream;
rmdemux->n_streams++;
g_print ("n_streams is now %d\n", rmdemux->n_streams);
GST_LOG ("n_streams is now %d", rmdemux->n_streams);
if (stream->pad) {
gst_pad_use_explicit_caps (stream->pad);
@ -634,10 +633,10 @@ gst_rmdemux_audio_caps (GstRMDemux * rmdemux, guint32 fourcc)
#endif
static void
re_hexdump_bytes (guint8 * ptr, int len, int offset)
{
#if 0
guint8 *end = ptr + len;
int i;
@ -663,7 +662,7 @@ re_hexdump_bytes (guint8 * ptr, int len, int offset)
ptr += 16;
offset += 16;
}
#endif
}
static int
@ -672,7 +671,7 @@ re_dump_pascal_string (guint8 * ptr)
int length;
length = ptr[0];
g_print ("string: %.*s\n", length, (char *) ptr + 1);
GST_DEBUG ("string: %.*s", length, (char *) ptr + 1);
return length + 1;
}
@ -706,10 +705,9 @@ gst_rmdemux_parse__rmf (GstRMDemux * rmdemux, void *data, int length)
static void
gst_rmdemux_dump__rmf (GstRMDemux * rmdemux, void *data, int length)
{
g_print ("version: %d\n", RMDEMUX_GUINT16_GET (data + 0));
g_print ("unknown: %d\n", RMDEMUX_GUINT32_GET (data + 2));
g_print ("unknown: %d\n", RMDEMUX_GUINT32_GET (data + 6));
g_print ("\n");
GST_LOG ("version: %d", RMDEMUX_GUINT16_GET (data + 0));
GST_LOG ("unknown: %d", RMDEMUX_GUINT32_GET (data + 2));
GST_LOG ("unknown: %d", RMDEMUX_GUINT32_GET (data + 6));
}
static void
@ -722,19 +720,18 @@ gst_rmdemux_parse_prop (GstRMDemux * rmdemux, void *data, int length)
static void
gst_rmdemux_dump_prop (GstRMDemux * rmdemux, void *data, int length)
{
g_print ("version: %d\n", RMDEMUX_GUINT16_GET (data + 0));
g_print ("max bitrate: %d\n", RMDEMUX_GUINT32_GET (data + 2));
g_print ("avg bitrate: %d\n", RMDEMUX_GUINT32_GET (data + 6));
g_print ("max packet size: %d\n", RMDEMUX_GUINT32_GET (data + 10));
g_print ("avg packet size: %d\n", RMDEMUX_GUINT32_GET (data + 14));
g_print ("number of packets: %d\n", RMDEMUX_GUINT32_GET (data + 18));
g_print ("duration: %d\n", RMDEMUX_GUINT32_GET (data + 22));
g_print ("preroll: %d\n", RMDEMUX_GUINT32_GET (data + 26));
g_print ("offset of INDX section: 0x%08x\n", RMDEMUX_GUINT32_GET (data + 30));
g_print ("offset of DATA section: 0x%08x\n", RMDEMUX_GUINT32_GET (data + 34));
g_print ("n streams: %d\n", RMDEMUX_GUINT16_GET (data + 38));
g_print ("flags: 0x%04x\n", RMDEMUX_GUINT16_GET (data + 40));
g_print ("\n");
GST_LOG ("version: %d", RMDEMUX_GUINT16_GET (data + 0));
GST_LOG ("max bitrate: %d", RMDEMUX_GUINT32_GET (data + 2));
GST_LOG ("avg bitrate: %d", RMDEMUX_GUINT32_GET (data + 6));
GST_LOG ("max packet size: %d", RMDEMUX_GUINT32_GET (data + 10));
GST_LOG ("avg packet size: %d", RMDEMUX_GUINT32_GET (data + 14));
GST_LOG ("number of packets: %d", RMDEMUX_GUINT32_GET (data + 18));
GST_LOG ("duration: %d", RMDEMUX_GUINT32_GET (data + 22));
GST_LOG ("preroll: %d", RMDEMUX_GUINT32_GET (data + 26));
GST_LOG ("offset of INDX section: 0x%08x", RMDEMUX_GUINT32_GET (data + 30));
GST_LOG ("offset of DATA section: 0x%08x", RMDEMUX_GUINT32_GET (data + 34));
GST_LOG ("n streams: %d", RMDEMUX_GUINT16_GET (data + 38));
GST_LOG ("flags: 0x%04x", RMDEMUX_GUINT16_GET (data + 40));
}
static void
@ -767,7 +764,7 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, void *data, int length)
stream_type = GST_RMDEMUX_STREAM_FILEINFO;
} else {
stream_type = GST_RMDEMUX_STREAM_UNKNOWN;
g_print ("unknown stream type \"%s\",\"%s\"\n", stream1_type_string,
GST_WARNING ("unknown stream type \"%s\",\"%s\"", stream1_type_string,
stream2_type_string);
}
g_free (stream1_type_string);
@ -803,7 +800,7 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, void *data, int length)
break;
default:
audio_fourcc_offset = 0;
g_print ("Unknown audio stream format\n");
GST_WARNING ("Unknown audio stream format");
}
/* 14_4, 28_8, cook, dnet, sipr, raac, racp, ralf, atrc */
@ -815,7 +812,7 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, void *data, int length)
int element_nb;
/* Length of this section */
g_print ("length2: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset));
GST_DEBUG ("length2: 0x%08x", RMDEMUX_GUINT32_GET (data + offset));
offset += 4;
/* Unknown : 00 00 00 00 */
@ -827,8 +824,6 @@ gst_rmdemux_parse_mdpr (GstRMDemux * rmdemux, void *data, int length)
offset += 4;
while (element_nb) {
printf ("\n");
/* Category Id : 00 00 00 XX 00 00 */
re_hexdump_bytes (data + offset, 6, offset);
offset += 6;
@ -864,51 +859,51 @@ gst_rmdemux_dump_mdpr (GstRMDemux * rmdemux, void *data, int length)
char *stream_type;
guint32 fourcc;
g_print ("version: %d\n", RMDEMUX_GUINT16_GET (data + 0));
g_print ("stream id: %d\n", RMDEMUX_GUINT16_GET (data + 2));
g_print ("max bitrate: %d\n", RMDEMUX_GUINT32_GET (data + 4));
g_print ("avg bitrate: %d\n", RMDEMUX_GUINT32_GET (data + 8));
g_print ("max packet size: %d\n", RMDEMUX_GUINT32_GET (data + 12));
g_print ("avg packet size: %d\n", RMDEMUX_GUINT32_GET (data + 16));
g_print ("start time: %d\n", RMDEMUX_GUINT32_GET (data + 20));
g_print ("preroll: %d\n", RMDEMUX_GUINT32_GET (data + 24));
g_print ("duration: %d\n", RMDEMUX_GUINT32_GET (data + 28));
GST_LOG ("version: %d", RMDEMUX_GUINT16_GET (data + 0));
GST_LOG ("stream id: %d", RMDEMUX_GUINT16_GET (data + 2));
GST_LOG ("max bitrate: %d", RMDEMUX_GUINT32_GET (data + 4));
GST_LOG ("avg bitrate: %d", RMDEMUX_GUINT32_GET (data + 8));
GST_LOG ("max packet size: %d", RMDEMUX_GUINT32_GET (data + 12));
GST_LOG ("avg packet size: %d", RMDEMUX_GUINT32_GET (data + 16));
GST_LOG ("start time: %d", RMDEMUX_GUINT32_GET (data + 20));
GST_LOG ("preroll: %d", RMDEMUX_GUINT32_GET (data + 24));
GST_LOG ("duration: %d", RMDEMUX_GUINT32_GET (data + 28));
offset = 32;
stream_type = re_get_pascal_string (data + offset);
offset += re_dump_pascal_string (data + offset);
offset += re_dump_pascal_string (data + offset);
g_print ("length: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset));
GST_LOG ("length: 0x%08x", RMDEMUX_GUINT32_GET (data + offset));
offset += 4;
if (strstr (stream_type, "Video Stream")) {
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 0));
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 4));
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 0));
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 4));
fourcc = RMDEMUX_FOURCC_GET (data + offset + 8);
g_print ("fourcc: " GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (fourcc));
g_print ("width: %d\n", RMDEMUX_GUINT16_GET (data + offset + 12));
g_print ("height: %d\n", RMDEMUX_GUINT16_GET (data + offset + 14));
g_print ("rate: %d\n", RMDEMUX_GUINT16_GET (data + offset + 16));
GST_LOG ("fourcc: " GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
GST_LOG ("width: %d", RMDEMUX_GUINT16_GET (data + offset + 12));
GST_LOG ("height: %d", RMDEMUX_GUINT16_GET (data + offset + 14));
GST_LOG ("rate: %d", RMDEMUX_GUINT16_GET (data + offset + 16));
offset += 18;
} else if (strstr (stream_type, "Audio Stream")) {
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 0));
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 4));
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 0));
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 4));
fourcc = RMDEMUX_FOURCC_GET (data + offset + 8);
g_print ("fourcc: " GST_FOURCC_FORMAT "\n", GST_FOURCC_ARGS (fourcc));
GST_LOG ("fourcc: " GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc));
re_hexdump_bytes (data + offset + 12, 14, offset + 12);
g_print ("packet size 1: %d\n", RMDEMUX_GUINT16_GET (data + offset + 26));
GST_LOG ("packet size 1: %d", RMDEMUX_GUINT16_GET (data + offset + 26));
re_hexdump_bytes (data + offset + 28, 14, offset + 28);
g_print ("packet size 2: %d\n", RMDEMUX_GUINT16_GET (data + offset + 42));
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 44));
g_print ("rate1: %d\n", RMDEMUX_GUINT32_GET (data + offset + 48));
g_print ("rate2: %d\n", RMDEMUX_GUINT32_GET (data + offset + 52));
GST_LOG ("packet size 2: %d", RMDEMUX_GUINT16_GET (data + offset + 42));
GST_LOG ("unknown: 0x%08x", RMDEMUX_GUINT32_GET (data + offset + 44));
GST_LOG ("rate1: %d", RMDEMUX_GUINT32_GET (data + offset + 48));
GST_LOG ("rate2: %d", RMDEMUX_GUINT32_GET (data + offset + 52));
offset += 56;
} else if (strcmp (stream_type, "") == 0) {
int element_nb;
/* Length of this section */
g_print ("length2: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset));
GST_LOG ("length2: 0x%08x", RMDEMUX_GUINT32_GET (data + offset));
offset += 4;
/* Unknown : 00 00 00 00 */
@ -920,8 +915,6 @@ gst_rmdemux_dump_mdpr (GstRMDemux * rmdemux, void *data, int length)
offset += 4;
while (element_nb) {
printf ("\n");
/* Category Id : 00 00 00 XX 00 00 */
re_hexdump_bytes (data + offset, 6, offset);
offset += 6;
@ -942,7 +935,6 @@ gst_rmdemux_dump_mdpr (GstRMDemux * rmdemux, void *data, int length)
}
}
re_hexdump_bytes (data + offset, length - offset, offset);
g_print ("\n");
}
static void
@ -986,19 +978,18 @@ gst_rmdemux_dump_indx (GstRMDemux * rmdemux, void *data, int length)
re_hexdump_bytes (data + 0, 4, 0);
n = RMDEMUX_GUINT16_GET (data + 4);
g_print ("n_entries: %d\n", n);
g_print ("stream id: %d\n", RMDEMUX_GUINT16_GET (data + 6));
g_print ("offset of next INDX: 0x%08x\n", RMDEMUX_GUINT32_GET (data + 8));
GST_LOG ("n_entries: %d, stream_id: %d, offset to next INDX: 0x%08x",
n, RMDEMUX_GUINT16_GET (data + 6), RMDEMUX_GUINT32_GET (data + 8));
offset = 12;
for (i = 0; i < n; i++) {
g_print ("unknown: 0x%04x\n", RMDEMUX_GUINT16_GET (data + offset + 0));
g_print ("offset: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 2));
g_print ("timestamp: %d\n", RMDEMUX_GUINT32_GET (data + offset + 6));
g_print ("frame index: %d\n", RMDEMUX_GUINT32_GET (data + offset + 10));
GST_DEBUG
("unknown: 0x%04x, offset: 0x%08x, timestamp: %d, frame index: %d",
RMDEMUX_GUINT16_GET (data + offset + 0),
RMDEMUX_GUINT32_GET (data + offset + 2),
RMDEMUX_GUINT32_GET (data + offset + 6),
RMDEMUX_GUINT32_GET (data + offset + 10));
offset += 14;
}
g_print ("\n");
}
static void
@ -1013,17 +1004,17 @@ gst_rmdemux_dump_data (GstRMDemux * rmdemux, void *data, int length)
int offset = 0;
int n;
g_print ("version: %d\n", RMDEMUX_GUINT16_GET (data + 0));
g_print ("n_chunks: %d\n", RMDEMUX_GUINT32_GET (data + offset + 2));
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 6));
GST_LOG ("version: %d, n_chunks: %d, unknown: 0x%08x",
RMDEMUX_GUINT16_GET (data + 0), RMDEMUX_GUINT32_GET (data + offset + 2),
RMDEMUX_GUINT32_GET (data + offset + 6));
re_hexdump_bytes (data + offset, 10, offset);
offset += 10;
while (offset < length) {
n = RMDEMUX_GUINT32_GET (data + offset);
g_print ("length: %d\n", n);
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 4));
g_print ("unknown: 0x%08x\n", RMDEMUX_GUINT32_GET (data + offset + 8));
GST_LOG ("length: %d, unknown: 0x%08x, unknown: %08x",
n, RMDEMUX_GUINT32_GET (data + offset + 4),
RMDEMUX_GUINT32_GET (data + offset + 8));
offset += 12;
re_hexdump_bytes (data + offset, n - 12, offset);
offset += n - 12;