diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-09-24 19:56:40 +0300 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-09-24 19:56:40 +0300 |
commit | 159aa1275e5d9c94edc313a51d65220e887d790b (patch) | |
tree | acf04039ab3db0ffc4cde7e24492d86ca0f78252 /libavdevice/sdl2.c | |
parent | 1d92256d60df76ea9a892a4a1fc35badea4948c8 (diff) |
lavd/sdl2: Fix 32bit rgb formats on little-endian hardware.
Diffstat (limited to 'libavdevice/sdl2.c')
-rw-r--r-- | libavdevice/sdl2.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c index d083d29cbc..e8252f0cb3 100644 --- a/libavdevice/sdl2.c +++ b/libavdevice/sdl2.c @@ -67,8 +67,6 @@ static const struct sdl_texture_format_entry { * { AV_PIX_FMT_NONE, SDL_PIXELFORMAT_RGBA5551 }, * { AV_PIX_FMT_NONE, SDL_PIXELFORMAT_ABGR1555 }, * { AV_PIX_FMT_NONE, SDL_PIXELFORMAT_BGRA5551 }, - * { AV_PIX_FMT_RGB24,SDL_PIXELFORMAT_RGB888 }, - * { AV_PIX_FMT_BGR24,SDL_PIXELFORMAT_BGR888 }, * { AV_PIX_FMT_NONE, SDL_PIXELFORMAT_ARGB2101010 }, */ { AV_PIX_FMT_RGB8, SDL_PIXELFORMAT_RGB332 }, @@ -79,12 +77,19 @@ static const struct sdl_texture_format_entry { { AV_PIX_FMT_BGR565, SDL_PIXELFORMAT_BGR565 }, { AV_PIX_FMT_RGB24, SDL_PIXELFORMAT_RGB24 }, { AV_PIX_FMT_BGR24, SDL_PIXELFORMAT_BGR24 }, - { AV_PIX_FMT_RGB0, SDL_PIXELFORMAT_RGBX8888 }, // needs to be checked - { AV_PIX_FMT_BGR0, SDL_PIXELFORMAT_BGRX8888 }, // " - { AV_PIX_FMT_ARGB, SDL_PIXELFORMAT_ARGB8888 }, // " - { AV_PIX_FMT_RGBA, SDL_PIXELFORMAT_RGBA8888 }, - { AV_PIX_FMT_ABGR, SDL_PIXELFORMAT_ABGR8888 }, - { AV_PIX_FMT_BGRA, SDL_PIXELFORMAT_BGRA8888 }, + { AV_PIX_FMT_0RGB32, SDL_PIXELFORMAT_RGB888 }, + { AV_PIX_FMT_0BGR32, SDL_PIXELFORMAT_BGR888 }, +#if HAVE_BIGENDIAN + { AV_PIX_FMT_RGB0, SDL_PIXELFORMAT_RGBX8888 }, + { AV_PIX_FMT_BGR0, SDL_PIXELFORMAT_BGRX8888 }, +#else + { AV_PIX_FMT_0BGR, SDL_PIXELFORMAT_RGBX8888 }, + { AV_PIX_FMT_0RGB, SDL_PIXELFORMAT_BGRX8888 }, +#endif + { AV_PIX_FMT_RGB32, SDL_PIXELFORMAT_ARGB8888 }, + { AV_PIX_FMT_RGB32_1, SDL_PIXELFORMAT_RGBA8888 }, + { AV_PIX_FMT_BGR32, SDL_PIXELFORMAT_ABGR8888 }, + { AV_PIX_FMT_BGR32_1, SDL_PIXELFORMAT_BGRA8888 }, { AV_PIX_FMT_YUV420P, SDL_PIXELFORMAT_IYUV }, { AV_PIX_FMT_YUYV422, SDL_PIXELFORMAT_YUY2 }, { AV_PIX_FMT_UYVY422, SDL_PIXELFORMAT_UYVY }, |