summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-10-09 10:00:51 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-10-09 10:00:51 +0000
commitef8649e92e897abd7d40b1da92939309e2b47245 (patch)
tree066fedb3c6cd670114f41e847e86fb56570b817d /gst
parent9f3b48a4957a54ed4e501feb5f14298b0e205947 (diff)
downloadgst-plugins-bad-ef8649e92e897abd7d40b1da92939309e2b47245.tar.gz
gst-plugins-bad-ef8649e92e897abd7d40b1da92939309e2b47245.tar.bz2
gst-plugins-bad-ef8649e92e897abd7d40b1da92939309e2b47245.zip
gst/flv/gstflvparse.c: Correct caps for video codec id 5: It's On2 VP6 with alpha channel which needs a different dec...
Original commit message from CVS: * gst/flv/gstflvparse.c: (gst_flv_parse_audio_negotiate), (gst_flv_parse_tag_audio), (gst_flv_parse_video_negotiate): Correct caps for video codec id 5: It's On2 VP6 with alpha channel which needs a different decoder and has different caps. Add support for audio codec id 14, which is MP3 with 8kHz sampling rate. Fix endianness and signedness for raw audio codec ids. Add support for alaw and mulaw audio.
Diffstat (limited to 'gst')
-rw-r--r--gst/flv/gstflvparse.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/gst/flv/gstflvparse.c b/gst/flv/gstflvparse.c
index 55a3ac67..fd51cbfe 100644
--- a/gst/flv/gstflvparse.c
+++ b/gst/flv/gstflvparse.c
@@ -406,15 +406,19 @@ gst_flv_parse_audio_negotiate (GstFLVDemux * demux, guint32 codec_tag,
codec_name = "Shockwave ADPCM";
break;
case 2:
+ case 14:
caps = gst_caps_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1, "layer", G_TYPE_INT, 3, NULL);
codec_name = "MPEG 1 Audio, Layer 3 (MP3)";
break;
case 0:
case 3:
+ /* Assuming little endian for 0 (aka endianness of the
+ * system on which the file was created) as most people
+ * are probably using little endian machines */
caps = gst_caps_new_simple ("audio/x-raw-int",
- "endianness", G_TYPE_INT, G_BYTE_ORDER,
- "signed", G_TYPE_BOOLEAN, TRUE,
+ "endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
+ "signed", G_TYPE_BOOLEAN, (width == 8) ? FALSE : TRUE,
"width", G_TYPE_INT, width, "depth", G_TYPE_INT, width, NULL);
codec_name = "Raw Audio";
break;
@@ -429,6 +433,14 @@ gst_flv_parse_audio_negotiate (GstFLVDemux * demux, guint32 codec_tag,
"mpegversion", G_TYPE_INT, 4, NULL);
codec_name = "AAC";
break;
+ case 7:
+ caps = gst_caps_new_simple ("audio/x-alaw", NULL);
+ codec_name = "A-Law";
+ break;
+ case 8:
+ caps = gst_caps_new_simple ("audio/x-mulaw", NULL);
+ codec_name = "Mu-Law";
+ break;
default:
GST_WARNING_OBJECT (demux, "unsupported audio codec tag %u", codec_tag);
}
@@ -523,6 +535,12 @@ gst_flv_parse_tag_audio (GstFLVDemux * demux, const guint8 * data,
codec_data = 1;
}
+ /* codec tags with special rates */
+ if (codec_tag == 5 || codec_tag == 14)
+ rate = 8000;
+ else if (codec_tag == 4)
+ rate = 16000;
+
GST_LOG_OBJECT (demux, "audio tag with %d channels, %dHz sampling rate, "
"%d bits width, codec tag %u (flags %02X)", channels, rate, width,
codec_tag, flags);
@@ -710,10 +728,13 @@ gst_flv_parse_video_negotiate (GstFLVDemux * demux, guint32 codec_tag)
caps = gst_caps_new_simple ("video/x-flash-screen", NULL);
codec_name = "Flash Screen Video";
case 4:
- case 5:
caps = gst_caps_new_simple ("video/x-vp6-flash", NULL);
codec_name = "On2 VP6 Video";
break;
+ case 5:
+ caps = gst_caps_new_simple ("video/x-vp6-alpha", NULL);
+ codec_name = "On2 VP6 Video with alpha channel";
+ break;
case 7:
caps = gst_caps_new_simple ("video/x-h264", NULL);
codec_name = "H.264/AVC Video";