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 8F0A441081 for ; Mon, 3 Jan 2022 01:22:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B7ED06805AE; Mon, 3 Jan 2022 03:22:05 +0200 (EET) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F3983689997 for ; Mon, 3 Jan 2022 03:21:59 +0200 (EET) Received: by mail-ua1-f51.google.com with SMTP id o63so55429708uao.5 for ; Sun, 02 Jan 2022 17:21:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZkDeGATLSx5enGR5dOd09ebsXrrVPPbtcFbukVtxEyY=; b=ahdhDBjPm7tGp12OHOHgPcx7WSi2k8R2WrC7Zjc6ekGuzFd749Iood7RzCQGXgeI9o PIqkv1Ivlf3n/TjJOxGvMi0T+CkKTwn2lsYWy1wtcadgZhFiMZJ+eXsimP45oUeTmfcl 6MYAHmdoIgwUC5NadF8V/Xg1nJPT2hkm9JrVZEOsR9IYBJa2nhYzXxCxSL5tM46aTos8 2pyJou/0t7meITS3E2NOqoDu8umoUd+uAk85CclaaoSG5MOzLZDHZWUlMM8AloQ2y5n4 z3FFOxHbOb+WgSSSCXRm+dhzQqqQXFERSoikuTs+5wLnVgegXHOOgNY4BRAVCtaa9mDd 5wlA== X-Gm-Message-State: AOAM533bx8JaiJeNXIC9InCqI73fIRdFOkjFDoMwRxAdNx4pIM0ieedk PIkOTQnQAnwBiOTQnAUSL0udK3AB1IhIO394/rQ8OstIWRo= X-Google-Smtp-Source: ABdhPJyKKAHX8nldzsxp4igH2nT/vI+smcBhFRN0BdYx23VhtopujeFllM3w9fv02MCcAuWMuO355yQDvOfVnlTNBK0= X-Received: by 2002:a67:d51e:: with SMTP id l30mr12955385vsj.1.1641172918000; Sun, 02 Jan 2022 17:21:58 -0800 (PST) MIME-Version: 1.0 References: <20220103003318.442892-1-aicommander@gmail.com> In-Reply-To: <20220103003318.442892-1-aicommander@gmail.com> From: Aman Karmani Date: Sun, 2 Jan 2022 17:21:47 -0800 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH] lavu/videotoolbox: add support for memory mapping 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 Cc: Cameron Gutman 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 Sun, Jan 2, 2022 at 4:33 PM Cameron Gutman wrote: > Signed-off-by: Cameron Gutman > --- > libavutil/hwcontext_videotoolbox.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/libavutil/hwcontext_videotoolbox.c > b/libavutil/hwcontext_videotoolbox.c > index 0a8dbe9f33..026127d412 100644 > --- a/libavutil/hwcontext_videotoolbox.c > +++ b/libavutil/hwcontext_videotoolbox.c > @@ -711,6 +711,30 @@ fail: > return err; > } > > +static int vt_map_from(AVHWFramesContext *hwfc, AVFrame *dst, > + const AVFrame *src, int flags) > +{ > + int err; > + > + if (dst->format == AV_PIX_FMT_NONE) > + dst->format = hwfc->sw_format; > + else if (dst->format != hwfc->sw_format) > + return AVERROR(ENOSYS); > + > + err = vt_map_frame(hwfc, dst, src, flags); > + if (err) > + return err; > + > + dst->width = src->width; > + dst->height = src->height; > + > + err = av_frame_copy_props(dst, src); > + if (err) > + return err; > + > + return 0; > +} > + > static int vt_device_create(AVHWDeviceContext *ctx, const char *device, > AVDictionary *opts, int flags) > { > @@ -736,6 +760,7 @@ const HWContextType ff_hwcontext_type_videotoolbox = { > .transfer_get_formats = vt_transfer_get_formats, > .transfer_data_to = vt_transfer_data_to, > .transfer_data_from = vt_transfer_data_from, > + .map_from = vt_map_from, Thanks for this! Does this add support for hwdownload filter? Or what's the best way to test this patch? Aman > > .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VIDEOTOOLBOX, > AV_PIX_FMT_NONE }, > }; > -- > 2.25.1 > > _______________________________________________ > 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". > _______________________________________________ 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".