From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 09E8644F33 for ; Fri, 9 Dec 2022 19:20:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD42068BD4C; Fri, 9 Dec 2022 21:20:26 +0200 (EET) Received: from mail.overt.org (mail.overt.org [72.14.183.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E94368BD2A for ; Fri, 9 Dec 2022 21:20:20 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=overt.org; s=mail; t=1670613618; bh=Ke/9iRI1WOdB9faKB6lqMESmXOVmlrc2PDeVpr1ubiw=; h=Date:From:To:Subject:In-Reply-To:References:From; b=TQNfRHb/wCe+SkJrqQg6q13e5+YptB7l1MPe47kX7MFZQIC2lesVuzskyK0KgckdE Aio//TOTwY0/zsc62rCu4rji+Vvw+yJJ5pDOj3p/tgz0LTracWUC3jXOlMTwptCiUU IjnZRh/lhJnzQXuS++QLzcgASlSasdzzzCI7dUCv65m3vWiBs5vfCTA8/h2xNaMnYi yAXWAbOoFfyI7oNE82px4ACyPqhHmXXQM3Xqm/73jPVDuRt+cRTD8d7rtqK2IPPiqQ DzHjnXoi60JmjAJNYX+wvEvJZsLNH9V8yl3HM6DBeDotHVkOJHbPl935maF6kdkGgP BEqPHc1S7XDqQ== Received: from authenticated-user (mail.overt.org [72.14.183.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id 526B262A02 for ; Fri, 9 Dec 2022 13:20:18 -0600 (CST) Date: Fri, 9 Dec 2022 11:20:15 -0800 From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Message-ID: <20221209112015.6b528a46@fido7> In-Reply-To: <20221209141617.13641-1-timo@rothenpieler.org> References: <20221205222559.107006-1-timo@rothenpieler.org> <20221209141617.13641-1-timo@rothenpieler.org> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2 1/2] lavc: add new unsafe_output hwaccel_flag 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Fri, 9 Dec 2022 15:16:16 +0100 Timo Rothenpieler wrote: > --- > doc/APIchanges | 3 +++ > libavcodec/avcodec.h | 16 ++++++++++++++++ > libavcodec/options_table.h | 1 + > libavcodec/version.h | 4 ++-- > 4 files changed, 22 insertions(+), 2 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index ab7ce15fae..328028f293 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -14,6 +14,9 @@ libavutil: 2021-04-27 > > API changes, most recent first: > > +2022-12-xx - xxxxxxxxxx - lavc 59.55.100 - avcodec.h > + Add AV_HWACCEL_FLAG_UNSAFE_OUTPUT. > + > 2022-11-xx - xxxxxxxxxx - lavu 57.43.100 - tx.h > Add AV_TX_FLOAT_DCT, AV_TX_DOUBLE_DCT and AV_TX_INT32_DCT. > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 3edd8e2636..0ac581d660 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -2253,6 +2253,22 @@ typedef struct AVHWAccel { > */ > #define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2) > > +/** > + * Some hardware decoders (namely nvdec) can either output direct > decoder > + * surfaces, or make an on-device copy and return said copy. > + * There is a hard limit on how many decoder surfaces there can be, > and it > + * cannot be accurately guessed ahead of time. > + * For some processing chains, this can be okay, but others will run > into the > + * limit and in turn produce very confusing errors that require fine > tuning of > + * more or less obscure options by the user, or in extreme cases > cannot be > + * resolved at all without inserting an avfilter that forces a copy. > + * > + * Thus, the hwaccel will by default make a copy for safety and > resilience. > + * If a users really wants to minimize the amount of copies, they > can set this > + * flag and ensure their processing chain does not exhaust the > surface pool. > + */ > +#define AV_HWACCEL_FLAG_UNSAFE_OUTPUT (1 << 3) > + > /** > * @} > */ > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h > index cd02f5096f..7924ca6144 100644 > --- a/libavcodec/options_table.h > +++ b/libavcodec/options_table.h > @@ -399,6 +399,7 @@ static const AVOption avcodec_options[] = { > {"ignore_level", "ignore level even if the codec level used is > unknown or higher than the maximum supported level reported by the > hardware driver", 0, AV_OPT_TYPE_CONST, { .i64 = > AV_HWACCEL_FLAG_IGNORE_LEVEL }, INT_MIN, INT_MAX, V | D, > "hwaccel_flags" }, {"allow_high_depth", "allow to output YUV pixel > formats with a different chroma sampling than 4:2:0 and/or other than > 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = > AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, > "hwaccel_flags"}, {"allow_profile_mismatch", "attempt to decode > anyway if HW accelerated decoder's supported profiles do not exactly > match the stream", 0, AV_OPT_TYPE_CONST, {.i64 = > AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH }, INT_MIN, INT_MAX, V | D, > "hwaccel_flags"}, +{"unsafe_output", "allow potentially unsafe > hwaccel frame output that might require special care to process > successfully", 0, AV_OPT_TYPE_CONST, {.i64 = > AV_HWACCEL_FLAG_UNSAFE_OUTPUT }, INT_MIN, INT_MAX, V | D, > "hwaccel_flags"}, {"extra_hw_frames", "Number of extra hardware > frames to allocate for the user", OFFSET(extra_hw_frames), > AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, V|D }, > {"discard_damaged_percentage", "Percentage of damaged samples to > discard a frame", OFFSET(discard_damaged_percentage), > AV_OPT_TYPE_INT, {.i64 = 95 }, 0, 100, V|D }, {NULL}, diff --git > a/libavcodec/version.h b/libavcodec/version.h index > 9e66920593..9f42f09f4e 100644 --- a/libavcodec/version.h +++ > b/libavcodec/version.h @@ -29,8 +29,8 @@ #include "version_major.h" > -#define LIBAVCODEC_VERSION_MINOR 54 -#define > LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MINOR 55 > +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT > AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ LGTM --phil _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".