From b30f982cf5a64df9fffee9f94b1b993766900a3b Mon Sep 17 00:00:00 2001 From: Tobias Rapp Date: Wed, 22 Mar 2023 15:48:18 +0100 Subject: [PATCH] gst-libav: Update codec mapping for FFVHuff video Replaces the ad-hoc type string 'video/x-gst-av-ffvhuff' with 'video/x-ffvhuff' for the avdec_ffvhuff and avenc_ffvhuff elements. Related to #2389. Part-of: --- subprojects/gst-libav/docs/gst_plugins_cache.json | 4 ++-- subprojects/gst-libav/ext/libav/gstavcodecmap.c | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/subprojects/gst-libav/docs/gst_plugins_cache.json b/subprojects/gst-libav/docs/gst_plugins_cache.json index 5ccd9a6bf1..0c1474f424 100644 --- a/subprojects/gst-libav/docs/gst_plugins_cache.json +++ b/subprojects/gst-libav/docs/gst_plugins_cache.json @@ -8357,7 +8357,7 @@ "long-name": "libav Huffyuv FFmpeg variant decoder", "pad-templates": { "sink": { - "caps": "video/x-gst-av-ffvhuff:\n", + "caps": "video/x-ffvhuff:\n", "direction": "sink", "presence": "always" }, @@ -58625,7 +58625,7 @@ "presence": "always" }, "src": { - "caps": "video/x-gst-av-ffvhuff:\n", + "caps": "video/x-ffvhuff:\n", "direction": "src", "presence": "always" } diff --git a/subprojects/gst-libav/ext/libav/gstavcodecmap.c b/subprojects/gst-libav/ext/libav/gstavcodecmap.c index d47c33db07..438cf17f63 100644 --- a/subprojects/gst-libav/ext/libav/gstavcodecmap.c +++ b/subprojects/gst-libav/ext/libav/gstavcodecmap.c @@ -1271,6 +1271,16 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, } break; + case AV_CODEC_ID_FFVHUFF: + caps = + gst_ff_vid_caps_new (context, NULL, codec_id, encode, + "video/x-ffvhuff", NULL); + if (context) { + gst_caps_set_simple (caps, + "bpp", G_TYPE_INT, context->bits_per_coded_sample, NULL); + } + break; + case AV_CODEC_ID_CYUV: caps = gst_ff_vid_caps_new (context, NULL, codec_id, encode, @@ -1909,7 +1919,6 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id, case AV_CODEC_ID_VIXL: case AV_CODEC_ID_QPEG: case AV_CODEC_ID_PGMYUV: - case AV_CODEC_ID_FFVHUFF: case AV_CODEC_ID_WNV1: case AV_CODEC_ID_MP3ADU: case AV_CODEC_ID_MP3ON4: @@ -4092,6 +4101,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) } else if (!strcmp (mimetype, "video/x-huffyuv")) { id = AV_CODEC_ID_HUFFYUV; video = TRUE; + } else if (!strcmp (mimetype, "video/x-ffvhuff")) { + id = AV_CODEC_ID_FFVHUFF; + video = TRUE; } else if (!strcmp (mimetype, "audio/x-mace")) { gint maceversion = 0;