[vlc-commits] [Git][videolan/vlc][master] 8 commits: kva: map common 32-bit and 24-bit RGB masks
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Sep 29 15:24:48 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
af019fba by Steve Lhomme at 2023-09-29T15:09:23+00:00
kva: map common 32-bit and 24-bit RGB masks
The RGB32/RGB24 masks are passed verbatim to VLC. So the same assumptions
we made on the masks were correct, regardless of endianness.
- - - - -
3af18cda by Steve Lhomme at 2023-09-29T15:09:23+00:00
screen/xcb: replace VLC_CODEC_RGB24M with VLC_CODEC_RGB24
This is the format once the mask will be "fixed".
- - - - -
740cac57 by Steve Lhomme at 2023-09-29T15:09:23+00:00
vout/xcb: don't set a mask on chromas without a mask
- - - - -
eb4484d4 by Steve Lhomme at 2023-09-29T15:09:23+00:00
vout/xcb: map 24-bit RGB to RGB24
We pass the mask verbatim so that's how the mask were interpreted so far.
- - - - -
e0d9ea7f by Steve Lhomme at 2023-09-29T15:09:23+00:00
vout/xcb: refuse masks that can't be mapped to VLC chromas
We have the most common ones and we won't be able to convert them
otherwise.
- - - - -
3b76d00a by Steve Lhomme at 2023-09-29T15:09:23+00:00
bitmapinfoheader: always read 24-bit RGB as BGR24
Using BI_BITFIELDS is only allowed for 16/32 bits. VLC always writes BI_RGB
and flips the bits to match it if necessary.
- - - - -
98d81db9 by Steve Lhomme at 2023-09-29T15:09:23+00:00
fourcc: change the VLC_CODEC_RGB24 FourCC to RV24
So that code passing a chroma as a string ends up on the on the same chroma
layout.
- - - - -
92d89bc3 by Steve Lhomme at 2023-09-29T15:09:23+00:00
vlc_fourcc: remove read-only VLC_CODEC_RGB24M
It's never used as such. Only 2 masks existed and they have been replaced with
VLC_CODEC_RGB24 and VLC_CODEC_BGR24.
- - - - -
25 changed files:
- include/vlc_fourcc.h
- modules/access/screen/xcb.c
- modules/codec/avcodec/chroma.c
- modules/codec/avcodec/fourcc.c
- modules/codec/mft.cpp
- modules/demux/avi/bitmapinfoheader.h
- modules/gui/qt/style/systempalette.cpp
- modules/mux/avi.c
- modules/stream_out/rtpfmt.c
- modules/video_chroma/i420_rgb.c
- modules/video_chroma/rv32.c
- modules/video_filter/ball.c
- modules/video_filter/blend.cpp
- modules/video_filter/filter_picture.h
- modules/video_filter/mirror.c
- modules/video_filter/posterize.c
- modules/video_filter/sepia.c
- modules/video_output/kva.c
- modules/video_output/libplacebo/utils.c
- modules/video_output/opengl/interop_sw.c
- modules/video_output/vmem.c
- modules/video_output/xcb/pictures.c
- src/misc/es_format.c
- src/misc/fourcc.c
- src/misc/fourcc_list.h
Changes:
=====================================
include/vlc_fourcc.h
=====================================
@@ -347,8 +347,6 @@
#define VLC_CODEC_RGB15 VLC_FOURCC('R','V','1','5')
/* 16-bit RGB (using explicit masks) */
#define VLC_CODEC_RGB16 VLC_FOURCC('R','V','1','6')
-/* 24-bit RGB (using explicit masks) */
-#define VLC_CODEC_RGB24M VLC_FOURCC('R','V','2','4')
/* 24-bit RGB padded to 32 bits (using explicit masks) */
#define VLC_CODEC_RGB32 VLC_FOURCC('R','V','3','2')
@@ -362,7 +360,7 @@
#define VLC_CODEC_XBGR VLC_FOURCC('X','B','G','R')
/* 24-bit RGB, in memory address order: "RGB" */
-#define VLC_CODEC_RGB24 VLC_FOURCC('R','G','B','3')
+#define VLC_CODEC_RGB24 VLC_FOURCC('R','V','2','4')
/* 24-bit BGR, in memory address order: "BGR" */
#define VLC_CODEC_BGR24 VLC_FOURCC('B','G','R','3')
=====================================
modules/access/screen/xcb.c
=====================================
@@ -537,7 +537,7 @@ static es_out_id_t *InitES (demux_t *demux, uint_fast16_t width,
if (fmt->bits_per_pixel == 32)
chroma = VLC_CODEC_XRGB;
else if (fmt->bits_per_pixel == 24)
- chroma = VLC_CODEC_RGB24M;
+ chroma = VLC_CODEC_RGB24;
break;
case 16:
if (fmt->bits_per_pixel == 16)
=====================================
modules/codec/avcodec/chroma.c
=====================================
@@ -159,8 +159,6 @@ static const struct
{VLC_CODEC_RGB24, AV_PIX_FMT_RGB24, 0, 0, 0 },
{VLC_CODEC_BGR24, AV_PIX_FMT_BGR24, 0, 0, 0 },
- VLC_RGB( VLC_CODEC_RGB24M, AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, 0xff0000, 0x00ff00, 0x0000ff )
-
{VLC_CODEC_RGBX, AV_PIX_FMT_RGB0, 0, 0, 0 },
{VLC_CODEC_XRGB, AV_PIX_FMT_0RGB, 0, 0, 0 },
{VLC_CODEC_BGRX, AV_PIX_FMT_BGR0, 0, 0, 0 },
=====================================
modules/codec/avcodec/fourcc.c
=====================================
@@ -62,7 +62,6 @@ static const struct vlc_avcodec_fourcc video_codecs[] =
{ VLC_CODEC_JPEGLS, AV_CODEC_ID_JPEGLS },
{ VLC_CODEC_MP4V, AV_CODEC_ID_MPEG4 },
{ VLC_CODEC_RGB32, AV_CODEC_ID_RAWVIDEO },
- { VLC_CODEC_RGB24M, AV_CODEC_ID_RAWVIDEO },
{ VLC_CODEC_RGB24, AV_CODEC_ID_RAWVIDEO },
{ VLC_CODEC_BGR24, AV_CODEC_ID_RAWVIDEO },
{ VLC_CODEC_RGB16, AV_CODEC_ID_RAWVIDEO },
=====================================
modules/codec/mft.cpp
=====================================
@@ -294,7 +294,6 @@ static const pair_format_guid video_format_table[] =
static const pair_format_guid d3d_format_table[] = {
{ VLC_CODEC_BGRX, MFVideoFormat_RGB32 },
{ VLC_CODEC_BGR24, MFVideoFormat_RGB24 },
- { VLC_CODEC_RGB24M, MFVideoFormat_RGB24 },
{ VLC_CODEC_BGRA, MFVideoFormat_ARGB32 },
{ VLC_CODEC_GREY, MFVideoFormat_L8 },
{ 0, GUID_NULL }
=====================================
modules/demux/avi/bitmapinfoheader.h
=====================================
@@ -50,9 +50,6 @@ static const struct
{ VLC_CODEC_RGB16, 0xf800, /* FIXME it should be B5G6R5LE */
0x07e0,
0x001f, },
- { VLC_CODEC_RGB24M, 0x000000ff, /* BGR (see biBitCount) */
- 0x0000ff00,
- 0x00ff0000, },
{ VLC_CODEC_RGB32, 0x00ff0000, /* This is in XRGB format */
0x0000ff00,
0x000000ff, },
@@ -117,7 +114,7 @@ static inline int ParseBitmapInfoHeader( const VLC_BITMAPINFOHEADER *p_bih, size
fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_RGB32;
break;
case 24:
- fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_RGB24M; /* BGR (see biBitCount) */
+ fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_BGR24;
break;
case 16:
fmt->video.i_chroma = fmt->i_codec = VLC_CODEC_RGB16; /* RGB (5,6,5 bits) */
@@ -293,7 +290,6 @@ static inline int CreateBitmapInfoHeader( const es_format_t *fmt,
biCompression = BI_BITFIELDS;
b_has_alpha = true;
break;
- case VLC_CODEC_RGB24M:
case VLC_CODEC_BGR24:
biBitCount = 24;
break;
=====================================
modules/gui/qt/style/systempalette.cpp
=====================================
@@ -249,7 +249,6 @@ QImage ExternalPaletteImpl::getCSDImage(vlc_qt_theme_csd_button_type type, vlc_q
format = QImage::Format_RGBA8888_Premultiplied;
break;
case VLC_CODEC_RGB24:
- case VLC_CODEC_RGB24M:
format = QImage::Format_RGB888;
break;
default:
=====================================
modules/mux/avi.c
=====================================
@@ -482,29 +482,6 @@ static int PrepareSamples( const avi_stream_t *p_stream,
}
}
- /* RV24 is only BGR in AVI, and we can't use BI_BITFIELD */
- if( p_stream->i_cat == VIDEO_ES &&
- p_stream->bih.biCompression == BI_RGB &&
- p_stream->bih.biBitCount == 24 &&
- (p_fmt->video.i_bmask != 0xFF0000 ||
- p_fmt->video.i_rmask != 0x0000FF) )
- {
- unsigned rshift = ctz(p_fmt->video.i_rmask);
- unsigned gshift = ctz(p_fmt->video.i_gmask);
- unsigned bshift = ctz(p_fmt->video.i_bmask);
-
- uint8_t *p_data = (*pp_block)->p_buffer;
- for( size_t i=0; i<(*pp_block)->i_buffer / 3; i++ )
- {
- uint8_t *p = &p_data[i*3];
- /* reorder as BGR using shift value (done by FixRGB) */
- uint32_t v = (p[0] << 16) | (p[1] << 8) | p[2];
- p[0] = (v & p_fmt->video.i_bmask) >> bshift;
- p[1] = (v & p_fmt->video.i_gmask) >> gshift;
- p[2] = (v & p_fmt->video.i_rmask) >> rshift;
- }
- }
-
return VLC_SUCCESS;
}
=====================================
modules/stream_out/rtpfmt.c
=====================================
@@ -660,7 +660,6 @@ int rtp_get_fmt( vlc_object_t *obj, const es_format_t *p_fmt, const char *mux,
return VLC_ENOMEM;
}
break;
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB24:
rtp_fmt->ptname = "raw";
rtp_fmt->pf_packetize = rtp_packetize_rgb24;
=====================================
modules/video_chroma/i420_rgb.c
=====================================
@@ -243,7 +243,6 @@ static int Activate( filter_t *p_filter )
case VLC_CODEC_BGRX:
case VLC_CODEC_RGB24:
case VLC_CODEC_BGR24:
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB32:
p_sys->i_bytespp = 4;
break;
@@ -391,7 +390,6 @@ static void SetYUV( filter_t *p_filter, const video_format_t *vfmt )
case VLC_CODEC_BGRX:
case VLC_CODEC_RGB24:
case VLC_CODEC_BGR24:
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB32:
p_sys->p_rgb32 = (uint32_t *)p_sys->p_base;
for( unsigned i_index = 0; i_index < RED_MARGIN; i_index++ )
=====================================
modules/video_chroma/rv32.c
=====================================
@@ -56,8 +56,7 @@ static const struct vlc_filter_operations filter_ops = {
static int OpenFilter( filter_t *p_filter )
{
/* XXX Only support RV24 -> RV32 conversion */
- if( (p_filter->fmt_in.video.i_chroma != VLC_CODEC_RGB24M &&
- p_filter->fmt_in.video.i_chroma != VLC_CODEC_BGR24 ) ||
+ if( p_filter->fmt_in.video.i_chroma != VLC_CODEC_BGR24 ||
(p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGB32 &&
p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA) )
{
=====================================
modules/video_filter/ball.c
=====================================
@@ -243,7 +243,6 @@ static int Create( filter_t *p_filter )
&p_sys->i_v_offset );
break;
case VLC_CODEC_RGB24:
- case VLC_CODEC_RGB24M:
p_sys->drawingPixelFunction = drawPixelRGB24;
COLORS_RGB
break;
@@ -534,7 +533,6 @@ static void FilterBall( filter_t *p_filter, picture_t *p_inpic,
switch( p_filter->fmt_in.video.i_chroma )
{
case VLC_CODEC_RGB24:
- case VLC_CODEC_RGB24M:
CASE_PACKED_YUV_422
video_format_Init( &fmt_comp, VLC_CODEC_GREY );
fmt_comp.i_width = p_filter->fmt_in.video.i_width;
@@ -774,7 +772,6 @@ static void FilterBall( filter_t *p_filter, picture_t *p_inpic,
switch( p_filter->fmt_in.video.i_chroma )
{
case VLC_CODEC_RGB24:
- case VLC_CODEC_RGB24M:
CASE_PACKED_YUV_422
picture_Release( p_converted );
default:
=====================================
modules/video_filter/blend.cpp
=====================================
@@ -576,7 +576,6 @@ static const struct {
RGB(VLC_CODEC_RGB15, CPictureRGB16, convertRgbToRgbSmall),
RGB(VLC_CODEC_RGB16, CPictureRGB16, convertRgbToRgbSmall),
- RGB(VLC_CODEC_RGB24M, CPictureRGB24, convertNone),
RGB(VLC_CODEC_RGB24, CPictureRGB24, convertNone),
RGB(VLC_CODEC_BGR24, CPictureRGB24, convertNone),
RGB(VLC_CODEC_RGB32, CPictureRGB32, convertNone),
=====================================
modules/video_filter/filter_picture.h
=====================================
@@ -156,14 +156,10 @@ static inline int GetPackedRgbIndexes( const video_format_t *p_fmt, int *i_r_ind
*i_a_index = -1;
break;
case VLC_CODEC_RGB32:
- case VLC_CODEC_RGB24M:
#ifdef WORDS_BIGENDIAN
- {
- const int i_mask_bits = p_fmt->i_chroma == VLC_CODEC_RGB24M ? 16 : 24;
- *i_r_index = (i_mask_bits - vlc_ctz(p_fmt->i_rmask)) / 8;
- *i_g_index = (i_mask_bits - vlc_ctz(p_fmt->i_gmask)) / 8;
- *i_b_index = (i_mask_bits - vlc_ctz(p_fmt->i_bmask)) / 8;
- }
+ *i_r_index = (24 - vlc_ctz(p_fmt->i_rmask)) / 8;
+ *i_g_index = (24 - vlc_ctz(p_fmt->i_gmask)) / 8;
+ *i_b_index = (24 - vlc_ctz(p_fmt->i_bmask)) / 8;
#else
*i_r_index = vlc_ctz(p_fmt->i_rmask) / 8;
*i_g_index = vlc_ctz(p_fmt->i_gmask) / 8;
=====================================
modules/video_filter/mirror.c
=====================================
@@ -120,7 +120,6 @@ static int Create( filter_t *p_filter )
break;
CASE_PACKED_YUV_422
break;
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB24:
case VLC_CODEC_BGR24:
case VLC_CODEC_RGB32:
@@ -227,7 +226,6 @@ static void VerticalMirror( picture_t *p_pic, picture_t *p_outpic, int i_plane,
break;
case VLC_CODEC_UYVY:
break;
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB24:
case VLC_CODEC_BGR24:
RV24VerticalMirror( p_pic, p_outpic, i_plane, b_left_to_right );
=====================================
modules/video_filter/posterize.c
=====================================
@@ -102,7 +102,6 @@ static int Create( filter_t *p_filter )
break;
CASE_PACKED_YUV_422
break;
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB24:
case VLC_CODEC_BGR24:
break;
@@ -173,7 +172,6 @@ static void Filter( filter_t *p_filter, picture_t *p_pic, picture_t *p_outpic )
switch( p_pic->format.i_chroma )
{
- case VLC_CODEC_RGB24M:
case VLC_CODEC_RGB24:
case VLC_CODEC_BGR24:
RVPosterize( p_pic, p_outpic, false, level );
=====================================
modules/video_filter/sepia.c
=====================================
@@ -84,7 +84,6 @@ static const struct
SepiaFunction pf_sepia;
} p_sepia_cfg[] = {
{ VLC_CODEC_I420, PlanarI420Sepia },
- { VLC_CODEC_RGB24M, RVSepia },
{ VLC_CODEC_RGB24, RVSepia },
{ VLC_CODEC_BGR24, RVSepia },
{ VLC_CODEC_RGB32, RVSepia },
@@ -408,8 +407,7 @@ static void RVSepia( picture_t *p_pic, picture_t *p_outpic, int i_intensity )
#define ONE_HALF (1 << (SCALEBITS - 1))
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
uint8_t *p_in, *p_in_end, *p_line_end, *p_out;
- bool b_isRV32 = p_pic->format.i_chroma != VLC_CODEC_RGB24M &&
- p_pic->format.i_chroma != VLC_CODEC_RGB24 &&
+ bool b_isRV32 = p_pic->format.i_chroma != VLC_CODEC_RGB24 &&
p_pic->format.i_chroma != VLC_CODEC_BGR24;
int i_rindex = 0, i_gindex = 1, i_bindex = 2, i_aindex = -1;
=====================================
modules/video_output/kva.c
=====================================
@@ -451,6 +451,7 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
const vlc_fourcc_t *fallback;
bool b_hw_accel = 0;
FOURCC i_kva_fourcc;
+ bool use_masks = true;
int i_chroma_shift;
int w, h;
@@ -489,12 +490,6 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
i_chroma_shift = 0;
break;
- case VLC_CODEC_RGB24M:
- b_hw_accel = sys->kvac.ulInputFormatFlags & KVAF_BGR24;
- i_kva_fourcc = FOURCC_BGR3;
- i_chroma_shift = 0;
- break;
-
case VLC_CODEC_RGB16:
b_hw_accel = sys->kvac.ulInputFormatFlags & KVAF_BGR16;
i_kva_fourcc = FOURCC_R565;
@@ -506,6 +501,80 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
i_kva_fourcc = FOURCC_R555;
i_chroma_shift = 0;
break;
+
+ case VLC_CODEC_XRGB:
+ if (sys->kvac.ulInputFormatFlags & KVAF_BGR32 &&
+ sys->kvac.ulRMask == 0x00ff0000 &&
+ sys->kvac.ulGMask == 0x0000ff00 &&
+ sys->kvac.ulBMask == 0x000000ff)
+ {
+ b_hw_accel = true;
+ use_masks = false;
+ i_kva_fourcc = FOURCC_BGR4;
+ i_chroma_shift = 0;
+ }
+ break;
+ case VLC_CODEC_XBGR:
+ if (sys->kvac.ulInputFormatFlags & KVAF_BGR32 &&
+ sys->kvac.ulRMask == 0x000000ff &&
+ sys->kvac.ulGMask == 0x0000ff00 &&
+ sys->kvac.ulBMask == 0x00ff0000)
+ {
+ b_hw_accel = true;
+ use_masks = false;
+ i_kva_fourcc = FOURCC_BGR4;
+ i_chroma_shift = 0;
+ }
+ break;
+ case VLC_CODEC_RGBX:
+ if (sys->kvac.ulInputFormatFlags & KVAF_BGR32 &&
+ sys->kvac.ulRMask == 0xff000000 &&
+ sys->kvac.ulGMask == 0x00ff0000 &&
+ sys->kvac.ulBMask == 0x0000ff00)
+ {
+ b_hw_accel = true;
+ use_masks = false;
+ i_kva_fourcc = FOURCC_BGR4;
+ i_chroma_shift = 0;
+ }
+ break;
+ case VLC_CODEC_BGRX:
+ if (sys->kvac.ulInputFormatFlags & KVAF_BGR32 &&
+ sys->kvac.ulRMask == 0x0000ff00 &&
+ sys->kvac.ulGMask == 0x00ff0000 &&
+ sys->kvac.ulBMask == 0xff000000)
+ {
+ b_hw_accel = true;
+ use_masks = false;
+ i_kva_fourcc = FOURCC_BGR4;
+ i_chroma_shift = 0;
+ }
+ break;
+
+ case VLC_CODEC_RGB24:
+ if (sys->kvac.ulInputFormatFlags & KVAF_BGR24 &&
+ sys->kvac.ulRMask == 0xff0000 &&
+ sys->kvac.ulGMask == 0x00ff00 &&
+ sys->kvac.ulBMask == 0x0000ff)
+ {
+ b_hw_accel = true;
+ use_masks = false;
+ i_kva_fourcc = FOURCC_BGR3;
+ i_chroma_shift = 0;
+ }
+ break;
+ case VLC_CODEC_BGR24:
+ if (sys->kvac.ulInputFormatFlags & KVAF_BGR24 &&
+ sys->kvac.ulRMask == 0x0000ff &&
+ sys->kvac.ulGMask == 0x00ff00 &&
+ sys->kvac.ulBMask == 0xff0000)
+ {
+ b_hw_accel = true;
+ use_masks = false;
+ i_kva_fourcc = FOURCC_BGR3;
+ i_chroma_shift = 0;
+ }
+ break;
}
if( b_hw_accel )
@@ -524,9 +593,18 @@ static int OpenDisplay( vout_display_t *vd, video_format_t *fmt )
}
/* Set the RGB masks */
- fmt->i_rmask = sys->kvac.ulRMask;
- fmt->i_gmask = sys->kvac.ulGMask;
- fmt->i_bmask = sys->kvac.ulBMask;
+ if (use_masks)
+ {
+ fmt->i_rmask = sys->kvac.ulRMask;
+ fmt->i_gmask = sys->kvac.ulGMask;
+ fmt->i_bmask = sys->kvac.ulBMask;
+ }
+ else
+ {
+ fmt->i_rmask = 0;
+ fmt->i_gmask = 0;
+ fmt->i_bmask = 0;
+ }
msg_Dbg( vd, "output chroma = %4.4s", ( const char * )&fmt->i_chroma );
msg_Dbg( vd, "KVA chroma = %4.4s", ( const char * )&i_kva_fourcc );
=====================================
modules/video_output/libplacebo/utils.c
=====================================
@@ -198,7 +198,6 @@ static const struct { vlc_fourcc_t fcc; struct fmt_desc desc; } formats[] = {
{ VLC_CODEC_RGB565LE, {PACKED(3, 5, 1)} },
{ VLC_CODEC_RGB555LE, {PACKED(3, 5, 1)} },
{ VLC_CODEC_RGB16, {PACKED(3, 5, 1)} },
- { VLC_CODEC_RGB24M, {PACKED(3, 8, 0)} },
{ VLC_CODEC_RGB24, {PACKED(3, 8, 0)} },
{ VLC_CODEC_BGR24, {PACKED(3, 8, 0)} },
{ VLC_CODEC_RGB32, {PACKED(3, 8, 8)} },
=====================================
modules/video_output/opengl/interop_sw.c
=====================================
@@ -606,18 +606,6 @@ interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
{
switch (chroma)
{
- case VLC_CODEC_RGB24M:
- if(!interop->fmt_in.i_rmask && !fallback_masks)
- return VLC_EGENERIC;
- interop->texs[0] = (struct vlc_gl_tex_cfg) {
- { 1, 1 }, { 1, 1 }, GL_RGB,
-#ifdef GL_BGR
- interop->fmt_in.i_rmask == 0x0000ff ? GL_BGR :
-#endif
- GL_RGB,
- GL_UNSIGNED_BYTE
- };
- break;
case VLC_CODEC_RGB24:
interop->texs[0] = (struct vlc_gl_tex_cfg) {
{ 1, 1 }, { 1, 1 }, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE
@@ -821,19 +809,6 @@ interop_init:
interop->fmt_in.i_bmask = 0x0000ff00;
}
break;
- case VLC_CODEC_RGB24M:
- /* Ensure we only request and forward RGB or BGR in memory order */
- if(interop->fmt_in.i_rmask != 0xff0000
-#ifdef GL_BGR
- && interop->fmt_in.i_rmask != 0x0000ff
-#endif
- )
- {
- interop->fmt_in.i_rmask = 0xff0000;
- interop->fmt_in.i_gmask = 0x00ff00;
- interop->fmt_in.i_bmask = 0x0000ff;
- }
- break;
default:
interop->fmt_in.i_rmask = 0;
interop->fmt_in.i_gmask = 0;
=====================================
modules/video_output/vmem.c
=====================================
@@ -202,11 +202,6 @@ static int Open(vout_display_t *vd,
fmt.i_gmask = 0x07e0;
fmt.i_bmask = 0xf800;
break;
- case VLC_CODEC_RGB24M:
- fmt.i_rmask = 0xff0000;
- fmt.i_gmask = 0x00ff00;
- fmt.i_bmask = 0x0000ff;
- break;
case VLC_CODEC_RGB32:
fmt.i_chroma = VLC_CODEC_XRGB;
/* fallthrough */
=====================================
modules/video_output/xcb/pictures.c
=====================================
@@ -101,6 +101,8 @@ bool vlc_xcb_VisualToFormat(const xcb_setup_t *setup, uint_fast8_t depth,
if (fmt->bits_per_pixel == 16 && setup->image_byte_order != ORDER)
return false;
+ bool use_masks = true;
+
/* Check that VLC supports the pixel format. */
switch (fmt->depth)
{
@@ -113,7 +115,25 @@ bool vlc_xcb_VisualToFormat(const xcb_setup_t *setup, uint_fast8_t depth,
if (fmt->bits_per_pixel == 32)
f->i_chroma = VLC_CODEC_RGB32;
else if (fmt->bits_per_pixel == 24)
- f->i_chroma = VLC_CODEC_RGB24M;
+ {
+ if (vt->red_mask == 0xff0000 &&
+ vt->green_mask == 0x00ff00 &&
+ vt->blue_mask == 0x0000ff)
+ {
+ f->i_chroma = VLC_CODEC_RGB24;
+ use_masks = false;
+ }
+ else
+ if (vt->red_mask == 0x0000ff &&
+ vt->green_mask == 0x00ff00 &&
+ vt->blue_mask == 0xff0000)
+ {
+ f->i_chroma = VLC_CODEC_BGR24;
+ use_masks = false;
+ }
+ else
+ return false;
+ }
else
return false;
break;
@@ -130,6 +150,7 @@ bool vlc_xcb_VisualToFormat(const xcb_setup_t *setup, uint_fast8_t depth,
case 8:
if (fmt->bits_per_pixel != 8)
return false;
+ use_masks = false;
if (vt->_class == XCB_VISUAL_CLASS_TRUE_COLOR)
f->i_chroma = VLC_CODEC_RGB233;
else
@@ -139,9 +160,18 @@ bool vlc_xcb_VisualToFormat(const xcb_setup_t *setup, uint_fast8_t depth,
vlc_assert_unreachable();
}
- f->i_rmask = vt->red_mask;
- f->i_gmask = vt->green_mask;
- f->i_bmask = vt->blue_mask;
+ if (use_masks)
+ {
+ f->i_rmask = vt->red_mask;
+ f->i_gmask = vt->green_mask;
+ f->i_bmask = vt->blue_mask;
+ }
+ else
+ {
+ f->i_rmask = 0;
+ f->i_gmask = 0;
+ f->i_bmask = 0;
+ }
return true;
}
=====================================
src/misc/es_format.c
=====================================
@@ -53,11 +53,6 @@ void video_format_FixRgb( video_format_t *p_fmt )
p_fmt->i_bmask = 0x001f;
break;
- case VLC_CODEC_RGB24M:
- p_fmt->i_rmask = 0xff0000;
- p_fmt->i_gmask = 0x00ff00;
- p_fmt->i_bmask = 0x0000ff;
- break;
case VLC_CODEC_RGB32:
p_fmt->i_rmask = 0x00ff0000;
p_fmt->i_gmask = 0x0000ff00;
@@ -116,29 +111,6 @@ void video_format_FixRgb( video_format_t *p_fmt )
p_fmt->i_bmask = 0;
}
}
-
- if ( p_fmt->i_chroma == VLC_CODEC_RGB24M )
- {
- if ( p_fmt->i_rmask == 0xff0000 &&
- p_fmt->i_gmask == 0x00ff00 &&
- p_fmt->i_bmask == 0x0000ff )
- {
- p_fmt->i_chroma = VLC_CODEC_RGB24;
- p_fmt->i_rmask = 0;
- p_fmt->i_gmask = 0;
- p_fmt->i_bmask = 0;
- }
- else
- if ( p_fmt->i_rmask == 0x0000ff &&
- p_fmt->i_gmask == 0x00ff00 &&
- p_fmt->i_bmask == 0xff0000 )
- {
- p_fmt->i_chroma = VLC_CODEC_BGR24;
- p_fmt->i_rmask = 0;
- p_fmt->i_gmask = 0;
- p_fmt->i_bmask = 0;
- }
- }
}
void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
@@ -323,7 +295,6 @@ bool video_format_IsSameChroma( const video_format_t *f1,
if( f1->i_chroma == VLC_CODEC_RGB15 ||
f1->i_chroma == VLC_CODEC_RGB16 ||
- f1->i_chroma == VLC_CODEC_RGB24M ||
f1->i_chroma == VLC_CODEC_RGB32 )
{
video_format_t v1 = *f1;
=====================================
src/misc/fourcc.c
=====================================
@@ -839,7 +839,7 @@ static const struct
{ { VLC_CODEC_RGB565LE, VLC_CODEC_RGB565BE,
VLC_CODEC_BGR565LE, VLC_CODEC_BGR565BE }, PACKED_FMT(2, 16) },
{ { VLC_CODEC_RGB24, VLC_CODEC_BGR24,
- VLC_CODEC_RGB24M, 0 }, PACKED_FMT(3, 24) },
+ 0 }, PACKED_FMT(3, 24) },
{ { VLC_CODEC_RGB32, 0 }, PACKED_FMT(4, 24) },
{ { VLC_CODEC_RGBX, VLC_CODEC_XRGB,
VLC_CODEC_BGRX, VLC_CODEC_XBGR }, PACKED_FMT(4, 24) },
=====================================
src/misc/fourcc_list.h
=====================================
@@ -815,8 +815,6 @@ static const staticentry_t p_list_video[] = {
A("RV15"),
B(VLC_CODEC_RGB16, "16 bits RGB"),
A("RV16"),
- B(VLC_CODEC_RGB24M, "24 bits RGB"),
- A("RV24"),
B(VLC_CODEC_RGB32, "32 bits RGB"),
A("RV32"),
B(VLC_CODEC_RGBA, "32 bits RGBA"),
@@ -840,7 +838,7 @@ static const staticentry_t p_list_video[] = {
B(VLC_CODEC_BGRX, "32 bits BGRx"),
A("BGRX"),
B(VLC_CODEC_RGB24, "24 bits RGB"),
- A("RGB3"),
+ A("RV24"),
B(VLC_CODEC_BGR24, "24 bits BGR"),
A("BGR3"),
B(VLC_CODEC_RGB565LE, "16 bits R5G6G5 LE"),
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a7d9d5c3823a1ae1976ef1132a1dc8c039125576...92d89bc3b3936ac04d25270ae94b7cac8f35f017
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a7d9d5c3823a1ae1976ef1132a1dc8c039125576...92d89bc3b3936ac04d25270ae94b7cac8f35f017
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list