[Ffmpeg-devel] [PATCH] Allow choosing display and screen number for x11grab device

Panagiotis Issaris takis.issaris
Thu Dec 14 22:32:55 CET 2006


On Thu, Dec 14, 2006 at 09:36:11PM +0100, Michael Niedermayer wrote:
> > > > +    if (offset) {
> > > > +        sscanf(offset, "%d,%d", &x_off, &y_off);
> > > > +        *offset = 0;
> > > 
> > > hmm that writes into ap->device, why?
> > To cut off the +xoffset,yoffset part to make it a valid X display name.  I was
> > not aware that ap->device would be reused or that it would be a problem for
> > other reasons, but I can surely change it to pass a copy of a part of the string
> > instead of a modified ("truncated") ap->device.
> i dont think its reused but changing it seems hackish ...
I agree. I was just a bit too enthuosiastic about the x11grabbing functionality
for creating screencasts :) And, I prefer to run a nested X server and grab all
of its contents, which is why I hastely wrote the patch =)

How about this updated version of the patch?

I was wondering how to do the checking for the memalloc failing only once, but
in the end, I figured that for the strdup case, I really did not need to check
it, as XOpenDisplay can take NULL as a parameter, meaning that it will open a
connection to the default display. It looks a bit bad though, which is why I
added the comment explaining this.

With friendly regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pi-20061214T222725-ffmpeg-x11grab_accept_displayname.diff
Type: text/x-diff
Size: 2510 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20061214/22128914/attachment.diff>

More information about the ffmpeg-devel mailing list