Skip to content

Commit f2b7791

Browse files
mstoecklammen99
authored andcommitted
Add support for xrgb/xbgr 2101010 formats
1 parent 9cad079 commit f2b7791

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

src/frame-writer.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ AVPixelFormat FrameWriter::get_input_format()
9292
return AV_PIX_FMT_RGB565LE;
9393
case INPUT_FORMAT_BGR565:
9494
return AV_PIX_FMT_BGR565LE;
95+
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(56, 55, 100)
96+
case INPUT_FORMAT_X2RGB10:
97+
return AV_PIX_FMT_X2RGB10LE;
98+
#endif
99+
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 7, 100)
100+
case INPUT_FORMAT_X2BGR10:
101+
return AV_PIX_FMT_X2BGR10LE;
102+
#endif
95103
default:
96104
std::cerr << "Unknown format: " << params.format << std::endl;
97105
std::exit(-1);

src/frame-writer.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ enum InputFormat
3939
INPUT_FORMAT_BGR8,
4040
INPUT_FORMAT_RGB565,
4141
INPUT_FORMAT_BGR565,
42+
INPUT_FORMAT_X2RGB10,
43+
INPUT_FORMAT_X2BGR10,
4244
};
4345

4446
struct FrameWriterParams

src/main.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ static InputFormat get_input_format(wf_buffer& buffer)
312312
return INPUT_FORMAT_RGB565;
313313
case WL_SHM_FORMAT_BGR565:
314314
return INPUT_FORMAT_BGR565;
315+
case WL_SHM_FORMAT_ARGB2101010:
316+
case WL_SHM_FORMAT_XRGB2101010:
317+
return INPUT_FORMAT_X2RGB10;
318+
case WL_SHM_FORMAT_ABGR2101010:
319+
case WL_SHM_FORMAT_XBGR2101010:
320+
return INPUT_FORMAT_X2BGR10;
315321
default:
316322
fprintf(stderr, "Unsupported buffer format %d, exiting.", buffer.format);
317323
std::exit(0);

0 commit comments

Comments
 (0)