summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-05-19 21:35:19 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-05-19 21:35:19 +0200
commit838c96fe8fb126b3394151580caccd216c966f22 (patch)
tree58d4cfc9f7dbb15a0089ebd642ffc473b57ae26c
parent3762cfd3d7127a9dfb63648a6ce4331982e7604d (diff)
ogg: Update to the latest VP8 mapping
-rw-r--r--ext/ogg/gstoggdemux.c12
-rw-r--r--ext/ogg/gstoggstream.c21
2 files changed, 25 insertions, 8 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c
index 36b71ebc6..3b69d9995 100644
--- a/ext/ogg/gstoggdemux.c
+++ b/ext/ogg/gstoggdemux.c
@@ -466,9 +466,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
}
}
} else if (pad->map.is_vp8) {
- /* packet 0 is from the BOS page, packet 1 is the vorbiscomment page */
- if (packet->packetno == 1 && packet->bytes >= 7
- && memcmp (packet->packet, "VP8_TAG", 7) == 0) {
+ if (packet->bytes >= 7 && memcmp (packet->packet, "OggVP8 ", 7) == 0) {
GstTagList *tags;
buf = gst_buffer_new ();
@@ -477,7 +475,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
GST_BUFFER_SIZE (buf) = packet->bytes;
tags = gst_tag_list_from_vorbiscomment_buffer (buf,
- (const guint8 *) "VP8_TAG", 7, NULL);
+ (const guint8 *) "OggVP8 ", 7, NULL);
gst_buffer_unref (buf);
buf = NULL;
@@ -486,12 +484,14 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
gst_element_found_tags_for_pad (GST_ELEMENT (ogg), GST_PAD_CAST (pad),
tags);
} else {
- GST_DEBUG_OBJECT (ogg, "failed to extract tags from vorbis comment");
+ GST_DEBUG_OBJECT (ogg,
+ "failed to extract VP8 tags from vorbis comment");
}
/* We don't push header packets for VP8 */
cret = gst_ogg_demux_combine_flows (ogg, pad, GST_FLOW_OK);
goto done;
- } else if (packet->b_o_s) {
+ } else if (packet->b_o_s || (packet->bytes >= 4
+ && memcmp (packet->packet, "/VP8 ", 4) == 0)) {
/* We don't push header packets for VP8 */
cret = gst_ogg_demux_combine_flows (ogg, pad, GST_FLOW_OK);
goto done;
diff --git a/ext/ogg/gstoggstream.c b/ext/ogg/gstoggstream.c
index cbcb6d9ef..32ed839cf 100644
--- a/ext/ogg/gstoggstream.c
+++ b/ext/ogg/gstoggstream.c
@@ -592,6 +592,23 @@ granulepos_to_key_granule_vp8 (GstOggStream * pad, gint64 granulepos)
return pts - dist;
}
+static gboolean
+is_header_vp8 (GstOggStream * pad, ogg_packet * packet)
+{
+ /* stream info */
+ if (packet->bytes > 4 && packet->packet[0] == 0x2f &&
+ packet->packet[1] == 0x56 && packet->packet[2] == 0x50 &&
+ packet->packet[3] == 0x38)
+ return TRUE;
+ /* comment */
+ if (packet->bytes > 7 && packet->packet[0] == 0x4f &&
+ packet->packet[1] == 0x67 && packet->packet[2] == 0x67 &&
+ packet->packet[3] == 0x56 && packet->packet[4] == 0x50 &&
+ packet->packet[5] == 0x38 && packet->packet[6] == 0x20)
+ return TRUE;
+ return FALSE;
+}
+
/* vorbis */
static gboolean
@@ -1626,13 +1643,13 @@ static const GstOggMap mappers[] = {
granulepos_to_key_granule_dirac
},
{
- "VP80\1", 5, 4,
+ "/VP8\1", 5, 4,
"video/x-vp8",
setup_vp8_mapper,
granulepos_to_granule_vp8,
granule_to_granulepos_vp8,
is_keyframe_vp8,
- is_header_count,
+ is_header_vp8,
packet_duration_vp8,
granulepos_to_key_granule_vp8
},