x11grab.c File Reference


Detailed Description

X11 frame device demuxer by Clemens Fruhwirth <clemens@endorphin.org> and Edouard Gomez <ed.gomez@free.fr>.

Definition in file x11grab.c.

Go to the source code of this file.

Classes

struct  x11_grab_s
 X11 Device Demuxer context. More...

Typedefs

typedef struct x11_grab_s x11_grab_t

Functions

static int x11grab_read_header (AVFormatContext *s1, AVFormatParameters *ap)
 Initializes the x11 grab device demuxer (public device demuxer API).
static void get_pointer_coordinates (int *x, int *y, Display *dpy, AVFormatContext *s1)
 Get pointer coordinates from X11.
static void apply_masks (uint8_t *dst, int and, int or, int bits_per_pixel)
 Mouse painting helper function that applies an 'and' and 'or' mask pair to '*dst' pixel.
static void paint_mouse_pointer (XImage *image, x11_grab_t *s, int x, int y)
 Paints a mouse pointer in an X11 image.
static int xget_zpixmap (Display *dpy, Drawable d, XImage *image, int x, int y)
 Reads new data in the image structure.
static int x11grab_read_packet (AVFormatContext *s1, AVPacket *pkt)
 Grabs a frame from x11 (public device demuxer API).
static int x11grab_read_close (AVFormatContext *s1)
 Closes x11 frame grabber (public device demuxer API).

Variables

AVInputFormat x11_grab_device_demuxer
 x11 grabber device demuxer declaration


Typedef Documentation

typedef struct x11_grab_s x11_grab_t


Function Documentation

static int x11grab_read_header ( AVFormatContext s1,
AVFormatParameters ap 
) [static]

Initializes the x11 grab device demuxer (public device demuxer API).

Parameters:
s1 Context from avformat core
ap Parameters from avformat core
Returns:
  • AVERROR(ENOMEM) no memory left
  • AVERROR(EIO) other failure case
  • 0 success

Definition at line 88 of file x11grab.c.

static void get_pointer_coordinates ( int *  x,
int *  y,
Display *  dpy,
AVFormatContext s1 
) [static]

Get pointer coordinates from X11.

Parameters:
x Integer where horizontal coordinate will be returned
y Integer where vertical coordinate will be returned
dpy X11 display from where pointer coordinates are retrieved
s1 Context used for logging errors if necessary

Definition at line 252 of file x11grab.c.

Referenced by x11grab_read_packet().

static void apply_masks ( uint8_t *  dst,
int  and,
int  or,
int  bits_per_pixel 
) [inline, static]

Mouse painting helper function that applies an 'and' and 'or' mask pair to '*dst' pixel.

It actually draws a mouse pointer pixel to grabbed frame.

Parameters:
dst Destination pixel
and Part of the mask that must be applied using a bitwise 'and' operator
or Part of the mask that must be applied using a bitwise 'or' operator
bits_per_pixel Bits per pixel used in the grabbed image

Definition at line 284 of file x11grab.c.

Referenced by paint_mouse_pointer().

static void paint_mouse_pointer ( XImage *  image,
x11_grab_t s,
int  x,
int  y 
) [static]

Paints a mouse pointer in an X11 image.

Parameters:
image Image where to paint the mouse pointer
s context used to retrieve original grabbing rectangle coordinates
x Mouse pointer coordinate
y Mouse pointer coordinate

Definition at line 309 of file x11grab.c.

Referenced by x11grab_read_packet().

static int xget_zpixmap ( Display *  dpy,
Drawable  d,
XImage *  image,
int  x,
int  y 
) [static]

Reads new data in the image structure.

Parameters:
dpy X11 display to grab from
d 
image Image where the grab will be put
x Top-Left grabbing rectangle horizontal coordinate
y Top-Left grabbing rectangle vertical coordinate
Returns:
0 if error, !0 if successful

Definition at line 388 of file x11grab.c.

Referenced by x11grab_read_packet().

static int x11grab_read_packet ( AVFormatContext s1,
AVPacket pkt 
) [static]

Grabs a frame from x11 (public device demuxer API).

Parameters:
s1 Context from avformat core
pkt Packet holding the brabbed frame
Returns:
frame size in bytes

Definition at line 432 of file x11grab.c.

static int x11grab_read_close ( AVFormatContext s1  )  [static]

Closes x11 frame grabber (public device demuxer API).

Parameters:
s1 Context from avformat core
Returns:
0 success, !0 failure

Definition at line 496 of file x11grab.c.


Variable Documentation

Initial value:

{
    "x11grab",
    "X11grab",
    sizeof(x11_grab_t),
    NULL,
    x11grab_read_header,
    x11grab_read_packet,
    x11grab_read_close,
    .flags = AVFMT_NOFILE,
}
x11 grabber device demuxer declaration

Definition at line 519 of file x11grab.c.


Generated on Sat Dec 18 05:15:56 2010 for MythTV by  doxygen 1.5.5