[FFmpeg-cvslog] x11grab: replace undocumented nomouse hackery with a private option.

Anton Khirnov git at videolan.org
Sat Jul 9 02:09:51 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Jun 20 12:42:36 2011 +0200| [ce558c8f590610fc68596ef0b4ac2a9d299fbcb2] | committer: Anton Khirnov

x11grab: replace undocumented nomouse hackery with a private option.

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

 libavdevice/x11grab.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 62cb4f1..80507ab 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -70,7 +70,7 @@ struct x11_grab
     XImage *image;           /**< X11 image holding the grab */
     int use_shm;             /**< !0 when using XShm extension */
     XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */
-    int nomouse;
+    int  draw_mouse;         /**< Set by a private option. */
     char *framerate;         /**< Set by a private option. */
 };
 
@@ -104,7 +104,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
     offset = strchr(param, '+');
     if (offset) {
         sscanf(offset, "%d,%d", &x_off, &y_off);
-        x11grab->nomouse= strstr(offset, "nomouse");
+        x11grab->draw_mouse = !strstr(offset, "nomouse");
         *offset= 0;
     }
 
@@ -410,7 +410,7 @@ x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
         }
     }
 
-    if(!s->nomouse){
+    if (s->draw_mouse) {
         paint_mouse_pointer(image, s);
     }
 
@@ -451,6 +451,7 @@ x11grab_read_close(AVFormatContext *s1)
 static const AVOption options[] = {
     { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
     { "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
+    { "draw_mouse", "Draw the mouse pointer.", OFFSET(draw_mouse), FF_OPT_TYPE_INT, { 1 }, 0, 1, DEC },
     { NULL },
 };
 



More information about the ffmpeg-cvslog mailing list