[FFmpeg-devel] [PATCH] ffplay: add support for various YUV conversion modes

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Jul 13 23:59:57 EEST 2018


2018-07-02 23:53 GMT+02:00, Marton Balint <cus at passwd.hu>:
> SDL from version 2.0.8 has support for full range YUV and specifying
> BT601/BT709 color space for YUV->RGB conversion.
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>  fftools/ffplay.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> index 55cea32cae..368e262123 100644
> --- a/fftools/ffplay.c
> +++ b/fftools/ffplay.c
> @@ -954,6 +954,22 @@ static int upload_texture(SDL_Texture **tex, AVFrame
> *frame, struct SwsContext *
>      return ret;
>  }
>
> +static void set_sdl_yuv_conversion_mode(AVFrame *frame)
> +{
> +#if SDL_VERSION_ATLEAST(2,0,8)
> +    SDL_YUV_CONVERSION_MODE mode = SDL_YUV_CONVERSION_AUTOMATIC;
> +    if (frame && (frame->format == AV_PIX_FMT_YUV420P || frame->format ==
> AV_PIX_FMT_YUYV422 || frame->format == AV_PIX_FMT_UYVY422)) {

What happens if the format is YUVJ420P?

Carl Eugen


More information about the ffmpeg-devel mailing list