diff options
Diffstat (limited to 'libavdevice/x11grab.c')
-rw-r--r-- | libavdevice/x11grab.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 7874b81..c2a67d7 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 */ @@ -36,7 +36,6 @@ */ #include "config.h" -#include "libavformat/avformat.h" #include "libavutil/log.h" #include "libavutil/opt.h" #include "libavutil/parseutils.h" @@ -50,6 +49,7 @@ #include <X11/extensions/shape.h> #include <X11/extensions/XShm.h> #include <X11/extensions/Xfixes.h> +#include "avdevice.h" /** * X11 Device Demuxer context @@ -163,12 +163,12 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) 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"); @@ -184,9 +184,10 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) 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); @@ -217,7 +218,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) } 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); |