Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Zhao Zhili <quinkblack@foxmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] PATCH: Force vaapi image formats to NV12-only
Date: Fri, 9 Aug 2024 11:49:54 +0800
Message-ID: <tencent_3AB7D4682A00A568927CD2AD0E3899C2650A@qq.com> (raw)
In-Reply-To: <ZrUQdcSai7XrJ0Ya@vicerveza.homeunix.net>

> vaapi drivers often lack proper image converesions and not all
> situations allow vagetimage or vaputimage with the image formats
> reported by the api. nv12 seems allowed in all circumstances.
> 
> with this change now one can use the hwaccel directly without
> explicit conversions to nv12 for frame downloading to work.
> 
> gstreamer adopted a similar approach:
> https://bugzilla.gnome.org/show_bug.cgi?id=752958
> ---
>  libavutil/hwcontext_vaapi.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index 12bc95119a..d678e58d07 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -418,7 +418,12 @@ static int vaapi_device_init(avhwdevicecontext *hwdev)
>      for (i = 0; i < image_count; i++) {
>          fourcc  = image_list[i].fourcc;
>          pix_fmt = vaapi_pix_fmt_from_fourcc(fourcc);
> -        if (pix_fmt == av_pix_fmt_none) {
> +        if (pix_fmt != av_pix_fmt_nv12) {
> +            av_log(hwdev, av_log_debug, "format %#x -> ignored.\n",
> +                   fourcc);
> +            continue;
> +        }
> +        else if (pix_fmt == av_pix_fmt_none) {
>              av_log(hwdev, av_log_debug, "format %#x -> unknown.\n",
>                     fourcc);
>          } else {
> -- 
> 2.44.1

Isn’t it break all pixel formats with bit depth > 8?
I think we already have hwcontext API to select sw_format, this isn’t a bug
inside ffmpeg.

> On Aug 9, 2024, at 02:37, Lluís Batlle i Rossell <viric@viric.name> wrote:
> 
> attached
> <0001-Force-vaapi-image-formats-to-NV12-only.patch>_______________________________________________
> 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".

  reply	other threads:[~2024-08-09  3:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 18:37 Lluís Batlle i Rossell
2024-08-09  3:49 ` Zhao Zhili [this message]
2024-08-09  7:43   ` Lluís Batlle i Rossell
2024-08-10  8:51     ` [FFmpeg-devel] PATCH: Fallback to NV12 format in VAAPI drivers Lluís Batlle i Rossell
2024-08-11 17:57       ` Mark Thompson
2024-08-11 20:21         ` Lluís Batlle i Rossell

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=tencent_3AB7D4682A00A568927CD2AD0E3899C2650A@qq.com \
    --to=quinkblack@foxmail.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