[FFmpeg-trac] #1738(undetermined:new): x11grab BadCursor
FFmpeg
trac at avcodec.org
Fri Oct 12 15:19:52 CEST 2012
#1738: x11grab BadCursor
-------------------------------------+-------------------------------------
Reporter: idooley | Owner:
Type: defect | Status: new
Priority: normal | Component:
Version: git-master | undetermined
Keywords: x11grab | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by jensb):
I had to modify the above patch a bit, so it works with the ffmpeg version
0.8.3, that ships with Ubuntu 12.04.
I'll put it here, so it may be useful for others. Hope you do not mind.
{{{
--- libav-0.8.3.orig/libavdevice/x11grab.c
+++ libav-0.8.3/libavdevice/x11grab.c
@@ -43,6 +43,7 @@
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include <time.h>
+#include <X11/cursorfont.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
@@ -342,6 +343,7 @@ paint_mouse_pointer(XImage *image, struc
int x, y;
int line, column;
int to_line, to_column;
+ Cursor c; Window w; XSetWindowAttributes attr;
int pixstride = image->bits_per_pixel >> 3;
/* Warning: in its insanity, xlib provides unsigned image data
through a
* char* pointer, so we have to make it uint8_t to make things not
break.
@@ -353,6 +355,11 @@ paint_mouse_pointer(XImage *image, struc
if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
return;
+ c = XCreateFontCursor(dpy, XC_left_ptr);
+ w = DefaultRootWindow(dpy);
+ attr.cursor = c;
+ XChangeWindowAttributes(dpy, w, CWCursor, &attr);
+
xcim = XFixesGetCursorImage(dpy);
x = xcim->x - xcim->xhot;
}}}
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/1738#comment:1>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list