Re: [FFmpeg-devel] [PATCH v1 1/2] lavc/qsvdec: Allow decoders to export crop information

2024-05-23 Thread Xiang, Haihao
On Ma, 2024-05-20 at 10:05 +0800, fei.w.wang-at-intel@ffmpeg.org wrote:
> From: Fei Wang 
> 
> Signed-off-by: Fei Wang 
> ---
>  libavcodec/qsvdec.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index a51ddace62..12cf630593 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -859,6 +859,10 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext
> *q,
>  else
>  frame->flags &= ~AV_FRAME_FLAG_KEY;
>  }
> +    frame->crop_left   = outsurf->Info.CropX;
> +    frame->crop_top    = outsurf->Info.CropY;
> +    frame->crop_right  = outsurf->Info.Width - (outsurf->Info.CropX +
> outsurf->Info.CropW);
> +    frame->crop_bottom = outsurf->Info.Height - (outsurf->Info.CropY +
> outsurf->Info.CropH);
>  
>  /* update the surface properties */
>  if (avctx->pix_fmt == AV_PIX_FMT_QSV)
> @@ -1148,7 +1152,7 @@ const FFCodec ff_##x##_qsv_decoder = { \
>  .p.priv_class   = ##_qsv_class, \
>  .hw_configs = qsv_hw_configs, \
>  .p.wrapper_name = "qsv", \
> -    .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
> +    .caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
> FF_CODEC_CAP_EXPORTS_CROPPING, \
>  }; \
>  
>  #define DEFINE_QSV_DECODER(x, X, bsf_name) DEFINE_QSV_DECODER_WITH_OPTION(x,
> X, bsf_name, options)

patchset LGTM, 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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v1 1/2] lavc/qsvdec: Allow decoders to export crop information

2024-05-19 Thread fei . w . wang-at-intel . com
From: Fei Wang 

Signed-off-by: Fei Wang 
---
 libavcodec/qsvdec.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index a51ddace62..12cf630593 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -859,6 +859,10 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q,
 else
 frame->flags &= ~AV_FRAME_FLAG_KEY;
 }
+frame->crop_left   = outsurf->Info.CropX;
+frame->crop_top= outsurf->Info.CropY;
+frame->crop_right  = outsurf->Info.Width - (outsurf->Info.CropX + 
outsurf->Info.CropW);
+frame->crop_bottom = outsurf->Info.Height - (outsurf->Info.CropY + 
outsurf->Info.CropH);
 
 /* update the surface properties */
 if (avctx->pix_fmt == AV_PIX_FMT_QSV)
@@ -1148,7 +1152,7 @@ const FFCodec ff_##x##_qsv_decoder = { \
 .p.priv_class   = ##_qsv_class, \
 .hw_configs = qsv_hw_configs, \
 .p.wrapper_name = "qsv", \
-.caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \
+.caps_internal  = FF_CODEC_CAP_NOT_INIT_THREADSAFE | 
FF_CODEC_CAP_EXPORTS_CROPPING, \
 }; \
 
 #define DEFINE_QSV_DECODER(x, X, bsf_name) DEFINE_QSV_DECODER_WITH_OPTION(x, 
X, bsf_name, options)
-- 
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-requ...@ffmpeg.org with subject "unsubscribe".