avcodecmap: Add mapping for Opus audio decoder
authorTim-Philipp Müller <tim@centricular.com>
Sat, 29 Oct 2016 14:38:01 +0000 (15:38 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 1 Nov 2016 17:05:37 +0000 (19:05 +0200)
Make avdec_opus work.

https://bugzilla.gnome.org/show_bug.cgi?id=773672

ext/libav/gstavcodecmap.c

index 2274989..98e68cf 100644 (file)
@@ -2108,6 +2108,16 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
       }
       break;
 
+    case AV_CODEC_ID_OPUS:
+      /* Note that ffmpeg has no encoder yet, but just for safety. In the
+       * encoder case, we want to add things like samplerate, channels... */
+      if (!encode) {
+        /* FIXME: can ffmpeg handle multichannel Opus? */
+        caps = gst_caps_new_simple ("audio/x-opus",
+            "channel-mapping-family", G_TYPE_INT, 0, NULL);
+      }
+      break;
+
     case AV_CODEC_ID_S302M:
       caps = gst_caps_new_empty_simple ("audio/x-smpte-302m");
       break;