Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org>
To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 1/3] lavfi/vaapi: Add function to get surface ID from AVFrame
Date: Tue, 20 Jun 2023 02:33:49 +0000
Message-ID: <0f671b0fd5d85fb3df409c89cf899900dd61ecad.camel@intel.com> (raw)
In-Reply-To: <20230616005810.792849-1-fei.w.wang@intel.com>

On Vr, 2023-06-16 at 08:58 +0800, Fei Wang wrote:
> Signed-off-by: Fei Wang <fei.w.wang@intel.com>
> ---
>  libavfilter/vaapi_vpp.c | 10 ++--------
>  libavfilter/vaapi_vpp.h |  5 +++++
>  2 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c
> index a323dab8b8..10d31977c6 100644
> --- a/libavfilter/vaapi_vpp.c
> +++ b/libavfilter/vaapi_vpp.c
> @@ -518,7 +518,6 @@ int ff_vaapi_vpp_init_params(AVFilterContext *avctx,
>                               AVFrame *output_frame)
>  {
>      VAAPIVPPContext *ctx = avctx->priv;
> -    VASurfaceID input_surface;
>      int err;
>  
>      ctx->input_region = (VARectangle) {
> @@ -534,10 +533,8 @@ int ff_vaapi_vpp_init_params(AVFilterContext *avctx,
>      output_frame->crop_left   = 0;
>      output_frame->crop_right  = 0;
>  
> -    input_surface = (VASurfaceID)(uintptr_t)input_frame->data[3],
> -
>      *params = (VAProcPipelineParameterBuffer) {
> -        .surface                 = input_surface,
> +        .surface                 = ff_vaapi_vpp_get_surface_id(input_frame),
>          .surface_region          = &ctx->input_region,
>          .output_region           = NULL,
>          .output_background_color = VAAPI_VPP_BACKGROUND_BLACK,
> @@ -623,7 +620,6 @@ int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx,
>                                   AVFrame *output_frame)
>  {
>      VAAPIVPPContext *ctx = avctx->priv;
> -    VASurfaceID output_surface;
>      VABufferID *params_ids;
>      VAStatus vas;
>      int err;
> @@ -635,10 +631,8 @@ int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx,
>      for (int i = 0; i < cout; i++)
>          params_ids[i] = VA_INVALID_ID;
>  
> -    output_surface = (VASurfaceID)(uintptr_t)output_frame->data[3];
> -
>      vas = vaBeginPicture(ctx->hwctx->display,
> -                         ctx->va_context, output_surface);
> +                         ctx->va_context,
> ff_vaapi_vpp_get_surface_id(output_frame));
>      if (vas != VA_STATUS_SUCCESS) {
>          av_log(avctx, AV_LOG_ERROR, "Failed to attach new picture: "
>                 "%d (%s).\n", vas, vaErrorStr(vas));
> diff --git a/libavfilter/vaapi_vpp.h b/libavfilter/vaapi_vpp.h
> index ead07036dc..cc845b854c 100644
> --- a/libavfilter/vaapi_vpp.h
> +++ b/libavfilter/vaapi_vpp.h
> @@ -27,6 +27,11 @@
>  
>  #include "avfilter.h"
>  
> +static inline VASurfaceID ff_vaapi_vpp_get_surface_id(const AVFrame *frame)
> +{
> +    return (uintptr_t)frame->data[3];
> +}
> +
>  // ARGB black, for VAProcPipelineParameterBuffer.output_background_color.
>  #define VAAPI_VPP_BACKGROUND_BLACK 0xff000000
>  

Patchset LGTM and will apply.

Thanks
Haihao


_______________________________________________
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".

      parent reply	other threads:[~2023-06-20  2:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16  0:58 Fei Wang
2023-06-16  0:58 ` [FFmpeg-devel] [PATCH v2 2/3] lavfi/vaapi: Add some debug message Fei Wang
2023-06-16  0:58 ` [FFmpeg-devel] [PATCH v2 3/3] lavfi/{denoise, procamp, scale, sharpness}_vaapi: Add passthrough mode Fei Wang
2023-06-20  2:33 ` Xiang, Haihao [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=0f671b0fd5d85fb3df409c89cf899900dd61ecad.camel@intel.com \
    --to=haihao.xiang-at-intel.com@ffmpeg.org \
    --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