summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorFabrizio <fabrizio.ge@tiscali.it>2006-01-21 11:43:53 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-01-21 11:43:53 +0000
commit3ac31471aa2eda18d005296f207abd265ebc1097 (patch)
treedd3e514861f4c93adbea4be89f8db5e4c0a13097 /gst
parenta017143695a98c99002d596efe0b6d55896179ba (diff)
downloadgst-plugins-bad-3ac31471aa2eda18d005296f207abd265ebc1097.tar.gz
gst-plugins-bad-3ac31471aa2eda18d005296f207abd265ebc1097.tar.bz2
gst-plugins-bad-3ac31471aa2eda18d005296f207abd265ebc1097.zip
gst/qtdemux/qtdemux.c: 'twos' and 'sowt' fourcc can be 16bit or 8bit audio.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (qtdemux_parse_trak), (qtdemux_audio_caps): 'twos' and 'sowt' fourcc can be 16bit or 8bit audio. Fix 8bit case (#327133, based on patch by: Fabrizio Gennari <fabrizio dot ge at tiscali dot it>). Also, "G_LITTLE_ENDIAN" and "G_BIG_ENDIAN" are not valid literals for endianness in caps strings, only "LITTLE_ENDIAN" and "BIG_ENDIAN" are valid.
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c57
1 files changed, 36 insertions, 21 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index ee0383cb..fb192636 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -167,8 +167,9 @@ static void gst_qtdemux_handle_esds (GstQTDemux * qtdemux,
QtDemuxStream * stream, GNode * esds);
static GstCaps *qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc,
const guint8 * stsd_data, const gchar ** codec_name);
-static GstCaps *qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc,
- const guint8 * data, int len, const gchar ** codec_name);
+static GstCaps *qtdemux_audio_caps (GstQTDemux * qtdemux,
+ QtDemuxStream * stream, guint32 fourcc, const guint8 * data, int len,
+ const gchar ** codec_name);
static GType
gst_qtdemux_get_type (void)
@@ -2124,7 +2125,9 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GST_ERROR ("unknown version %08x", version);
}
- stream->caps = qtdemux_audio_caps (qtdemux, fourcc, NULL, 0, &codec);
+ stream->caps = qtdemux_audio_caps (qtdemux, stream, fourcc, NULL, 0,
+ &codec);
+
if (codec) {
list = gst_tag_list_new ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
@@ -2737,8 +2740,8 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc,
}
static GstCaps *
-qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data,
- int len, const gchar ** codec_name)
+qtdemux_audio_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
+ guint32 fourcc, const guint8 * data, int len, const gchar ** codec_name)
{
switch (fourcc) {
#if 0
@@ -2751,41 +2754,53 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data,
return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 8, " "depth = (int) 8, " "signed = (boolean) false");
case GST_MAKE_FOURCC ('t', 'w', 'o', 's'):
- _codec ("Raw 16-bit PCM audio");
- /* FIXME */
- return gst_caps_from_string ("audio/x-raw-int, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "endianness = (int) BIG_ENDIAN, " "signed = (boolean) true");
+ if (stream->bytes_per_frame == 1) {
+ _codec ("Raw 8-bit PCM audio");
+ return gst_caps_from_string ("audio/x-raw-int, "
+ "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) true");
+ } else {
+ _codec ("Raw 16-bit PCM audio");
+ /* FIXME */
+ return gst_caps_from_string ("audio/x-raw-int, "
+ "width = (int) 16, "
+ "depth = (int) 16, "
+ "endianness = (int) BIG_ENDIAN, " "signed = (boolean) true");
+ }
case GST_MAKE_FOURCC ('s', 'o', 'w', 't'):
- _codec ("Raw 16-bit PCM audio");
- /* FIXME */
- return gst_caps_from_string ("audio/x-raw-int, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "endianness = (int) G_LITTLE_ENDIAN, " "signed = (boolean) true");
+ if (stream->bytes_per_frame == 1) {
+ _codec ("Raw 8-bit PCM audio");
+ return gst_caps_from_string ("audio/x-raw-int, "
+ "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) true");
+ } else {
+ _codec ("Raw 16-bit PCM audio");
+ /* FIXME */
+ return gst_caps_from_string ("audio/x-raw-int, "
+ "width = (int) 16, "
+ "depth = (int) 16, "
+ "endianness = (int) LITTLE_ENDIAN, " "signed = (boolean) true");
+ }
case GST_MAKE_FOURCC ('f', 'l', '6', '4'):
_codec ("Raw 64-bit floating-point audio");
return gst_caps_from_string ("audio/x-raw-float, "
- "width = (int) 64, " "endianness = (int) G_BIG_ENDIAN");
+ "width = (int) 64, " "endianness = (int) BIG_ENDIAN");
case GST_MAKE_FOURCC ('f', 'l', '3', '2'):
_codec ("Raw 32-bit floating-point audio");
return gst_caps_from_string ("audio/x-raw-float, "
- "width = (int) 32, " "endianness = (int) G_BIG_ENDIAN");
+ "width = (int) 32, " "endianness = (int) BIG_ENDIAN");
case GST_MAKE_FOURCC ('i', 'n', '2', '4'):
_codec ("Raw 24-bit PCM audio");
/* FIXME */
return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 24, "
"depth = (int) 32, "
- "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true");
+ "endianness = (int) BIG_ENDIAN, " "signed = (boolean) true");
case GST_MAKE_FOURCC ('i', 'n', '3', '2'):
_codec ("Raw 32-bit PCM audio");
/* FIXME */
return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 32, "
"depth = (int) 32, "
- "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true");
+ "endianness = (int) BIG_ENDIAN, " "signed = (boolean) true");
case GST_MAKE_FOURCC ('u', 'l', 'a', 'w'):
_codec ("Mu-law audio");
/* FIXME */