Commit 4d8cbc47 authored by Antoine Cellerier's avatar Antoine Cellerier

vout_subpictures.c: Do not call the scaling module if the subpicture is using...

vout_subpictures.c: Do not call the scaling module if the subpicture is using RGBA. The current way subpictures scaling and blending modules loading work is kind of flawed. It assumes that the module will be able to handle all the possible types of input chromas. This worked fine previously (since all modules allowing to scale/blend YUVP also handled YUVA), but doesn't now (the scaling module doesn't support RGBA. blending works fine).
vout_pictures.*: Add core support for RGBA pictures.
parent be1ee5f7
...@@ -592,6 +592,7 @@ void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma, ...@@ -592,6 +592,7 @@ void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma,
break; break;
case FOURCC_RV32: case FOURCC_RV32:
case FOURCC_RGBA:
p_format->i_bits_per_pixel = 32; p_format->i_bits_per_pixel = 32;
break; break;
case FOURCC_RV24: case FOURCC_RV24:
...@@ -820,6 +821,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic, ...@@ -820,6 +821,7 @@ int __vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic,
break; break;
case FOURCC_RV32: case FOURCC_RV32:
case FOURCC_RGBA:
p_pic->p->i_lines = i_height_aligned; p_pic->p->i_lines = i_height_aligned;
p_pic->p->i_visible_lines = i_height; p_pic->p->i_visible_lines = i_height;
p_pic->p->i_pitch = i_width_aligned * 4; p_pic->p->i_pitch = i_width_aligned * 4;
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
/* Packed RGB 32bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */ /* Packed RGB 32bpp, usually 0x00ff0000, 0x0000ff00, 0x000000ff */
#define FOURCC_RV32 VLC_FOURCC('R','V','3','2') #define FOURCC_RV32 VLC_FOURCC('R','V','3','2')
/* Packed RGBA 32bpp, like RV32 with 0xff000000 used for alpha */
#define FOURCC_RGBA VLC_FOURCC('R','G','B','A')
/* Planar YUV 4:2:0, Y:U:V */ /* Planar YUV 4:2:0, Y:U:V */
#define FOURCC_I420 VLC_FOURCC('I','4','2','0') #define FOURCC_I420 VLC_FOURCC('I','4','2','0')
#define FOURCC_IYUV VLC_FOURCC('I','Y','U','V') #define FOURCC_IYUV VLC_FOURCC('I','Y','U','V')
......
...@@ -502,6 +502,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt, ...@@ -502,6 +502,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
p_spu->p_blend->fmt_out.video.i_aspect = p_fmt->i_aspect; p_spu->p_blend->fmt_out.video.i_aspect = p_fmt->i_aspect;
p_spu->p_blend->fmt_out.video.i_chroma = p_fmt->i_chroma; p_spu->p_blend->fmt_out.video.i_chroma = p_fmt->i_chroma;
p_spu->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','P'); p_spu->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','P');
/* XXX: We'll also be using it for YUVA and RGBA blending ... */
p_spu->p_blend->p_module = p_spu->p_blend->p_module =
module_Need( p_spu->p_blend, "video blending", 0, 0 ); module_Need( p_spu->p_blend, "video blending", 0, 0 );
...@@ -612,6 +613,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt, ...@@ -612,6 +613,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
p_spu->p_scale->fmt_out.video.i_chroma = p_spu->p_scale->fmt_out.video.i_chroma =
p_spu->p_scale->fmt_in.video.i_chroma = p_spu->p_scale->fmt_in.video.i_chroma =
VLC_FOURCC('Y','U','V','P'); VLC_FOURCC('Y','U','V','P');
/* XXX: We'll also be using it for YUVA and RGBA blending ... */
p_spu->p_scale->fmt_in.video.i_width = p_spu->p_scale->fmt_in.video.i_width =
p_spu->p_scale->fmt_in.video.i_height = 32; p_spu->p_scale->fmt_in.video.i_height = 32;
p_spu->p_scale->fmt_out.video.i_width = p_spu->p_scale->fmt_out.video.i_width =
...@@ -671,7 +673,8 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt, ...@@ -671,7 +673,8 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
} }
if( (i_scale_width != 1000 || i_scale_height != 1000) && if( (i_scale_width != 1000 || i_scale_height != 1000) &&
p_spu->p_scale && !p_region->p_cache ) p_spu->p_scale && !p_region->p_cache &&
VLC_FOURCC('R','G','B','A') != p_region->fmt.i_chroma /* FIXME */ )
{ {
picture_t *p_pic; picture_t *p_pic;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment