gst/matroska/matroska-mux.c: Add support for muxing raw float audio now that the spec defines the endianness and add ...

Original commit message from CVS:
* gst/matroska/matroska-mux.c:
(gst_matroska_mux_audio_pad_setcaps):
Add support for muxing raw float audio now that the spec defines the
endianness and add support for muxing raw integer audio with 24 and
32 bits.
Allow muxing of more than 8 audio channels.
This commit is contained in:
Sebastian Dröge 2008-08-02 17:52:16 +00:00
parent 0767ed3351
commit 266c0bf8bf
2 changed files with 42 additions and 8 deletions

View File

@ -1,3 +1,13 @@
2008-08-02 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/matroska/matroska-mux.c:
(gst_matroska_mux_audio_pad_setcaps):
Add support for muxing raw float audio now that the spec defines the
endianness and add support for muxing raw integer audio with 24 and
32 bits.
Allow muxing of more than 8 audio channels.
2008-08-02 Sebastian Dröge <sebastian.droege@collabora.co.uk> 2008-08-02 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/matroska/matroska-mux.c: (gst_matroska_mux_create_uid), * gst/matroska/matroska-mux.c: (gst_matroska_mux_create_uid),

View File

@ -96,11 +96,10 @@ static GstStaticPadTemplate videosink_templ =
); );
#define COMMON_AUDIO_CAPS \ #define COMMON_AUDIO_CAPS \
"channels = (int) [ 1, 8 ], " \ "channels = (int) [ 1, MAX ], " \
"rate = (int) [ 8000, 96000 ]" "rate = (int) [ 1, MAX ]"
/* FIXME: /* FIXME:
* * audio/x-raw-float: endianness needs defining.
* * require codec data, etc as needed * * require codec data, etc as needed
*/ */
static GstStaticPadTemplate audiosink_templ = static GstStaticPadTemplate audiosink_templ =
@ -129,6 +128,22 @@ static GstStaticPadTemplate audiosink_templ =
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, " "endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, "
"signed = (boolean) true, " "signed = (boolean) true, "
COMMON_AUDIO_CAPS ";" COMMON_AUDIO_CAPS ";"
"audio/x-raw-int, "
"width = (int) 24, "
"depth = (int) 24, "
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, "
"signed = (boolean) true, "
COMMON_AUDIO_CAPS ";"
"audio/x-raw-int, "
"width = (int) 32, "
"depth = (int) 32, "
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }, "
"signed = (boolean) true, "
COMMON_AUDIO_CAPS ";"
"audio/x-raw-float, "
"width = (int) [ 32, 64 ], "
"endianness = (int) LITTLE_ENDIAN, "
COMMON_AUDIO_CAPS ";"
"audio/x-tta, " "audio/x-tta, "
"width = (int) { 8, 16, 24 }, " "width = (int) { 8, 16, 24 }, "
"channels = (int) { 1, 2 }, " "rate = (int) [ 8000, 96000 ]") "channels = (int) { 1, 2 }, " "rate = (int) [ 8000, 96000 ]")
@ -1034,8 +1049,7 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
return TRUE; return TRUE;
} else if (!strcmp (mimetype, "audio/x-raw-int")) { } else if (!strcmp (mimetype, "audio/x-raw-int")) {
gint endianness, width, depth; gint endianness, width, depth;
gboolean signedness = G_LITTLE_ENDIAN;
gboolean signedness;
if (!gst_structure_get_int (structure, "width", &width) || if (!gst_structure_get_int (structure, "width", &width) ||
!gst_structure_get_int (structure, "depth", &depth) || !gst_structure_get_int (structure, "depth", &depth) ||
@ -1055,8 +1069,8 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
return FALSE; return FALSE;
} }
/* where is this spec'ed out? (tpm) */ /* FIXME: where is this spec'ed out? (tpm) */
if ((width == 8 && signedness) || (width == 16 && !signedness)) { if ((width == 8 && signedness) || (width >= 16 && !signedness)) {
GST_DEBUG_OBJECT (mux, "8-bit PCM must be unsigned, 16-bit PCM signed"); GST_DEBUG_OBJECT (mux, "8-bit PCM must be unsigned, 16-bit PCM signed");
return FALSE; return FALSE;
} }
@ -1069,7 +1083,17 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps)
return TRUE; return TRUE;
} else if (!strcmp (mimetype, "audio/x-raw-float")) { } else if (!strcmp (mimetype, "audio/x-raw-float")) {
/* FIXME: endianness is undefined */ gint width;
if (!gst_structure_get_int (structure, "width", &width)) {
GST_DEBUG_OBJECT (mux, "broken caps, width field missing");
return FALSE;
}
audiocontext->bitdepth = width;
context->codec_id = g_strdup (GST_MATROSKA_CODEC_ID_AUDIO_PCM_FLOAT);
return TRUE;
} else if (!strcmp (mimetype, "audio/x-vorbis")) { } else if (!strcmp (mimetype, "audio/x-vorbis")) {
const GValue *streamheader; const GValue *streamheader;