flvdemux: Add flvversion 1 to the flash-video caps

This allows using avdec_flv which requires this field to be
present in the caps. FLV only supports flash-video version 1
right now.

https://bugzilla.gnome.org/show_bug.cgi?id=703076
This commit is contained in:
Alban Browaeys 2013-06-25 21:16:38 +02:00 committed by Sebastian Dröge
parent 5f6469fe2a
commit 97015d3c93

View file

@ -76,7 +76,7 @@ static GstStaticPadTemplate video_src_template =
GST_STATIC_PAD_TEMPLATE ("video", GST_STATIC_PAD_TEMPLATE ("video",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_SOMETIMES, GST_PAD_SOMETIMES,
GST_STATIC_CAPS ("video/x-flash-video; " GST_STATIC_CAPS ("video/x-flash-video, flvversion=(int) 1; "
"video/x-flash-screen; " "video/x-flash-screen; "
"video/x-vp6-flash; " "video/x-vp6-alpha; " "video/x-vp6-flash; " "video/x-vp6-alpha; "
"video/x-h264, stream-format=avc;") "video/x-h264, stream-format=avc;")
@ -1183,7 +1183,9 @@ gst_flv_demux_video_negotiate (GstFlvDemux * demux, guint32 codec_tag)
/* Generate caps for that pad */ /* Generate caps for that pad */
switch (codec_tag) { switch (codec_tag) {
case 2: case 2:
caps = gst_caps_new_empty_simple ("video/x-flash-video"); caps =
gst_caps_new_simple ("video/x-flash-video", "flvversion", G_TYPE_INT,
1, NULL);
break; break;
case 3: case 3:
caps = gst_caps_new_empty_simple ("video/x-flash-screen"); caps = gst_caps_new_empty_simple ("video/x-flash-screen");
@ -1699,6 +1701,17 @@ gst_flv_demux_parse_header (GstFlvDemux * demux, GstBuffer * buffer)
} }
} }
if (map.data[3] == '1') {
GST_DEBUG_OBJECT (demux, "FLV version 1 detected");
} else {
if (G_UNLIKELY (demux->strict)) {
GST_WARNING_OBJECT (demux, "invalid header version detected");
ret = GST_FLOW_EOS;
goto beach;
}
}
/* Now look at audio/video flags */ /* Now look at audio/video flags */
{ {
guint8 flags = map.data[4]; guint8 flags = map.data[4];