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>
This commit is contained in:
Jade Macho 2021-03-15 20:35:35 +01:00
parent dcea8baa14
commit 1b81e05ab9
2 changed files with 32 additions and 2 deletions

View file

@ -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"
},

View file

@ -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;