From 00ea1cb00398ac79f14f771f00ba4cfbaeb1ca34 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sat, 14 Jan 2012 19:58:17 +0100 Subject: [PATCH] matroskamux: basic adpcm support https://bugzilla.gnome.org/show_bug.cgi?id=664339 --- gst/matroska/matroska-mux.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index e1cf9ea27f..8699be4946 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -175,7 +175,11 @@ static GstStaticPadTemplate audiosink_templ = "audio/x-alaw, " "channels = (int) {1, 2}, " "rate = (int) [ 8000, 192000 ]; " "audio/x-mulaw, " - "channels = (int) {1, 2}, " "rate = (int) [ 8000, 192000 ]") + "channels = (int) {1, 2}, " "rate = (int) [ 8000, 192000 ]; " + "audio/x-adpcm, " + "layout = (string)dvi, " + "block_align = (int)[64, 8096], " + "channels = (int) { 1, 2 }, " "rate = (int) [ 8000, 96000 ]; ") ); static GstStaticPadTemplate subtitlesink_templ = @@ -1872,7 +1876,8 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps) } else if (!strcmp (mimetype, "audio/x-wma") || !strcmp (mimetype, "audio/x-alaw") - || !strcmp (mimetype, "audio/x-mulaw")) { + || !strcmp (mimetype, "audio/x-mulaw") + || !strcmp (mimetype, "audio/x-adpcm")) { guint8 *codec_priv; guint codec_priv_size; guint16 format = 0; @@ -1923,6 +1928,14 @@ gst_matroska_mux_audio_pad_setcaps (GstPad * pad, GstCaps * caps) block_align = channels; bitrate = block_align * samplerate; + } else if (!strcmp (mimetype, "audio/x-adpcm")) { + if (!gst_structure_get_int (structure, "block_align", &block_align)) { + GST_WARNING_OBJECT (mux, "Missing block_align on adpcm caps"); + goto refuse_caps; + } + /*support for IMA/WAV ADPCM */ + format = GST_RIFF_WAVE_FORMAT_ADPCM_IMA_WAV; + } g_assert (format != 0);