[FFmpeg-devel] [PATCH]Use pix_fmt 0RGB for x11grab

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Feb 2 00:29:11 CET 2012


Hi!

If nobody objects, I would prefer setting the pixel format correctly over 
adding a constant to each pixel.

Carl Eugen
-------------- next part --------------
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 722f00f..80a1baf 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -295,7 +295,7 @@ x11grab_read_header(AVFormatContext *s1)
         }
         break;
     case 32:
-        input_pixfmt = PIX_FMT_RGB32;
+        input_pixfmt = PIX_FMT_0RGB32;
         break;
     default:
         av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel);
@@ -539,8 +539,6 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
             av_log (s1, AV_LOG_INFO, "XGetZPixmap() failed\n");
         }
     }
-    if (image->bits_per_pixel == 32)
-        XAddPixel(image, 0xFF000000);
 
     if (s->draw_mouse) {
         paint_mouse_pointer(image, s);


More information about the ffmpeg-devel mailing list