From: "mypopy@gmail.com" <mypopy@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties
Date: Fri, 8 Sep 2023 11:31:29 +0800
Message-ID: <CACYjbn3XrV5KdK=WvSLse1ZtxAfAaLMLD=DoD-u-JOO2B6d-pQ@mail.gmail.com> (raw)
In-Reply-To: <9532EE0B-2128-4418-8CD2-3B4FED7986D6@gmail.com>
On Fri, Sep 8, 2023 at 11:15 AM Marvin Scholz <epirat07@gmail.com> wrote:
>
>
>
> On 8 Sep 2023, at 4:55, Jun Zhao wrote:
>
> > Get the encoder supported properties list, it will be used for
> > feature support checks.
> >
> > Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> > ---
> > libavcodec/videotoolboxenc.c | 70 ++++++++++++++++++++++++------------
> > 1 file changed, 47 insertions(+), 23 deletions(-)
> >
> > diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> > index 2e96990741..832147b6cd 100644
> > --- a/libavcodec/videotoolboxenc.c
> > +++ b/libavcodec/videotoolboxenc.c
> > @@ -232,6 +232,7 @@ typedef struct VTEncContext {
> > AVClass *class;
> > enum AVCodecID codec_id;
> > VTCompressionSessionRef session;
> > + CFDictionaryRef supported_props;
> > CFStringRef ycbcr_matrix;
> > CFStringRef color_primaries;
> > CFStringRef transfer_function;
> > @@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx)
> > set_async_error(vtctx, 0);
> > }
> >
> > +static void vtenc_reset(VTEncContext *vtctx)
> > +{
> > + if (vtctx->session) {
> > + CFRelease(vtctx->session);
> > + vtctx->session = NULL;
> > + }
> > +
> > + if (vtctx->supported_props) {
> > + CFRelease(vtctx->supported_props);
> > + vtctx->supported_props = NULL;
> > + }
> > +
> > + if (vtctx->color_primaries) {
> > + CFRelease(vtctx->color_primaries);
> > + vtctx->color_primaries = NULL;
> > + }
> > +
> > + if (vtctx->transfer_function) {
> > + CFRelease(vtctx->transfer_function);
> > + vtctx->transfer_function = NULL;
> > + }
> > +
> > + if (vtctx->ycbcr_matrix) {
> > + CFRelease(vtctx->ycbcr_matrix);
> > + vtctx->ycbcr_matrix = NULL;
> > + }
> > +}
> > +
> > static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, ExtraSEI **sei)
> > {
> > BufNode *info;
> > @@ -1110,6 +1139,20 @@ static int vtenc_create_encoder(AVCodecContext *avctx,
> > return AVERROR_EXTERNAL;
> > }
> >
> > + if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, *)) {
>
> Thanks, though this needs the proper SDK guards as well too, to not break
> building with SDKs older than 10.13, unless FFmpeg does not care about this.
>
> See https://epir.at/2019/10/30/api-availability-and-target-conditionals/#checking-api-availability-at-compile-time
>
Thx the reference link, will add the build check
_______________________________________________
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".
prev parent reply other threads:[~2023-09-08 3:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 2:55 [FFmpeg-devel] [PATCH v3 1/2] lavc/videotoolboxenc: Dump the encoder Jun Zhao
2023-09-08 2:55 ` [FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties Jun Zhao
2023-09-08 3:15 ` Marvin Scholz
2023-09-08 3:31 ` mypopy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACYjbn3XrV5KdK=WvSLse1ZtxAfAaLMLD=DoD-u-JOO2B6d-pQ@mail.gmail.com' \
--to=mypopy@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git