~ubuntu-branches/ubuntu/precise/ffmpeg-debian/precise

« back to all changes in this revision

Viewing changes to libavdevice/x11grab.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-01-20 09:20:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120092053-izz63p40hc98qfgp
Tags: 3:0.svn20090119-1ubuntu1
* merge from debian. LP: #318501
* new version fixes CVE-2008-3230, LP: #253767

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
/**
56
56
 * X11 Device Demuxer context
57
57
 */
58
 
typedef struct x11_grab_s
 
58
struct x11_grab
59
59
{
60
60
    int frame_size;          /**< Size in bytes of a grabbed frame */
61
61
    AVRational time_base;    /**< Time base */
71
71
    int use_shm;             /**< !0 when using XShm extension */
72
72
    XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm infos */
73
73
    int mouse_warning_shown;
74
 
} x11_grab_t;
 
74
};
75
75
 
76
76
/**
77
77
 * Initializes the x11 grab device demuxer (public device demuxer API).
87
87
static int
88
88
x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
89
89
{
90
 
    x11_grab_t *x11grab = s1->priv_data;
 
90
    struct x11_grab *x11grab = s1->priv_data;
91
91
    Display *dpy;
92
92
    AVStream *st = NULL;
93
93
    int input_pixfmt;
259
259
    if (XQueryPointer(dpy, mrootwindow, &mrootwindow, &childwindow,
260
260
                      x, y, &dummy, &dummy, (unsigned int*)&dummy)) {
261
261
    } else {
262
 
        x11_grab_t *s = s1->priv_data;
 
262
        struct x11_grab *s = s1->priv_data;
263
263
        if (!s->mouse_warning_shown) {
264
264
            av_log(s1, AV_LOG_INFO, "couldn't find mouse pointer\n");
265
265
            s->mouse_warning_shown = 1;
306
306
 * @param y Mouse pointer coordinate
307
307
 */
308
308
static void
309
 
paint_mouse_pointer(XImage *image, x11_grab_t *s, int x, int y)
 
309
paint_mouse_pointer(XImage *image, struct x11_grab *s, int x, int y)
310
310
{
311
311
    /* 16x20x1bpp bitmap for the black channel of the mouse pointer */
312
312
    static const uint16_t const mousePointerBlack[] =
431
431
static int
432
432
x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
433
433
{
434
 
    x11_grab_t *s = s1->priv_data;
 
434
    struct x11_grab *s = s1->priv_data;
435
435
    Display *dpy = s->dpy;
436
436
    XImage *image = s->image;
437
437
    int x_off = s->x_off;
495
495
static int
496
496
x11grab_read_close(AVFormatContext *s1)
497
497
{
498
 
    x11_grab_t *x11grab = s1->priv_data;
 
498
    struct x11_grab *x11grab = s1->priv_data;
499
499
 
500
500
    /* Detach cleanly from shared mem */
501
501
    if (x11grab->use_shm) {
520
520
{
521
521
    "x11grab",
522
522
    NULL_IF_CONFIG_SMALL("X11grab"),
523
 
    sizeof(x11_grab_t),
 
523
    sizeof(struct x11_grab),
524
524
    NULL,
525
525
    x11grab_read_header,
526
526
    x11grab_read_packet,