[FFmpeg-cvslog] lavd/sdl2: Fix 32bit rgb formats on little-endian hardware.

Carl Eugen Hoyos git at videolan.org
Sat Sep 24 19:58:26 EEST 2016


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sat Sep 24 18:56:40 2016 +0200| [159aa1275e5d9c94edc313a51d65220e887d790b] | committer: Carl Eugen Hoyos

lavd/sdl2: Fix 32bit rgb formats on little-endian hardware.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=159aa1275e5d9c94edc313a51d65220e887d790b
---

 libavdevice/sdl2.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index d083d29..e8252f0 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 },



More information about the ffmpeg-cvslog mailing list