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.
This commit is contained in:
Fabrizio 2006-01-21 11:43:53 +00:00 committed by Tim-Philipp Müller
parent a017143695
commit 3ac31471aa
3 changed files with 48 additions and 22 deletions

View file

@ -1,3 +1,14 @@
2006-01-21 Tim-Philipp Müller <tim at centricular dot net>
* 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.
2006-01-20 Edgard Lima <edgard.lima@indt.org.br> 2006-01-20 Edgard Lima <edgard.lima@indt.org.br>
* ext/ivorbis/vorbisfile.c: * ext/ivorbis/vorbisfile.c:

2
common

@ -1 +1 @@
Subproject commit 5d64704708b8ec2bff66d095269dd5791f7a94b3 Subproject commit bc4325349e8d0ec90aa5c5e74566880cc2e82527

View file

@ -167,8 +167,9 @@ static void gst_qtdemux_handle_esds (GstQTDemux * qtdemux,
QtDemuxStream * stream, GNode * esds); QtDemuxStream * stream, GNode * esds);
static GstCaps *qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, static GstCaps *qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc,
const guint8 * stsd_data, const gchar ** codec_name); const guint8 * stsd_data, const gchar ** codec_name);
static GstCaps *qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, static GstCaps *qtdemux_audio_caps (GstQTDemux * qtdemux,
const guint8 * data, int len, const gchar ** codec_name); QtDemuxStream * stream, guint32 fourcc, const guint8 * data, int len,
const gchar ** codec_name);
static GType static GType
gst_qtdemux_get_type (void) gst_qtdemux_get_type (void)
@ -2124,7 +2125,9 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak)
GST_ERROR ("unknown version %08x", version); 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) { if (codec) {
list = gst_tag_list_new (); list = gst_tag_list_new ();
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
@ -2737,8 +2740,8 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc,
} }
static GstCaps * static GstCaps *
qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data, qtdemux_audio_caps (GstQTDemux * qtdemux, QtDemuxStream * stream,
int len, const gchar ** codec_name) guint32 fourcc, const guint8 * data, int len, const gchar ** codec_name)
{ {
switch (fourcc) { switch (fourcc) {
#if 0 #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, " return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 8, " "depth = (int) 8, " "signed = (boolean) false"); "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) false");
case GST_MAKE_FOURCC ('t', 'w', 'o', 's'): case GST_MAKE_FOURCC ('t', 'w', 'o', 's'):
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"); _codec ("Raw 16-bit PCM audio");
/* FIXME */ /* FIXME */
return gst_caps_from_string ("audio/x-raw-int, " return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 16, " "width = (int) 16, "
"depth = (int) 16, " "depth = (int) 16, "
"endianness = (int) BIG_ENDIAN, " "signed = (boolean) true"); "endianness = (int) BIG_ENDIAN, " "signed = (boolean) true");
}
case GST_MAKE_FOURCC ('s', 'o', 'w', 't'): case GST_MAKE_FOURCC ('s', 'o', 'w', 't'):
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"); _codec ("Raw 16-bit PCM audio");
/* FIXME */ /* FIXME */
return gst_caps_from_string ("audio/x-raw-int, " return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 16, " "width = (int) 16, "
"depth = (int) 16, " "depth = (int) 16, "
"endianness = (int) G_LITTLE_ENDIAN, " "signed = (boolean) true"); "endianness = (int) LITTLE_ENDIAN, " "signed = (boolean) true");
}
case GST_MAKE_FOURCC ('f', 'l', '6', '4'): case GST_MAKE_FOURCC ('f', 'l', '6', '4'):
_codec ("Raw 64-bit floating-point audio"); _codec ("Raw 64-bit floating-point audio");
return gst_caps_from_string ("audio/x-raw-float, " 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'): case GST_MAKE_FOURCC ('f', 'l', '3', '2'):
_codec ("Raw 32-bit floating-point audio"); _codec ("Raw 32-bit floating-point audio");
return gst_caps_from_string ("audio/x-raw-float, " 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'): case GST_MAKE_FOURCC ('i', 'n', '2', '4'):
_codec ("Raw 24-bit PCM audio"); _codec ("Raw 24-bit PCM audio");
/* FIXME */ /* FIXME */
return gst_caps_from_string ("audio/x-raw-int, " return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 24, " "width = (int) 24, "
"depth = (int) 32, " "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'): case GST_MAKE_FOURCC ('i', 'n', '3', '2'):
_codec ("Raw 32-bit PCM audio"); _codec ("Raw 32-bit PCM audio");
/* FIXME */ /* FIXME */
return gst_caps_from_string ("audio/x-raw-int, " return gst_caps_from_string ("audio/x-raw-int, "
"width = (int) 32, " "width = (int) 32, "
"depth = (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'): case GST_MAKE_FOURCC ('u', 'l', 'a', 'w'):
_codec ("Mu-law audio"); _codec ("Mu-law audio");
/* FIXME */ /* FIXME */