gst-libs/gst/rtp/gstbasertpdepayload.c: Also call parent state change function to activate pads.

Original commit message from CVS:
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_change_state):
Also call parent state change function to activate pads.
* gst/typefind/gsttypefindfunctions.c: (mp3_type_find_at_offset),
(mpeg1_parse_header), (mpeg1_sys_type_find):
Add some more debug info in mpeg typefinding.
This commit is contained in:
Wim Taymans 2006-10-06 13:34:46 +00:00
parent d24ba074b7
commit 07aaf7f948
3 changed files with 30 additions and 7 deletions

View file

@ -1,3 +1,13 @@
2006-10-06 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/rtp/gstbasertpdepayload.c:
(gst_base_rtp_depayload_change_state):
Also call parent state change function to activate pads.
* gst/typefind/gsttypefindfunctions.c: (mp3_type_find_at_offset),
(mpeg1_parse_header), (mpeg1_sys_type_find):
Add some more debug info in mpeg typefinding.
2006-10-06 Michael Smith <msmith@fluendo.com>
* ext/theora/theoradec.c: (theora_dec_chain):

View file

@ -593,6 +593,7 @@ gst_base_rtp_depayload_change_state (GstElement * element,
GstStateChange transition)
{
GstBaseRTPDepayload *filter;
GstStateChangeReturn ret;
filter = GST_BASE_RTP_DEPAYLOAD (element);
@ -613,6 +614,8 @@ gst_base_rtp_depayload_change_state (GstElement * element,
break;
}
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
switch (transition) {
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
@ -624,7 +627,7 @@ gst_base_rtp_depayload_change_state (GstElement * element,
default:
break;
}
return GST_STATE_CHANGE_SUCCESS;
return ret;
/* ERRORS */
wrong_thread:

View file

@ -725,9 +725,9 @@ mp3_type_find_at_offset (GstTypeFind * tf, guint64 start_off,
probability /= 2;
GST_INFO
("audio/mpeg calculated %u = %u * %u / %u * (%u - %u) / %u",
probability, GST_TYPE_FIND_MAXIMUM, found,
GST_MP3_TYPEFIND_TRY_HEADERS, GST_MP3_TYPEFIND_TRY_SYNC,
("audio/mpeg calculated %u = %u * %u / %u * (%u - %"
G_GUINT64_FORMAT ") / %u", probability, GST_TYPE_FIND_MAXIMUM,
found, GST_MP3_TYPEFIND_TRY_HEADERS, GST_MP3_TYPEFIND_TRY_SYNC,
(guint) skipped, GST_MP3_TYPEFIND_TRY_SYNC);
/* make sure we're not id3 tagged */
head_data = gst_type_find_peek (tf, -128, 3);
@ -1047,10 +1047,13 @@ mpeg1_parse_header (GstTypeFind * tf, guint64 offset)
}
if (data[0] != 0 || data[1] != 0 || data[2] != 1) {
GST_LOG ("no sync");
return 0;
}
offset += 4;
GST_LOG ("sync %02x", data[3]);
switch (data[3]) {
case 0xBA: /* pack header */
data = gst_type_find_peek (tf, offset, 8);
@ -1063,8 +1066,10 @@ mpeg1_parse_header (GstTypeFind * tf, guint64 offset)
if ((data[0] & 0xF1) != 0x21 ||
(data[2] & 0x01) != 0x01 ||
(data[4] & 0x01) != 0x01 ||
(data[5] & 0x80) != 0x80 || (data[7] & 0x01) != 0x01)
(data[5] & 0x80) != 0x80 || (data[7] & 0x01) != 0x01) {
GST_LOG ("wrong marker bits");
return 0;
}
break;
case 0xB9: /* ISO end code */
@ -1086,12 +1091,16 @@ mpeg1_parse_header (GstTypeFind * tf, guint64 offset)
}
/* check marker bits */
if ((data[0] & 0x80) != 0x80 ||
(data[2] & 0x01) != 0x01 || (data[4] & 0x20) != 0x20)
(data[2] & 0x01) != 0x01 || (data[4] & 0x20) != 0x20) {
GST_LOG ("wrong marker bits");
return 0;
}
/* check stream marker bits */
for (offset = 6; offset < (size - 6); offset += 3) {
if (data[offset] <= 0xBB || (data[offset + 1] & 0xC0) != 0xC0)
if (data[offset] <= 0xBB || (data[offset + 1] & 0xC0) != 0xC0) {
GST_LOG ("wrong marker bits");
return 0;
}
}
break;
@ -1155,6 +1164,7 @@ mpeg1_sys_type_find (GstTypeFind * tf, gpointer unused)
}
g_assert (found <= GST_MPEG_TYPEFIND_TRY_HEADERS);
if (found == GST_MPEG_TYPEFIND_TRY_HEADERS || packet_size == 1) {
GST_LOG ("suggesting mpeg1 system steeam");
caps = gst_caps_copy (MPEG_SYS_CAPS);
gst_structure_set (gst_caps_get_structure (caps, 0), "mpegversion",
G_TYPE_INT, 1, NULL);