summaryrefslogtreecommitdiffstats
path: root/libavdevice/x11grab.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavdevice/x11grab.c')
-rw-r--r--libavdevice/x11grab.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index bf3011b..80a1baf 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -1,9 +1,9 @@
/*
* X11 video grab interface
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav integration:
+ * FFmpeg integration:
* Copyright (C) 2006 Clemens Fruhwirth <clemens@endorphin.org>
* Edouard Gomez <ed.gomez@free.fr>
*
@@ -14,18 +14,18 @@
* Copyright (C) 1997-1998 Rasca, Berlin
* 2003-2004 Karl H. Beckers, Frankfurt
*
- * Libav is free software; you can redistribute it and/or modify
+ * FFmpeg is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with Libav; if not, write to the Free Software
+ * along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -37,7 +37,6 @@
*/
#include "config.h"
-#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
@@ -52,6 +51,7 @@
#include <X11/extensions/shape.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xfixes.h>
+#include "avdevice.h"
/**
* X11 Device Demuxer context
@@ -165,12 +165,12 @@ x11grab_read_header(AVFormatContext *s1)
int y_off = 0;
int screen;
int use_shm;
- char *param, *offset;
+ char *dpyname, *offset;
int ret = 0;
AVRational framerate;
- param = av_strdup(s1->filename);
- offset = strchr(param, '+');
+ dpyname = av_strdup(s1->filename);
+ offset = strchr(dpyname, '+');
if (offset) {
sscanf(offset, "%d,%d", &x_off, &y_off);
x11grab->draw_mouse = !strstr(offset, "nomouse");
@@ -186,9 +186,10 @@ x11grab_read_header(AVFormatContext *s1)
goto out;
}
av_log(s1, AV_LOG_INFO, "device: %s -> display: %s x: %d y: %d width: %d height: %d\n",
- s1->filename, param, x_off, y_off, x11grab->width, x11grab->height);
+ s1->filename, dpyname, x_off, y_off, x11grab->width, x11grab->height);
- dpy = XOpenDisplay(param);
+ dpy = XOpenDisplay(dpyname);
+ av_freep(&dpyname);
if(!dpy) {
av_log(s1, AV_LOG_ERROR, "Could not open X display.\n");
ret = AVERROR(EIO);
@@ -219,7 +220,7 @@ x11grab_read_header(AVFormatContext *s1)
}
use_shm = XShmQueryExtension(dpy);
- av_log(s1, AV_LOG_INFO, "shared memory extension %s found\n", use_shm ? "" : "not");
+ av_log(s1, AV_LOG_INFO, "shared memory extension%s found\n", use_shm ? "" : " not");
if(use_shm) {
int scr = XDefaultScreen(dpy);
@@ -294,7 +295,7 @@ x11grab_read_header(AVFormatContext *s1)
}
break;
case 32:
- input_pixfmt = PIX_FMT_RGB32;
+ input_pixfmt = PIX_FMT_0RGB32;
break;
default:
av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel);
OpenPOWER on IntegriCloud