diff options
author | Jade Macho <nuda1998@gmail.com> | 2021-03-15 20:35:35 +0100 |
---|---|---|
committer | Jade Macho <nuda1998@gmail.com> | 2021-03-15 20:35:35 +0100 |
commit | 1b81e05ab9203fead9fbca4997703b2ed6484ec2 (patch) | |
tree | a4d8d8f5a6d023814086aa2a124cc25ac5aa3858 | |
parent | dcea8baa14a5fc3b796d876baaf2f238546ba2b1 (diff) |
Hook up audio/x-xma: xmaversion: [1,2] to AV_CODEC_ID_XMA[1,2]
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-libav/-/merge_requests/124>
-rw-r--r-- | docs/gst_plugins_cache.json | 4 | ||||
-rw-r--r-- | ext/libav/gstavcodecmap.c | 30 |
2 files changed, 32 insertions, 2 deletions
diff --git a/docs/gst_plugins_cache.json b/docs/gst_plugins_cache.json index dc3805e..962e189 100644 --- a/docs/gst_plugins_cache.json +++ b/docs/gst_plugins_cache.json @@ -24153,7 +24153,7 @@ "long-name": "libav Xbox Media Audio 1 decoder", "pad-templates": { "sink": { - "caps": "unknown/unknown:\n", + "caps": "audio/x-xma:\n xmaversion: 1\n", "direction": "sink", "presence": "always" }, @@ -24181,7 +24181,7 @@ "long-name": "libav Xbox Media Audio 2 decoder", "pad-templates": { "sink": { - "caps": "unknown/unknown:\n", + "caps": "audio/x-xma:\n xmaversion: 2\n", "direction": "sink", "presence": "always" }, diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index be22f22..d0421c9 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -1233,6 +1233,21 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, break; } + case AV_CODEC_ID_XMA1: + { + caps = + gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-xma", + "xmaversion", G_TYPE_INT, 1, NULL); + break; + } + case AV_CODEC_ID_XMA2: + { + caps = + gst_ff_aud_caps_new (context, NULL, codec_id, encode, "audio/x-xma", + "xmaversion", G_TYPE_INT, 2, NULL); + break; + } + case AV_CODEC_ID_MACE3: case AV_CODEC_ID_MACE6: { @@ -3997,6 +4012,21 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) } if (id != AV_CODEC_ID_NONE) audio = TRUE; + } else if (!strcmp (mimetype, "audio/x-xma")) { + gint xmaversion = 0; + + if (gst_structure_get_int (structure, "xmaversion", &xmaversion)) { + switch (xmaversion) { + case 1: + id = AV_CODEC_ID_XMA1; + break; + case 2: + id = AV_CODEC_ID_XMA2; + break; + } + } + if (id != AV_CODEC_ID_NONE) + audio = TRUE; } else if (!strcmp (mimetype, "audio/x-wms")) { id = AV_CODEC_ID_WMAVOICE; audio = TRUE; |