From patchwork Sun Dec 5 16:23:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soft Works X-Patchwork-Id: 31998 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp3441205iog; Sun, 5 Dec 2021 08:25:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJz86A1HtQ+2ixBhMxyISVOOc8BqXyli57eGVEATn/Y1Pdvfh2sLo/C9daDoFgB1g/8KKFAu X-Received: by 2002:a05:6402:34d1:: with SMTP id w17mr46780183edc.229.1638721538262; Sun, 05 Dec 2021 08:25:38 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id oz13si13730138ejc.610.2021.12.05.08.25.37; Sun, 05 Dec 2021 08:25:38 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@hotmail.com header.s=selector1 header.b=pgE0lzeN; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 055B868AEF8; Sun, 5 Dec 2021 18:23:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from NAM12-MW2-obe.outbound.protection.outlook.com (unknown [40.92.23.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 76D7868AEAF for ; Sun, 5 Dec 2021 18:23:53 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VvJPw6coaV+qKMwH2gxBCwSPiGDe/7nVZQkREfFe6Ux8CDTJYzBxepumHvYzdbYgxwPYGfhY4uXEAdo/E+UKgIGBbhKzgTIiaMmUPWMXdOdfLpfpunhPAVL7th6bcFUaAnVz9Yz61HEcPgiyKBM4VE+m+t+s7p3jt66ceOAf5++wihWO+GQLJLrsmvIlLvFhhzxPtBsby8Gt7BZl/cjSv5vgI0f0xZUgggIl5saMQjHAk/vPpITUnkeVyLbBKw1aOFda1+dTH4hQa3TVOZ22amiY8xyaRhShNX9Bh8UbiPjTvPHd3/GdG2xdPT0Od5YMLR3zgfJCmypnyhb/mGr0TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Oi2efpzxoiaBIhB61M0c9ees4Jkre4Fd+VagEYAhIk4=; b=NTcIVdzrpIUDWvQQwtA1I21Y6nWoEcGQqlZUIoOuWCnnKp2vP72Z46eevGScLBfK8wsZpxyr8IhsSouppXRabiyNUQ1kbMHN/7cUxyWo6QyruzXoGkEW3r8ETvUPbzrNRYNoL5Nmu1Eg8Y7pPMAfr93hfU7EexeUQzlt2/dL87aail1RtdA2YsdNhkJEPIE3vd4rOjBvU2ttMjPmI4SgFmibp5o7BDGAde0ANMhuPsGpiSaErpeAt2lbs8PvZ5oIUcqFHgHdzIpvez6gN62jmxQ9PCg9f3EUa7KoozIQBdyGiv+3B51LFzszL1ZKnR4jo7meUXlIq1Y2GiTVq66/qA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oi2efpzxoiaBIhB61M0c9ees4Jkre4Fd+VagEYAhIk4=; b=pgE0lzeNzhan9NMRn0/UrLTUJdAB07teGzNo9eJmOGHgYZa8nshDQzS3t0w8d3FmnpFiw9hXDI3402QW4iziLItEqjlCFzM2HZFDSphAlmO381XFO7ULe00+/aaVitHvS5TQELU/1E3y8mp98jWquAQ2NLIERvr21h/iYZgJGzv4KM96JqobSNrkxnR8mR08CObDOlaYlP/6KAFwjR0it7jSvwNklm6j6M5kiRyl8ePgF2GQB96chzWGeZNI/pkUlBylP8QIC6NGsA3txkk0IUpb1UssNNN6IDfeIYW38XdDzP77I4R2FF64sPppZBOsykMEiQv7WhTW9g7lOwyxkQ== Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:b::20) by DM8P223MB0333.NAMP223.PROD.OUTLOOK.COM (2603:10b6:8:8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.21; Sun, 5 Dec 2021 16:23:49 +0000 Received: from DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::9c8d:fc63:9488:9775]) by DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM ([fe80::9c8d:fc63:9488:9775%8]) with mapi id 15.20.4755.021; Sun, 5 Dec 2021 16:23:49 +0000 From: Soft Works To: "ffmpeg-devel@ffmpeg.org" Thread-Topic: [PATCH v20 10/20] avfilter/avfilter: Handle subtitle frames Thread-Index: AQHX6fR8EJAzJQN88UmMOJeW1IA9rg== Date: Sun, 5 Dec 2021 16:23:49 +0000 Message-ID: References: <7795dfe8ba792c0f4f7f8a543d4df8adf8d8189e.1638721292.git.softworkz@hotmail.com> <4cb24bff6e1107e2275b0d28cf798b014aee3b55.1638721292.git.softworkz@hotmail.com> <221f403df00a60f61f31b8984fb5a822ac31c77d.1638721292.git.softworkz@hotmail.com> <0059b39b262fe3ecb9f149e0d3d220af4f7d20e7.1638721292.git.softworkz@hotmail.com> <4be446fae9fe1bc0869612df10e26702325fac21.1638721292.git.softworkz@hotmail.com> <0d63fa05d21ef666ac72d9ccc1d961d2d9d15778.1638721292.git.softworkz@hotmail.com> In-Reply-To: <0d63fa05d21ef666ac72d9ccc1d961d2d9d15778.1638721292.git.softworkz@hotmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [CrtiV8XBEJLHzvCDUSxm34PjKsRw7RO98NbBXUqwEXDnBxr6+qW0/wQzpWKbI0ml] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 16275549-ac45-4e94-b497-08d9b80b9ea5 x-ms-traffictypediagnostic: DM8P223MB0333: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P+XS5U9Ph7ox8bCSh0SdmooxwyGawCNn1RDqxt7EoS3l93JEHPnN3MoihM1DKsc6jweic+GCRTplb3VLvohK+OHaGVlp/2kpfsQAjjFGV/NrqFt85zl0YlJH/jnvm/uw4p0hJjvHo8TCIXpOA0aaftAFDEJhXaq+arT05Wqe6Vf1alGweY0mqkkRBX7cVOgUsWZixpQQSNM5MMR2M6oWikL4xTN5vFZinhmWkRRWjj5BUU0OkX86uo5wsaqoFJGE70QMNs18H7JPN9jJe5p847cLRr7e5RVvLKJUxiwkCu/fqbYXzgP/fqGBTPYkQP2Iyw98cDbuaOkp8Qb8cMrENVJVPBNLpQofnj78qQWDpIjnRwmbGXPiIUbZquta2SN2ps9LwrIaDfQftykNKuYXc59Bd/zfoseQZn7hZQKrvWYaWAgTIgS9bJf0ptSIyUlqC47JMXsup8xWLona/HqUjtssGAg+HeMCzYWh1NuIloUP80m5ZyUWWiMlJ2Y/L2SHJb5ffEcZ98sgVu/t/zT0rAw+DHDu6emfk/S1UwoXOJDLEQjqPVyXrpXQkNKGl61BHpg9Sjfy6PVnWfmMNc8Ung== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?W+DQDBGW86yl5IiIEZSjUt1oyVww?= =?utf-8?q?gsBgo3hMIEK8QUBymWCw5MIyaWTAJjcIkOiU3PNoh12QxqrBiErSh8qPM6j57Yzkj?= =?utf-8?q?RSXKHNtpQnLqTbp/v4+1FIx0JG7iueJp/7Qqj5lxHpUJNVdGQNi0DIFI5Gl0XhCKY?= =?utf-8?q?cdeQy3GobFxLLr7bsxxbmvHW5OLNlpNOdiKveYFSjZ5UDFW5gPnSF1TB3xyaMlObZ?= =?utf-8?q?8ErYgwYg8STJep3qpt9z/H4RW72yh/LAQdcc0X4QJh/UtrMcYqZe2wou7qOPZ8eFq?= =?utf-8?q?Uxn1s97GTwf8NrAY4DnXStPG0Y8VBMGWhlxYTC8s8DxMPwihnNTcVYazX79qhNQgH?= =?utf-8?q?BRNvhfZh+cf9qCWgxshRAHA+j3XDlugbJw74epykdgM7qKFByEc0GKCXwD4YFcvd9?= =?utf-8?q?ieUMjNPa05R1ncy4VTAn9TfJEvX6PNR0ccrw2Nxa7AAaAbzfMa0aTRZef/gQZ18gx?= =?utf-8?q?lePq1gUEe7zpfaOsSIZVY1Cqcsjv98Ce+6jXVNu/9QgquKbLQt1qZn0SjHGyStqWY?= =?utf-8?q?DoW+vnXtvEW0FgcAZ75M7eZz6GJXNDdWncxJWydEj/KnGw/pCx4eixt51NFT0XCRZ?= =?utf-8?q?TVl14plpPb1+IICGyd0/JIMU8mssYR0HjzhJEnrEbuepRyCphdrlUTu2Sw0nwNuq2?= =?utf-8?q?FbPzcIBG+Qlh9vwvWfhmhqQUOjcQGFgqwGS/L8mvPpg8G9SA0YYUQnNwE97TLR1ST?= =?utf-8?q?B4K01EhLWkNiEx9QcIqiDWtTch56NL0nvLT1sOKGHD7B/4V5VKp1lB/+kWIT5mrp2?= =?utf-8?q?cZBfjRz7Z6BWjXNiwXDm8nbqtSbzoOH8dnrFliUkJI4UMCdcgjHA8FuY1s+td8eLO?= =?utf-8?q?UAlhs6+C3jcq8gGx53ubEqw8kHXQpWPGBBgkMhLoqpp5VsoqhKjA4Md5NjLAtQtQS?= =?utf-8?q?98fMYKsMZKyWXF0cPvjYfixAO4/bo56HfHtvjIp8HQ/oUQC8kG0x1TQ3tE1v4VaVI?= =?utf-8?q?loJmgQr8JTnP6AvEZFc2FDtprEIDqGjfDWDpm111OqQ=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-1ff67.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 16275549-ac45-4e94-b497-08d9b80b9ea5 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2021 16:23:49.5108 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8P223MB0333 Subject: [FFmpeg-devel] [PATCH v20 10/20] avfilter/avfilter: Handle subtitle frames X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: FSJX8pSo/TUV Signed-off-by: softworkz --- doc/APIchanges | 3 +++ libavfilter/avfilter.c | 8 +++++--- libavfilter/avfilter.h | 11 +++++++++++ libavfilter/avfiltergraph.c | 5 +++++ libavfilter/formats.c | 22 ++++++++++++++++++++++ libavfilter/formats.h | 3 +++ libavfilter/internal.h | 18 +++++++++++++++--- 7 files changed, 64 insertions(+), 6 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 83ac64c3f1..f695efe9ab 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -14,6 +14,9 @@ libavutil: 2021-04-27 API changes, most recent first: +2021-12-05 - xxxxxxxxxx - lavc 9.1.100 - avfilter.h + Add fields subs_list and sub_fmt to AVFilter struct + 2021-12-05 - xxxxxxxxxx - lavc 60.1.100 - avcodec.h Deprecate avcodec_encode_subtitle(), use regular encode api now diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index df5b8f483c..75d5e86539 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -56,7 +56,8 @@ static void tlog_ref(void *ctx, AVFrame *ref, int end) ref->linesize[0], ref->linesize[1], ref->linesize[2], ref->linesize[3], ref->pts, ref->pkt_pos); - if (ref->width) { + switch(ref->type) { + case AVMEDIA_TYPE_VIDEO: ff_tlog(ctx, " a:%d/%d s:%dx%d i:%c iskey:%d type:%c", ref->sample_aspect_ratio.num, ref->sample_aspect_ratio.den, ref->width, ref->height, @@ -64,12 +65,13 @@ static void tlog_ref(void *ctx, AVFrame *ref, int end) ref->top_field_first ? 'T' : 'B', /* Top / Bottom */ ref->key_frame, av_get_picture_type_char(ref->pict_type)); - } - if (ref->nb_samples) { + break; + case AVMEDIA_TYPE_AUDIO: ff_tlog(ctx, " cl:%"PRId64"d n:%d r:%d", ref->channel_layout, ref->nb_samples, ref->sample_rate); + break; } ff_tlog(ctx, "]%s", end ? "\n" : ""); diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index b105dc3159..9f917deb41 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -45,6 +45,7 @@ #include "libavutil/log.h" #include "libavutil/samplefmt.h" #include "libavutil/pixfmt.h" +#include "libavutil/subfmt.h" #include "libavutil/rational.h" #include "libavfilter/version.h" @@ -343,6 +344,12 @@ typedef struct AVFilter { * and outputs use the same sample rate and channel count/layout. */ const enum AVSampleFormat *samples_list; + /** + * Analogous to pixels, but delimited by AV_SUBTITLE_FMT_NONE + * and restricted to filters that only have AVMEDIA_TYPE_SUBTITLE + * inputs and outputs. + */ + const enum AVSubtitleType *subs_list; /** * Equivalent to { pix_fmt, AV_PIX_FMT_NONE } as pixels_list. */ @@ -351,6 +358,10 @@ typedef struct AVFilter { * Equivalent to { sample_fmt, AV_SAMPLE_FMT_NONE } as samples_list. */ enum AVSampleFormat sample_fmt; + /** + * Equivalent to { sub_fmt, AV_SUBTITLE_FMT_NONE } as subs_list. + */ + enum AVSubtitleType sub_fmt; } formats; int priv_size; ///< size of private data to allocate for the filter diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index b8b432e98b..f4987654af 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -311,6 +311,8 @@ static int filter_link_check_formats(void *log, AVFilterLink *link, AVFilterForm return ret; break; + case AVMEDIA_TYPE_SUBTITLE: + return 0; default: av_assert0(!"reached"); } @@ -441,6 +443,9 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx) if (!link) continue; + if (link->type == AVMEDIA_TYPE_SUBTITLE) + continue; + neg = ff_filter_get_negotiation(link); av_assert0(neg); for (neg_step = 1; neg_step < neg->nb_mergers; neg_step++) { diff --git a/libavfilter/formats.c b/libavfilter/formats.c index ba62f73248..46dbbd2975 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavcodec/avcodec.h" #include "libavutil/avassert.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" @@ -431,6 +432,12 @@ int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout) return 0; } +int ff_add_subtitle_type(AVFilterFormats **avff, int64_t fmt) +{ + ADD_FORMAT(avff, fmt, ff_formats_unref, int, formats, nb_formats); + return 0; +} + AVFilterFormats *ff_make_formats_list_singleton(int fmt) { int fmts[2] = { fmt, -1 }; @@ -450,6 +457,13 @@ AVFilterFormats *ff_all_formats(enum AVMediaType type) return NULL; fmt++; } + } else if (type == AVMEDIA_TYPE_SUBTITLE) { + if (ff_add_subtitle_type(&ret, AV_SUBTITLE_FMT_BITMAP) < 0) + return NULL; + if (ff_add_subtitle_type(&ret, AV_SUBTITLE_FMT_ASS) < 0) + return NULL; + if (ff_add_subtitle_type(&ret, AV_SUBTITLE_FMT_TEXT) < 0) + return NULL; } return ret; @@ -724,6 +738,10 @@ int ff_default_query_formats(AVFilterContext *ctx) type = AVMEDIA_TYPE_AUDIO; formats = ff_make_format_list(f->formats.samples_list); break; + case FF_FILTER_FORMATS_SUBFMTS_LIST: + type = AVMEDIA_TYPE_SUBTITLE; + formats = ff_make_format_list(f->formats.subs_list); + break; case FF_FILTER_FORMATS_SINGLE_PIXFMT: type = AVMEDIA_TYPE_VIDEO; formats = ff_make_formats_list_singleton(f->formats.pix_fmt); @@ -732,6 +750,10 @@ int ff_default_query_formats(AVFilterContext *ctx) type = AVMEDIA_TYPE_AUDIO; formats = ff_make_formats_list_singleton(f->formats.sample_fmt); break; + case FF_FILTER_FORMATS_SINGLE_SUBFMT: + type = AVMEDIA_TYPE_SUBTITLE; + formats = ff_make_formats_list_singleton(f->formats.sub_fmt); + break; default: av_assert2(!"Unreachable"); /* Intended fallthrough */ diff --git a/libavfilter/formats.h b/libavfilter/formats.h index a884d15213..94754ebd88 100644 --- a/libavfilter/formats.h +++ b/libavfilter/formats.h @@ -180,6 +180,9 @@ int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts); av_warn_unused_result int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout); +av_warn_unused_result +int ff_add_subtitle_type(AVFilterFormats **avff, int64_t fmt); + /** * Add *ref as a new reference to f. */ diff --git a/libavfilter/internal.h b/libavfilter/internal.h index fc09ef574c..192b0ae196 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -149,9 +149,11 @@ static av_always_inline int ff_filter_execute(AVFilterContext *ctx, avfilter_act enum FilterFormatsState { /** - * The default value meaning that this filter supports all formats - * and (for audio) sample rates and channel layouts/counts as long - * as these properties agree for all inputs and outputs. + * The default value meaning that this filter supports + * - For video: all formats + * - For audio: all sample rates and channel layouts/counts + * - For subtitles: all subtitle formats + * as long as these properties agree for all inputs and outputs. * This state is only allowed in case all inputs and outputs actually * have the same type. * The union is unused in this state. @@ -162,8 +164,10 @@ enum FilterFormatsState { FF_FILTER_FORMATS_QUERY_FUNC, ///< formats.query active. FF_FILTER_FORMATS_PIXFMT_LIST, ///< formats.pixels_list active. FF_FILTER_FORMATS_SAMPLEFMTS_LIST, ///< formats.samples_list active. + FF_FILTER_FORMATS_SUBFMTS_LIST, ///< formats.subs_list active. FF_FILTER_FORMATS_SINGLE_PIXFMT, ///< formats.pix_fmt active FF_FILTER_FORMATS_SINGLE_SAMPLEFMT, ///< formats.sample_fmt active. + FF_FILTER_FORMATS_SINGLE_SUBFMT, ///< formats.sub_fmt active. }; #define FILTER_QUERY_FUNC(func) \ @@ -175,16 +179,24 @@ enum FilterFormatsState { #define FILTER_SAMPLEFMTS_ARRAY(array) \ .formats.samples_list = array, \ .formats_state = FF_FILTER_FORMATS_SAMPLEFMTS_LIST +#define FILTER_SUBFMTS_ARRAY(array) \ + .formats.subs_list = array, \ + .formats_state = FF_FILTER_FORMATS_SUBFMTS_LIST #define FILTER_PIXFMTS(...) \ FILTER_PIXFMTS_ARRAY(((const enum AVPixelFormat []) { __VA_ARGS__, AV_PIX_FMT_NONE })) #define FILTER_SAMPLEFMTS(...) \ FILTER_SAMPLEFMTS_ARRAY(((const enum AVSampleFormat[]) { __VA_ARGS__, AV_SAMPLE_FMT_NONE })) +#define FILTER_SUBFMTS(...) \ + FILTER_SUBFMTS_ARRAY(((const enum AVSubtitleType[]) { __VA_ARGS__, AV_SUBTITLE_FMT_NONE })) #define FILTER_SINGLE_PIXFMT(pix_fmt_) \ .formats.pix_fmt = pix_fmt_, \ .formats_state = FF_FILTER_FORMATS_SINGLE_PIXFMT #define FILTER_SINGLE_SAMPLEFMT(sample_fmt_) \ .formats.sample_fmt = sample_fmt_, \ .formats_state = FF_FILTER_FORMATS_SINGLE_SAMPLEFMT +#define FILTER_SINGLE_SUBFMT(sub_fmt_) \ + .formats.sub_fmt = sub_fmt_, \ + .formats_state = FF_FILTER_FORMATS_SINGLE_SUBFMT #define FILTER_INOUTPADS(inout, array) \ .inout = array, \