[FFmpeg-cvslog] Merge commit '4fef648d10bf3bcfd4b8fa5755c1128966a2427c'
Clément Bœsch
git at videolan.org
Wed Mar 15 23:14:43 EET 2017
ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Wed Mar 15 22:07:47 2017 +0100| [4a9c5f6bc5a825f10b77f6ce084aa840d5c1d93e] | committer: Clément Bœsch
Merge commit '4fef648d10bf3bcfd4b8fa5755c1128966a2427c'
* commit '4fef648d10bf3bcfd4b8fa5755c1128966a2427c':
Remove the legacy X11 screen grabber
Merged-by: Clément Bœsch <u at pkh.me>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a9c5f6bc5a825f10b77f6ce084aa840d5c1d93e
---
Changelog | 2 +
LICENSE.md | 1 -
configure | 11 +-
libavdevice/Makefile | 1 -
libavdevice/alldevices.c | 1 -
libavdevice/avdevice.h | 2 +-
libavdevice/x11grab.c | 695 -----------------------------------------------
7 files changed, 4 insertions(+), 709 deletions(-)
diff --git a/Changelog b/Changelog
index b9d1a3c..ca6f404 100644
--- a/Changelog
+++ b/Changelog
@@ -28,6 +28,8 @@ version <next>:
- incomplete ClearVideo decoder
- Intel QSV video scaling and deinterlacing filters
- XPM decoder
+- Removed the legacy X11 screen grabber, use XCB instead
+
version 3.2:
- libopenmpt demuxer
diff --git a/LICENSE.md b/LICENSE.md
index 640633c..ba65b05 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -17,7 +17,6 @@ Specifically, the GPL parts of FFmpeg are:
- `libavcodec/x86/flac_dsp_gpl.asm`
- `libavcodec/x86/idct_mmx.c`
- `libavfilter/x86/vf_removegrain.asm`
-- the X11 grabber in `libavdevice/x11grab.c`
- the following building and testing tools
- `compat/solaris/make_sunver.pl`
- `doc/t2h.pm`
diff --git a/configure b/configure
index 68cc0c8..488e803 100755
--- a/configure
+++ b/configure
@@ -290,7 +290,6 @@ External library support:
--disable-sdl2 disable sdl2 [autodetect]
--disable-securetransport disable Secure Transport, needed for TLS support
on OSX if openssl and gnutls are not used [autodetect]
- --enable-x11grab enable X11 grabbing (legacy) [no]
--disable-xlib disable xlib [autodetect]
--disable-zlib disable zlib [autodetect]
@@ -1520,7 +1519,6 @@ EXTERNAL_LIBRARY_GPL_LIST="
libx265
libxavs
libxvid
- x11grab
"
EXTERNAL_LIBRARY_NONFREE_LIST="
@@ -3033,7 +3031,6 @@ v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
vfwcap_indev_extralibs="-lavicap32"
-x11grab_indev_deps="x11grab"
x11grab_xcb_indev_deps="libxcb"
xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
xv_outdev_extralibs="-lXv -lX11 -lXext"
@@ -6035,7 +6032,7 @@ enabled xlib &&
if ! disabled libxcb; then
check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
- } && disable x11grab && enable libxcb
+ } && enable libxcb
if enabled libxcb; then
disabled libxcb_shm || {
@@ -6058,12 +6055,6 @@ if enabled libxcb; then
fi
fi
-if enabled x11grab; then
- enabled xlib || die "ERROR: Xlib not found"
- require Xext X11/extensions/XShm.h XShmCreateImage -lXext
- require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
-fi
-
check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
enabled dxva2api_h &&
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index 256e140..90ebc95 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -47,7 +47,6 @@ OBJS-$(CONFIG_V4L2_INDEV) += v4l2.o v4l2-common.o timefilter.o
OBJS-$(CONFIG_V4L2_OUTDEV) += v4l2enc.o v4l2-common.o
OBJS-$(CONFIG_V4L_INDEV) += v4l.o
OBJS-$(CONFIG_VFWCAP_INDEV) += vfwcap.o
-OBJS-$(CONFIG_X11GRAB_INDEV) += x11grab.o
OBJS-$(CONFIG_X11GRAB_XCB_INDEV) += xcbgrab.o
OBJS-$(CONFIG_XV_OUTDEV) += xv.o
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 75f4ae0..f8f31ed 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -63,7 +63,6 @@ static void register_all(void)
REGISTER_INOUTDEV(V4L2, v4l2);
// REGISTER_INDEV (V4L, v4l
REGISTER_INDEV (VFWCAP, vfwcap);
- REGISTER_INDEV (X11GRAB, x11grab);
REGISTER_INDEV (X11GRAB_XCB, x11grab_xcb);
REGISTER_OUTDEV (XV, xv);
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index 84f374a..4315768 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -37,7 +37,7 @@
* (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
* I/O functions). The filename passed to avformat_open_input() often does not
* refer to an actually existing file, but has some special device-specific
- * meaning - e.g. for x11grab it is the display name.
+ * meaning - e.g. for x11grab_xcb it is the display name.
*
* To use libavdevice, simply call avdevice_register_all() to register all
* compiled muxers and demuxers. They all use standard libavformat API.
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
deleted file mode 100644
index 65b409f..0000000
--- a/libavdevice/x11grab.c
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * X11 video grab interface
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg integration:
- * Copyright (C) 2006 Clemens Fruhwirth <clemens at endorphin.org>
- * Edouard Gomez <ed.gomez at free.fr>
- *
- * This file contains code from grab.c:
- * Copyright (c) 2000-2001 Fabrice Bellard
- *
- * This file contains code from the xvidcap project:
- * Copyright (C) 1997-1998 Rasca, Berlin
- * 2003-2004 Karl H. Beckers, Frankfurt
- *
- * 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.
- *
- * 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 FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * X11 frame device demuxer
- * @author Clemens Fruhwirth <clemens at endorphin.org>
- * @author Edouard Gomez <ed.gomez at free.fr>
- */
-
-#include "config.h"
-
-#include <time.h>
-#include <sys/shm.h>
-
-#include <X11/cursorfont.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xlibint.h>
-#include <X11/Xproto.h>
-#include <X11/Xutil.h>
-
-#include <X11/extensions/shape.h>
-#include <X11/extensions/Xfixes.h>
-#include <X11/extensions/XShm.h>
-
-#include "libavutil/internal.h"
-#include "libavutil/log.h"
-#include "libavutil/opt.h"
-#include "libavutil/parseutils.h"
-#include "libavutil/time.h"
-
-#include "libavformat/internal.h"
-
-#include "avdevice.h"
-
-/** X11 device demuxer context */
-typedef struct X11GrabContext {
- const AVClass *class; /**< Class for private options. */
- int frame_size; /**< Size in bytes of a grabbed frame */
- AVRational time_base; /**< Time base */
- int64_t time_frame; /**< Current time */
-
- int width; /**< Width of the grab frame */
- int height; /**< Height of the grab frame */
- int x_off; /**< Horizontal top-left corner coordinate */
- int y_off; /**< Vertical top-left corner coordinate */
-
- Display *dpy; /**< X11 display from which x11grab grabs frames */
- XImage *image; /**< X11 image holding the grab */
- int use_shm; /**< !0 when using XShm extension */
- XShmSegmentInfo shminfo; /**< When using XShm, keeps track of XShm info */
- int draw_mouse; /**< Set by a private option. */
- int follow_mouse; /**< Set by a private option. */
- int show_region; /**< set by a private option. */
- AVRational framerate; /**< Set by a private option. */
- int palette_changed;
- uint32_t palette[256];
-
- Cursor c;
- Window region_win; /**< This is used by show_region option. */
-} X11GrabContext;
-
-#define REGION_WIN_BORDER 3
-
-/**
- * Draw grabbing region window
- *
- * @param s x11grab context
- */
-static void x11grab_draw_region_win(X11GrabContext *s)
-{
- Display *dpy = s->dpy;
- Window win = s->region_win;
- int screen = DefaultScreen(dpy);
- GC gc = XCreateGC(dpy, win, 0, 0);
-
- XSetForeground(dpy, gc, WhitePixel(dpy, screen));
- XSetBackground(dpy, gc, BlackPixel(dpy, screen));
- XSetLineAttributes(dpy, gc, REGION_WIN_BORDER, LineDoubleDash, 0, 0);
- XDrawRectangle(dpy, win, gc, 1, 1,
- (s->width + REGION_WIN_BORDER * 2) - 1 * 2 - 1,
- (s->height + REGION_WIN_BORDER * 2) - 1 * 2 - 1);
- XFreeGC(dpy, gc);
-}
-
-/**
- * Initialize grabbing region window
- *
- * @param s x11grab context
- */
-static void x11grab_region_win_init(X11GrabContext *s)
-{
- Display *dpy = s->dpy;
- XRectangle rect;
- XSetWindowAttributes attribs = { .override_redirect = True };
- int screen = DefaultScreen(dpy);
-
- s->region_win = XCreateWindow(dpy, RootWindow(dpy, screen),
- s->x_off - REGION_WIN_BORDER,
- s->y_off - REGION_WIN_BORDER,
- s->width + REGION_WIN_BORDER * 2,
- s->height + REGION_WIN_BORDER * 2,
- 0, CopyFromParent,
- InputOutput, CopyFromParent,
- CWOverrideRedirect, &attribs);
- rect.x = 0;
- rect.y = 0;
- rect.width = s->width;
- rect.height = s->height;
- XShapeCombineRectangles(dpy, s->region_win,
- ShapeBounding, REGION_WIN_BORDER, REGION_WIN_BORDER,
- &rect, 1, ShapeSubtract, 0);
- XMapWindow(dpy, s->region_win);
- XSelectInput(dpy, s->region_win, ExposureMask | StructureNotifyMask);
- x11grab_draw_region_win(s);
-}
-
-static int setup_shm(AVFormatContext *s, Display *dpy, XImage **image)
-{
- X11GrabContext *g = s->priv_data;
- int scr = XDefaultScreen(dpy);
- XImage *img = XShmCreateImage(dpy, DefaultVisual(dpy, scr),
- DefaultDepth(dpy, scr), ZPixmap, NULL,
- &g->shminfo, g->width, g->height);
-
- g->shminfo.shmid = shmget(IPC_PRIVATE, img->bytes_per_line * img->height,
- IPC_CREAT | 0777);
-
- if (g->shminfo.shmid == -1) {
- av_log(s, AV_LOG_ERROR, "Cannot get shared memory!\n");
- return AVERROR(ENOMEM);
- }
-
- g->shminfo.shmaddr = img->data = shmat(g->shminfo.shmid, 0, 0);
- g->shminfo.readOnly = False;
-
- if (!XShmAttach(dpy, &g->shminfo)) {
- av_log(s, AV_LOG_ERROR, "Failed to attach shared memory!\n");
- /* needs some better error subroutine :) */
- return AVERROR(EIO);
- }
-
- *image = img;
- return 0;
-}
-
-static int setup_mouse(Display *dpy, int screen)
-{
- int ev_ret, ev_err;
-
- if (XFixesQueryExtension(dpy, &ev_ret, &ev_err)) {
- Window root = RootWindow(dpy, screen);
- XFixesSelectCursorInput(dpy, root, XFixesDisplayCursorNotifyMask);
- return 0;
- }
-
- return AVERROR(ENOSYS);
-}
-
-static int pixfmt_from_image(AVFormatContext *s, XImage *image, int *pix_fmt)
-{
- av_log(s, AV_LOG_DEBUG,
- "Image r 0x%.6lx g 0x%.6lx b 0x%.6lx and depth %i\n",
- image->red_mask,
- image->green_mask,
- image->blue_mask,
- image->bits_per_pixel);
-
- *pix_fmt = AV_PIX_FMT_NONE;
-
- switch (image->bits_per_pixel) {
- case 8:
- *pix_fmt = AV_PIX_FMT_PAL8;
- break;
- case 16:
- if (image->red_mask == 0xf800 &&
- image->green_mask == 0x07e0 &&
- image->blue_mask == 0x001f) {
- *pix_fmt = AV_PIX_FMT_RGB565;
- } else if (image->red_mask == 0x7c00 &&
- image->green_mask == 0x03e0 &&
- image->blue_mask == 0x001f) {
- *pix_fmt = AV_PIX_FMT_RGB555;
- }
- break;
- case 24:
- if (image->red_mask == 0xff0000 &&
- image->green_mask == 0x00ff00 &&
- image->blue_mask == 0x0000ff) {
- *pix_fmt = AV_PIX_FMT_BGR24;
- } else if (image->red_mask == 0x0000ff &&
- image->green_mask == 0x00ff00 &&
- image->blue_mask == 0xff0000) {
- *pix_fmt = AV_PIX_FMT_RGB24;
- }
- break;
- case 32:
- if (image->red_mask == 0xff0000 &&
- image->green_mask == 0x00ff00 &&
- image->blue_mask == 0x0000ff ) {
- *pix_fmt = AV_PIX_FMT_0RGB32;
- }
- break;
- }
- if (*pix_fmt == AV_PIX_FMT_NONE) {
- av_log(s, AV_LOG_ERROR,
- "XImages with RGB mask 0x%.6lx 0x%.6lx 0x%.6lx and depth %i "
- "are currently not supported.\n",
- image->red_mask,
- image->green_mask,
- image->blue_mask,
- image->bits_per_pixel);
-
- return AVERROR_PATCHWELCOME;
- }
-
- return 0;
-}
-
-/**
- * Initialize the x11 grab device demuxer (public device demuxer API).
- *
- * @param s1 Context from avformat core
- * @return <ul>
- * <li>AVERROR(ENOMEM) no memory left</li>
- * <li>AVERROR(EIO) other failure case</li>
- * <li>0 success</li>
- * </ul>
- */
-static int x11grab_read_header(AVFormatContext *s1)
-{
- X11GrabContext *x11grab = s1->priv_data;
- Display *dpy;
- AVStream *st = NULL;
- XImage *image;
- int x_off = 0, y_off = 0, ret = 0, screen, use_shm = 0;
- char *dpyname, *offset;
- Colormap color_map;
- XColor color[256];
- int i;
-
- dpyname = av_strdup(s1->filename);
- if (!dpyname)
- goto out;
-
- offset = strchr(dpyname, '+');
- if (offset) {
- sscanf(offset, "%d,%d", &x_off, &y_off);
- if (strstr(offset, "nomouse")) {
- av_log(s1, AV_LOG_WARNING,
- "'nomouse' specification in argument is deprecated: "
- "use 'draw_mouse' option with value 0 instead\n");
- x11grab->draw_mouse = 0;
- }
- *offset = 0;
- }
-
- av_log(s1, AV_LOG_INFO,
- "device: %s -> display: %s x: %d y: %d width: %d height: %d\n",
- s1->filename, dpyname, x_off, y_off, x11grab->width, x11grab->height);
-
- dpy = XOpenDisplay(dpyname);
- av_freep(&dpyname);
- if (!dpy) {
- av_log(s1, AV_LOG_ERROR, "Could not open X display.\n");
- ret = AVERROR(EIO);
- goto out;
- }
-
- st = avformat_new_stream(s1, NULL);
- if (!st) {
- ret = AVERROR(ENOMEM);
- goto out;
- }
- avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
-
- screen = DefaultScreen(dpy);
-
- if (x11grab->follow_mouse) {
- int screen_w, screen_h;
- Window w;
-
- screen_w = DisplayWidth(dpy, screen);
- screen_h = DisplayHeight(dpy, screen);
- XQueryPointer(dpy, RootWindow(dpy, screen), &w, &w, &x_off, &y_off,
- &ret, &ret, &ret);
- x_off -= x11grab->width / 2;
- y_off -= x11grab->height / 2;
- x_off = av_clip(x_off, 0, screen_w - x11grab->width);
- y_off = av_clip(y_off, 0, screen_h - x11grab->height);
- av_log(s1, AV_LOG_INFO,
- "followmouse is enabled, resetting grabbing region to x: %d y: %d\n",
- x_off, y_off);
- }
-
- if (x11grab->use_shm) {
- use_shm = XShmQueryExtension(dpy);
- av_log(s1, AV_LOG_INFO,
- "shared memory extension %sfound\n", use_shm ? "" : "not ");
- }
-
- if (use_shm && setup_shm(s1, dpy, &image) < 0) {
- av_log(s1, AV_LOG_WARNING, "Falling back to XGetImage\n");
- use_shm = 0;
- }
-
- if (!use_shm) {
- image = XGetImage(dpy, RootWindow(dpy, screen),
- x_off, y_off,
- x11grab->width, x11grab->height,
- AllPlanes, ZPixmap);
- }
-
- if (x11grab->draw_mouse && setup_mouse(dpy, screen) < 0) {
- av_log(s1, AV_LOG_WARNING,
- "XFixes not available, cannot draw the mouse cursor\n");
- x11grab->draw_mouse = 0;
- }
-
- x11grab->frame_size = x11grab->width * x11grab->height * image->bits_per_pixel / 8;
- x11grab->dpy = dpy;
- x11grab->time_base = av_inv_q(x11grab->framerate);
- x11grab->time_frame = av_gettime() / av_q2d(x11grab->time_base);
- x11grab->x_off = x_off;
- x11grab->y_off = y_off;
- x11grab->image = image;
- x11grab->use_shm = use_shm;
-
- ret = pixfmt_from_image(s1, image, &st->codecpar->format);
- if (ret < 0)
- goto out;
-
- if (st->codecpar->format == AV_PIX_FMT_PAL8) {
- color_map = DefaultColormap(dpy, screen);
- for (i = 0; i < 256; ++i)
- color[i].pixel = i;
- XQueryColors(dpy, color_map, color, 256);
- for (i = 0; i < 256; ++i)
- x11grab->palette[i] = (color[i].red & 0xFF00) << 8 |
- (color[i].green & 0xFF00) |
- (color[i].blue & 0xFF00) >> 8;
- x11grab->palette_changed = 1;
- }
-
-
- st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO;
- st->codecpar->width = x11grab->width;
- st->codecpar->height = x11grab->height;
- st->codecpar->bit_rate = x11grab->frame_size * 1 / av_q2d(x11grab->time_base) * 8;
-
- st->avg_frame_rate = av_inv_q(x11grab->time_base);
-
-out:
- av_free(dpyname);
- return ret;
-}
-
-/**
- * Paint a mouse pointer in an X11 image.
- *
- * @param image image to paint the mouse pointer to
- * @param s context used to retrieve original grabbing rectangle
- * coordinates
- */
-static void paint_mouse_pointer(XImage *image, AVFormatContext *s1)
-{
- X11GrabContext *s = s1->priv_data;
- int x_off = s->x_off;
- int y_off = s->y_off;
- int width = s->width;
- int height = s->height;
- Display *dpy = s->dpy;
- XFixesCursorImage *xcim;
- int x, y;
- int line, column;
- int to_line, to_column;
- int pixstride = image->bits_per_pixel >> 3;
- /* Warning: in its insanity, xlib provides unsigned image data through a
- * char* pointer, so we have to make it uint8_t to make things not break.
- * Anyone who performs further investigation of the xlib API likely risks
- * permanent brain damage. */
- uint8_t *pix = image->data;
- Window root;
- XSetWindowAttributes attr;
-
- /* Code doesn't currently support 16-bit or PAL8 */
- if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
- return;
-
- if (!s->c)
- s->c = XCreateFontCursor(dpy, XC_left_ptr);
- root = DefaultRootWindow(dpy);
- attr.cursor = s->c;
- XChangeWindowAttributes(dpy, root, CWCursor, &attr);
-
- xcim = XFixesGetCursorImage(dpy);
- if (!xcim) {
- av_log(s1, AV_LOG_WARNING,
- "XFixesGetCursorImage failed\n");
- return;
- }
-
- x = xcim->x - xcim->xhot;
- y = xcim->y - xcim->yhot;
-
- to_line = FFMIN((y + xcim->height), (height + y_off));
- to_column = FFMIN((x + xcim->width), (width + x_off));
-
- for (line = FFMAX(y, y_off); line < to_line; line++) {
- for (column = FFMAX(x, x_off); column < to_column; column++) {
- int xcim_addr = (line - y) * xcim->width + column - x;
- int image_addr = ((line - y_off) * width + column - x_off) * pixstride;
- int r = (uint8_t)(xcim->pixels[xcim_addr] >> 0);
- int g = (uint8_t)(xcim->pixels[xcim_addr] >> 8);
- int b = (uint8_t)(xcim->pixels[xcim_addr] >> 16);
- int a = (uint8_t)(xcim->pixels[xcim_addr] >> 24);
-
- if (a == 255) {
- pix[image_addr + 0] = r;
- pix[image_addr + 1] = g;
- pix[image_addr + 2] = b;
- } else if (a) {
- /* pixel values from XFixesGetCursorImage come premultiplied by alpha */
- pix[image_addr + 0] = r + (pix[image_addr + 0] * (255 - a) + 255 / 2) / 255;
- pix[image_addr + 1] = g + (pix[image_addr + 1] * (255 - a) + 255 / 2) / 255;
- pix[image_addr + 2] = b + (pix[image_addr + 2] * (255 - a) + 255 / 2) / 255;
- }
- }
- }
-
- XFree(xcim);
- xcim = NULL;
-}
-
-/**
- * Read new data in the image structure.
- *
- * @param dpy X11 display to grab from
- * @param d
- * @param image Image where the grab will be put
- * @param x Top-Left grabbing rectangle horizontal coordinate
- * @param y Top-Left grabbing rectangle vertical coordinate
- * @return 0 if error, !0 if successful
- */
-static int xget_zpixmap(Display *dpy, Drawable d, XImage *image, int x, int y)
-{
- xGetImageReply rep;
- xGetImageReq *req;
- long nbytes;
-
- if (!image)
- return 0;
-
- LockDisplay(dpy);
- GetReq(GetImage, req);
-
- /* First set up the standard stuff in the request */
- req->drawable = d;
- req->x = x;
- req->y = y;
- req->width = image->width;
- req->height = image->height;
- req->planeMask = (unsigned int)AllPlanes;
- req->format = ZPixmap;
-
- if (!_XReply(dpy, (xReply *)&rep, 0, xFalse) || !rep.length) {
- UnlockDisplay(dpy);
- SyncHandle();
- return 0;
- }
-
- nbytes = (long)rep.length << 2;
- _XReadPad(dpy, image->data, nbytes);
-
- UnlockDisplay(dpy);
- SyncHandle();
- return 1;
-}
-
-/**
- * Grab a frame from x11 (public device demuxer API).
- *
- * @param s1 Context from avformat core
- * @param pkt Packet holding the brabbed frame
- * @return frame size in bytes
- */
-static int x11grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
-{
- X11GrabContext *s = s1->priv_data;
- Display *dpy = s->dpy;
- XImage *image = s->image;
- int x_off = s->x_off;
- int y_off = s->y_off;
- int follow_mouse = s->follow_mouse;
- int screen, pointer_x, pointer_y, _, same_screen = 1;
- Window w, root;
- int64_t curtime, delay;
- struct timespec ts;
-
- /* wait based on the frame rate */
- for (;;) {
- curtime = av_gettime();
- delay = s->time_frame * av_q2d(s->time_base) - curtime;
- if (delay <= 0) {
- break;
- }
- ts.tv_sec = delay / 1000000;
- ts.tv_nsec = (delay % 1000000) * 1000;
- nanosleep(&ts, NULL);
- }
-
- /* Calculate the time of the next frame */
- do {
- s->time_frame += INT64_C(1000000);
- } while ((s->time_frame * av_q2d(s->time_base) - curtime) <= 0);
-
- pkt->data = image->data;
- pkt->size = s->frame_size;
- pkt->pts = curtime;
- if (s->palette_changed) {
- uint8_t *pal = av_packet_new_side_data(pkt, AV_PKT_DATA_PALETTE,
- AVPALETTE_SIZE);
- if (!pal) {
- av_log(s, AV_LOG_ERROR, "Cannot append palette to packet\n");
- } else {
- memcpy(pal, s->palette, AVPALETTE_SIZE);
- s->palette_changed = 0;
- }
- }
-
- screen = DefaultScreen(dpy);
- root = RootWindow(dpy, screen);
-
- if (follow_mouse || s->draw_mouse)
- same_screen = XQueryPointer(dpy, root, &w, &w,
- &pointer_x, &pointer_y, &_, &_, &_);
-
- if (follow_mouse && same_screen) {
- int screen_w, screen_h;
-
- screen_w = DisplayWidth(dpy, screen);
- screen_h = DisplayHeight(dpy, screen);
- if (follow_mouse == -1) {
- // follow the mouse, put it at center of grabbing region
- x_off += pointer_x - s->width / 2 - x_off;
- y_off += pointer_y - s->height / 2 - y_off;
- } else {
- // follow the mouse, but only move the grabbing region when mouse
- // reaches within certain pixels to the edge.
- if (pointer_x > x_off + s->width - follow_mouse)
- x_off += pointer_x - (x_off + s->width - follow_mouse);
- else if (pointer_x < x_off + follow_mouse)
- x_off -= (x_off + follow_mouse) - pointer_x;
- if (pointer_y > y_off + s->height - follow_mouse)
- y_off += pointer_y - (y_off + s->height - follow_mouse);
- else if (pointer_y < y_off + follow_mouse)
- y_off -= (y_off + follow_mouse) - pointer_y;
- }
- // adjust grabbing region position if it goes out of screen.
- s->x_off = x_off = av_clip(x_off, 0, screen_w - s->width);
- s->y_off = y_off = av_clip(y_off, 0, screen_h - s->height);
-
- if (s->show_region && s->region_win)
- XMoveWindow(dpy, s->region_win,
- s->x_off - REGION_WIN_BORDER,
- s->y_off - REGION_WIN_BORDER);
- }
-
- if (s->show_region && same_screen) {
- if (s->region_win) {
- XEvent evt = { .type = NoEventMask };
- // Clean up the events, and do the initial draw or redraw.
- while (XCheckMaskEvent(dpy, ExposureMask | StructureNotifyMask,
- &evt))
- ;
- if (evt.type)
- x11grab_draw_region_win(s);
- } else {
- x11grab_region_win_init(s);
- }
- }
-
- if (s->use_shm) {
- if (!XShmGetImage(dpy, root, image, x_off, y_off, AllPlanes))
- av_log(s1, AV_LOG_INFO, "XShmGetImage() failed\n");
- } else {
- if (!xget_zpixmap(dpy, root, image, x_off, y_off))
- av_log(s1, AV_LOG_INFO, "XGetZPixmap() failed\n");
- }
-
- if (s->draw_mouse && same_screen)
- paint_mouse_pointer(image, s1);
-
- return s->frame_size;
-}
-
-/**
- * Close x11 frame grabber (public device demuxer API).
- *
- * @param s1 Context from avformat core
- * @return 0 success, !0 failure
- */
-static int x11grab_read_close(AVFormatContext *s1)
-{
- X11GrabContext *x11grab = s1->priv_data;
-
- /* Detach cleanly from shared mem */
- if (x11grab->use_shm) {
- XShmDetach(x11grab->dpy, &x11grab->shminfo);
- shmdt(x11grab->shminfo.shmaddr);
- shmctl(x11grab->shminfo.shmid, IPC_RMID, NULL);
- }
-
- /* Destroy X11 image */
- if (x11grab->image) {
- XDestroyImage(x11grab->image);
- x11grab->image = NULL;
- }
-
- if (x11grab->region_win)
- XDestroyWindow(x11grab->dpy, x11grab->region_win);
-
- /* Free X11 display */
- XCloseDisplay(x11grab->dpy);
- return 0;
-}
-
-#define OFFSET(x) offsetof(X11GrabContext, x)
-#define DEC AV_OPT_FLAG_DECODING_PARAM
-static const AVOption options[] = {
- { "grab_x", "Initial x coordinate.", OFFSET(x_off), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, DEC },
- { "grab_y", "Initial y coordinate.", OFFSET(y_off), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, DEC },
- { "draw_mouse", "draw the mouse pointer", OFFSET(draw_mouse), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC },
-
- { "follow_mouse", "move the grabbing region when the mouse pointer reaches within specified amount of pixels to the edge of region",
- OFFSET(follow_mouse), AV_OPT_TYPE_INT, {.i64 = 0}, -1, INT_MAX, DEC, "follow_mouse" },
- { "centered", "keep the mouse pointer at the center of grabbing region when following",
- 0, AV_OPT_TYPE_CONST, {.i64 = -1}, INT_MIN, INT_MAX, DEC, "follow_mouse" },
-
- { "framerate", "set video frame rate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, INT_MAX, DEC },
- { "show_region", "show the grabbing region", OFFSET(show_region), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC },
- { "video_size", "set video frame size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = "vga"}, 0, 0, DEC },
- { "use_shm", "use MIT-SHM extension", OFFSET(use_shm), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, DEC },
- { NULL },
-};
-
-static const AVClass x11_class = {
- .class_name = "X11grab indev",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
- .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT,
-};
-
-/** x11 grabber device demuxer declaration */
-AVInputFormat ff_x11grab_demuxer = {
- .name = "x11grab",
- .long_name = NULL_IF_CONFIG_SMALL("X11grab"),
- .priv_data_size = sizeof(X11GrabContext),
- .read_header = x11grab_read_header,
- .read_packet = x11grab_read_packet,
- .read_close = x11grab_read_close,
- .flags = AVFMT_NOFILE,
- .priv_class = &x11_class,
-};
======================================================================
diff --cc Changelog
index b9d1a3c,0d04f47..ca6f404
--- a/Changelog
+++ b/Changelog
@@@ -2,286 -2,17 +2,288 @@@ Entries are sorted chronologically fro
releases are sorted from youngest to oldest.
version <next>:
-- aliases and defaults for Ogg subtypes (opus, spx)
-- HEVC/H.265 RTP payload format (draft v6) packetizer and depacketizer
-- avplay now exits by default at the end of playback
-- XCB-based screen-grabber
-- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
-- H.261 RTP payload format (RFC 4587) depacketizer and experimental packetizer
+- CrystalHD decoder moved to new decode API
+- add internal ebur128 library, remove external libebur128 dependency
+- Pro-MPEG CoP #3-R2 FEC protocol
+- premultiply video filter
+- Support for spherical videos
+- configure now fails if autodetect-libraries are requested but not found
+- PSD Decoder
+- 16.8 floating point pcm decoder
+- 24.0 floating point pcm decoder
+- Apple Pixlet decoder
+- QDMC audio decoder
+- NewTek SpeedHQ decoder
+- MIDI Sample Dump Standard demuxer
+- readeia608 filter
+- Sample Dump eXchange demuxer
+- abitscope multimedia filter
+- Scenarist Closed Captions demuxer and muxer
+- threshold filter
+- midequalizer filter
+- Optimal Huffman tables for (M)JPEG encoding
+- FM Screen Capture Codec decoder
+- native Opus encoder
+- ScreenPressor decoder
+- incomplete ClearVideo decoder
+- Intel QSV video scaling and deinterlacing filters
+- XPM decoder
++- Removed the legacy X11 screen grabber, use XCB instead
++
+
+version 3.2:
+- libopenmpt demuxer
+- tee protocol
+- Changed metadata print option to accept general urls
+- Alias muxer for Ogg Video (.ogv)
+- VP8 in Ogg muxing
+- curves filter doesn't automatically insert points at x=0 and x=1 anymore
+- 16-bit support in curves filter and selectivecolor filter
+- OpenH264 decoder wrapper
+- MediaCodec H.264/HEVC/MPEG-4/VP8/VP9 hwaccel
+- True Audio (TTA) muxer
+- crystalizer audio filter
+- acrusher audio filter
+- bitplanenoise video filter
+- floating point support in als decoder
+- fifo muxer
+- maskedclamp filter
+- hysteresis filter
+- lut2 filter
+- yuvtestsrc filter
+- CUDA CUVID H.263/VP8/VP9/10 bit HEVC (Dithered) Decoding
+- vaguedenoiser filter
+- added threads option per filter instance
+- weave filter
+- gblur filter
+- avgblur filter
+- sobel and prewitt filter
+- MediaCodec HEVC/MPEG-4/VP8/VP9 decoding
+- Meridian Lossless Packing (MLP) / TrueHD encoder
+- Non-Local Means (nlmeans) denoising filter
+- sdl2 output device and ffplay support
+- sdl1 output device and sdl1 support removed
+- extended mov edit list support
+- libfaac encoder removed
+- Matroska muxer now writes CRC32 elements by default in all Level 1 elements
+- sidedata video and asidedata audio filter
+- Changed mapping of rtp MIME type G726 to codec g726le.
+- spec compliant VAAPI/DXVA2 VC-1 decoding of slices in frame-coded images
+
+
+version 3.1:
+- DXVA2-accelerated HEVC Main10 decoding
+- fieldhint filter
+- loop video filter and aloop audio filter
+- Bob Weaver deinterlacing filter
+- firequalizer filter
+- datascope filter
+- bench and abench filters
+- ciescope filter
+- protocol blacklisting API
+- MediaCodec H264 decoding
+- VC-2 HQ RTP payload format (draft v1) depacketizer and packetizer
+- VP9 RTP payload format (draft v2) packetizer
+- AudioToolbox audio decoders
+- AudioToolbox audio encoders
+- coreimage filter (GPU based image filtering on OSX)
+- libdcadec removed
+- bitstream filter for extracting DTS core
+- ADPCM IMA DAT4 decoder
+- musx demuxer
+- aix demuxer
+- remap filter
+- hash and framehash muxers
+- colorspace filter
+- hdcd filter
+- readvitc filter
+- VAAPI-accelerated format conversion and scaling
+- libnpp/CUDA-accelerated format conversion and scaling
+- Duck TrueMotion 2.0 Real Time decoder
+- Wideband Single-bit Data (WSD) demuxer
+- VAAPI-accelerated H.264/HEVC/MJPEG encoding
+- DTS Express (LBR) decoder
+- Generic OpenMAX IL encoder with support for Raspberry Pi
+- IFF ANIM demuxer & decoder
+- Direct Stream Transfer (DST) decoder
+- loudnorm filter
+- MTAF demuxer and decoder
+- MagicYUV decoder
+- OpenExr improvements (tile data and B44/B44A support)
+- BitJazz SheerVideo decoder
+- CUDA CUVID H264/HEVC decoder
+- 10-bit depth support in native utvideo decoder
+- libutvideo wrapper removed
+- YUY2 Lossless Codec decoder
+- VideoToolbox H.264 encoder
+- VAAPI-accelerated MPEG-2 and VP8 encoding
+
+
+version 3.0:
+- Common Encryption (CENC) MP4 encoding and decoding support
+- DXV decoding
+- extrastereo filter
+- ocr filter
+- alimiter filter
+- stereowiden filter
+- stereotools filter
+- rubberband filter
+- tremolo filter
+- agate filter
+- chromakey filter
+- maskedmerge filter
+- Screenpresso SPV1 decoding
+- chromaprint fingerprinting muxer
+- ffplay dynamic volume control
+- displace filter
+- selectivecolor filter
+- extensive native AAC encoder improvements and removal of experimental flag
+- ADPCM PSX decoder
+- 3dostr, dcstr, fsb, genh, vag, xvag, ads, msf, svag & vpk demuxer
+- zscale filter
+- wve demuxer
+- zero-copy Intel QSV transcoding in ffmpeg
+- shuffleframes filter
+- SDX2 DPCM decoder
+- vibrato filter
+- innoHeim/Rsupport Screen Capture Codec decoder
+- ADPCM AICA decoder
+- Interplay ACM demuxer and audio decoder
+- XMA1 & XMA2 decoder
+- realtime filter
+- anoisesrc audio filter source
+- IVR demuxer
+- compensationdelay filter
+- acompressor filter
+- support encoding 16-bit RLE SGI images
+- apulsator filter
+- sidechaingate audio filter
+- mipsdspr1 option has been renamed to mipsdsp
+- aemphasis filter
+- mips32r5 option has been removed
+- mips64r6 option has been removed
+- DXVA2-accelerated VP9 decoding
+- SOFAlizer: virtual binaural acoustics filter
+- VAAPI VP9 hwaccel
+- audio high-order multiband parametric equalizer
+- automatic bitstream filtering
+- showspectrumpic filter
+- libstagefright support removed
+- spectrumsynth filter
+- ahistogram filter
+- only seek with the right mouse button in ffplay
+- toggle full screen when double-clicking with the left mouse button in ffplay
+- afftfilt filter
+- convolution filter
+- libquvi support removed
+- support for dvaudio in wav and avi
+- libaacplus and libvo-aacenc support removed
+- Cineform HD decoder
+- new DCA decoder with full support for DTS-HD extensions
+- significant performance improvements in Windows Television (WTV) demuxer
+- nnedi deinterlacer
+- streamselect video and astreamselect audio filter
+- swaprect filter
+- metadata video and ametadata audio filter
+- SMPTE VC-2 HQ profile support for the Dirac decoder
+- SMPTE VC-2 native encoder supporting the HQ profile
+
+
+version 2.8:
+- colorkey video filter
+- BFSTM/BCSTM demuxer
+- little-endian ADPCM_THP decoder
+- Hap decoder and encoder
+- DirectDraw Surface image/texture decoder
+- ssim filter
+- optional new ASF demuxer
+- showvolume filter
+- Many improvements to the JPEG 2000 decoder
+- Go2Meeting decoding support
+- adrawgraph audio and drawgraph video filter
+- removegrain video filter
+- Intel QSV-accelerated MPEG-2 video and HEVC encoding
+- Intel QSV-accelerated MPEG-2 video and HEVC decoding
+- Intel QSV-accelerated VC-1 video decoding
+- libkvazaar HEVC encoder
+- erosion, dilation, deflate and inflate video filters
+- Dynamic Audio Normalizer as dynaudnorm filter
+- Reverse video and areverse audio filter
+- Random filter
+- deband filter
+- AAC fixed-point decoding
+- sidechaincompress audio filter
+- bitstream filter for converting HEVC from MP4 to Annex B
+- acrossfade audio filter
+- allyuv and allrgb video sources
+- atadenoise video filter
+- OS X VideoToolbox support
+- aphasemeter filter
+- showfreqs filter
+- vectorscope filter
+- waveform filter
+- hstack and vstack filter
+- Support DNx100 (1440x1080 at 8)
+- VAAPI hevc hwaccel
+- VDPAU hevc hwaccel
+- framerate filter
+- Switched default encoders for webm to VP9 and Opus
+- Removed experimental flag from the JPEG 2000 encoder
+
+
+version 2.7:
+- FFT video filter
+- TDSC decoder
+- DTS lossless extension (XLL) decoding (not lossless, disabled by default)
+- showwavespic filter
+- DTS decoding through libdcadec
+- Drop support for nvenc API before 5.0
+- nvenc HEVC encoder
+- Detelecine filter
+- Intel QSV-accelerated H.264 encoding
+- MMAL-accelerated H.264 decoding
+- basic APNG encoder and muxer with default extension "apng"
+- unpack DivX-style packed B-frames in MPEG-4 bitstream filter
+- WebM Live Chunk Muxer
+- nvenc level and tier options
+- chorus filter
+- Canopus HQ/HQA decoder
+- Automatically rotate videos based on metadata in ffmpeg
+- improved Quickdraw compatibility
+- VP9 high bit-depth and extended colorspaces decoding support
+- WebPAnimEncoder API when available for encoding and muxing WebP
+- Direct3D11-accelerated decoding
+- Support Secure Transport
+- Multipart JPEG demuxer
+
+
+version 2.6:
+- nvenc encoder
+- 10bit spp filter
+- colorlevels filter
+- RIFX format for *.wav files
- RTP/mpegts muxer
-- VP8 in Ogg demuxing
+- non continuous cache protocol support
+- tblend filter
+- cropdetect support for non 8bpp, absolute (if limit >= 1) and relative (if limit < 1.0) threshold
+- Camellia symmetric block cipher
- OpenH264 encoder wrapper
+- VOC seeking support
+- Closed caption Decoder
+- fspp, uspp, pp7 MPlayer postprocessing filters ported to native filters
+- showpalette filter
+- Twofish symmetric block cipher
- Support DNx100 (960x720 at 8)
-- Direct3D11-accelerated decoding
+- eq2 filter ported from libmpcodecs as eq filter
+- removed libmpcodecs
+- Changed default DNxHD colour range in QuickTime .mov derivatives to mpeg range
+- ported softpulldown filter from libmpcodecs as repeatfields filter
+- dcshift filter
+- RTP depacketizer for loss tolerant payload format for MP3 audio (RFC 5219)
+- RTP depacketizer for AC3 payload format (RFC 4184)
+- palettegen and paletteuse filters
+- VP9 RTP payload format (draft 0) experimental depacketizer
+- RTP depacketizer for DV (RFC 6469)
- DXVA2-accelerated HEVC decoding
- AAC ELD 480 decoding
- Intel QSV-accelerated H.264 decoding
diff --cc LICENSE.md
index 640633c,0000000..ba65b05
mode 100644,000000..100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@@ -1,121 -1,0 +1,120 @@@
+# License
+
+Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
+or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other
+files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
+FFmpeg.
+
+Some optional parts of FFmpeg are licensed under the GNU General Public License
+version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of
+these parts are used by default, you have to explicitly pass `--enable-gpl` to
+configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
+
+Specifically, the GPL parts of FFmpeg are:
+
+- libpostproc
+- optional x86 optimization in the files
+ - `libavcodec/x86/flac_dsp_gpl.asm`
+ - `libavcodec/x86/idct_mmx.c`
+ - `libavfilter/x86/vf_removegrain.asm`
- - the X11 grabber in `libavdevice/x11grab.c`
+- the following building and testing tools
+ - `compat/solaris/make_sunver.pl`
+ - `doc/t2h.pm`
+ - `doc/texi2pod.pl`
+ - `libswresample/swresample-test.c`
+ - `tests/checkasm/*`
+ - `tests/tiny_ssim.c`
+- the following filters in libavfilter:
+ - `vf_blackframe.c`
+ - `vf_boxblur.c`
+ - `vf_colormatrix.c`
+ - `vf_cover_rect.c`
+ - `vf_cropdetect.c`
+ - `vf_delogo.c`
+ - `vf_eq.c`
+ - `vf_find_rect.c`
+ - `vf_fspp.c`
+ - `vf_geq.c`
+ - `vf_histeq.c`
+ - `vf_hqdn3d.c`
+ - `vf_interlace.c`
+ - `vf_kerndeint.c`
+ - `vf_mcdeint.c`
+ - `vf_mpdecimate.c`
+ - `vf_owdenoise.c`
+ - `vf_perspective.c`
+ - `vf_phase.c`
+ - `vf_pp.c`
+ - `vf_pp7.c`
+ - `vf_pullup.c`
+ - `vf_repeatfields.c`
+ - `vf_sab.c`
+ - `vf_smartblur.c`
+ - `vf_spp.c`
+ - `vf_stereo3d.c`
+ - `vf_super2xsai.c`
+ - `vf_tinterlace.c`
+ - `vf_uspp.c`
+ - `vsrc_mptestsrc.c`
+
+Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
+the configure parameter `--enable-version3` will activate this licensing option
+for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts,
+`COPYING.GPLv3` to learn the exact legal terms that apply in this case.
+
+There are a handful of files under other licensing terms, namely:
+
+* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and
+ `libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for
+ licensing details. Specifically note that you must credit the IJG in the
+ documentation accompanying your program if you only distribute executables.
+ You must also indicate any changes including additions and deletions to
+ those three files in the documentation.
+* `tests/reference.pnm` is under the expat license.
+
+
+## External libraries
+
+FFmpeg can be combined with a number of external libraries, which sometimes
+affect the licensing of binaries resulting from the combination.
+
+### Compatible libraries
+
+The following libraries are under GPL:
+- frei0r
+- libcdio
+- librubberband
+- libvidstab
+- libx264
+- libx265
+- libxavs
+- libxvid
+
+When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
+passing `--enable-gpl` to configure.
+
+The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
+license is incompatible with the LGPL v2.1 and the GPL v2, but not with
+version 3 of those licenses. So to combine these libraries with FFmpeg, the
+license version needs to be upgraded by passing `--enable-version3` to configure.
+
+### Incompatible libraries
+
+There are certain libraries you can combine with FFmpeg whose licenses are not
+compatible with the GPL and/or the LGPL. If you wish to enable these
+libraries, even in circumstances that their license may be incompatible, pass
+`--enable-nonfree` to configure. But note that if you enable any of these
+libraries the resulting binary will be under a complex license mix that is
+more restrictive than the LGPL and that may result in additional obligations.
+It is possible that these restrictions cause the resulting binary to be
+unredistributable.
+
+The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are
+incompatible with the GPLv2 and v3. To the best of our knowledge, they are
+compatible with the LGPL.
+
+The NVENC library, while its header file is licensed under the compatible MIT
+license, requires a proprietary binary blob at run time, and is deemed to be
+incompatible with the GPL. We are not certain if it is compatible with the
+LGPL, but we require `--enable-nonfree` even with LGPL configurations in case
+it is not.
diff --cc configure
index 68cc0c8,45f5256..488e803
--- a/configure
+++ b/configure
@@@ -198,118 -182,66 +198,117 @@@ External library support
libraries must be explicitly enabled.
Also note that the following help text describes the purpose of the libraries
- themselves, not all their features will necessarily be usable by Libav.
-
- --enable-avisynth video frameserver
- --enable-bzlib bzip2 compression [autodetect]
- --enable-frei0r video filtering plugins
- --enable-gnutls crypto
- --enable-libbs2b Bauer stereophonic-to-binaural DSP
- --enable-libcdio audio CD input
- --enable-libdc1394 IEEE 1394/Firewire camera input
- --enable-libdcadec DCA audio decoding
- --enable-libfaac AAC audio encoding
- --enable-libfdk-aac AAC audio encoding/decoding
- --enable-libfontconfig font configuration and management
- --enable-libfreetype font rendering
- --enable-libgsm GSM audio encoding/decoding
- --enable-libilbc ILBC audio encoding/decoding
- --enable-libkvazaar HEVC video encoding
- --enable-libmp3lame MP3 audio encoding
- --enable-libopencore-amrnb AMR-NB audio encoding/decoding
- --enable-libopencore-amrwb AMR-WB audio decoding
- --enable-libopencv computer vision
- --enable-libopenh264 H.264 video encoding/decoding
- --enable-libopenjpeg JPEG 2000 image encoding/decoding
- --enable-libopus Opus audio encoding/decoding
- --enable-libpulse Pulseaudio sound server
- --enable-librtmp RTMP streaming
- --enable-libschroedinger Dirac video encoding/decoding
- --enable-libsnappy snappy compression
- --enable-libspeex Speex audio encoding/decoding
- --enable-libtheora Theora video encoding/decoding
- --enable-libtwolame MP2 audio encoding
- --enable-libvo-aacenc AAC audio encoding
- --enable-libvo-amrwbenc AMR-WB audio encoding
- --enable-libvorbis Vorbis audio encoding/decoding
- --enable-libvpx VP* video encoding/decoding
- --enable-libwavpack Wavpack audio encoding/decoding
- --enable-libwebp WebP image encoding/decoding
- --enable-libx264 H.264 video encoding
- --enable-libx265 HEVC video encoding
- --enable-libxavs Chinese AVS video encoding
- --enable-libxcb X window system protocol communication
- --enable-libxcb-shm X11 shm communication [auto]
- --enable-libxcb-xfixes X11 mouse rendering [auto]
- --enable-libxvid MPEG-4 ASP video encoding
- --enable-openssl crypto
- --enable-zlib compression [autodetect]
+ themselves, not all their features will necessarily be usable by FFmpeg.
+
+ --enable-avisynth enable reading of AviSynth script files [no]
+ --disable-bzlib disable bzlib [autodetect]
+ --enable-chromaprint enable audio fingerprinting with chromaprint [no]
+ --enable-frei0r enable frei0r video filtering [no]
+ --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
+ if openssl, librtmp or gmp is not used [no]
+ --enable-gmp enable gmp, needed for rtmp(t)e support
+ if openssl or librtmp is not used [no]
+ --enable-gnutls enable gnutls, needed for https support
+ if openssl is not used [no]
+ --disable-iconv disable iconv [autodetect]
+ --enable-jni enable JNI support [no]
+ --enable-ladspa enable LADSPA audio filtering [no]
+ --enable-libass enable libass subtitles rendering,
+ needed for subtitles and ass filter [no]
+ --enable-libbluray enable BluRay reading using libbluray [no]
+ --enable-libbs2b enable bs2b DSP library [no]
+ --enable-libcaca enable textual display using libcaca [no]
+ --enable-libcelt enable CELT decoding via libcelt [no]
+ --enable-libcdio enable audio CD grabbing with libcdio [no]
+ --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
+ and libraw1394 [no]
+ --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
+ --enable-libflite enable flite (voice synthesis) support via libflite [no]
+ --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
+ --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
+ --enable-libfribidi enable libfribidi, improves drawtext filter [no]
+ --enable-libgme enable Game Music Emu via libgme [no]
+ --enable-libgsm enable GSM de/encoding via libgsm [no]
+ --enable-libiec61883 enable iec61883 via libiec61883 [no]
+ --enable-libilbc enable iLBC de/encoding via libilbc [no]
+ --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
+ --enable-libmodplug enable ModPlug via libmodplug [no]
+ --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
+ --enable-libnut enable NUT (de)muxing via libnut,
+ native (de)muxer exists [no]
+ --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
+ --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
+ --enable-libopencv enable video filtering via libopencv [no]
+ --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
+ --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
+ --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
+ --enable-libopus enable Opus de/encoding via libopus [no]
+ --enable-libpulse enable Pulseaudio input via libpulse [no]
+ --enable-librubberband enable rubberband needed for rubberband filter [no]
+ --enable-librtmp enable RTMP[E] support via librtmp [no]
+ --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
+ --enable-libshine enable fixed-point MP3 encoding via libshine [no]
+ --enable-libsmbclient enable Samba protocol via libsmbclient [no]
+ --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
+ --enable-libsoxr enable Include libsoxr resampling [no]
+ --enable-libspeex enable Speex de/encoding via libspeex [no]
+ --enable-libssh enable SFTP protocol via libssh [no]
+ --enable-libtesseract enable Tesseract, needed for ocr filter [no]
+ --enable-libtheora enable Theora encoding via libtheora [no]
+ --enable-libtwolame enable MP2 encoding via libtwolame [no]
+ --enable-libv4l2 enable libv4l2/v4l-utils [no]
+ --enable-libvidstab enable video stabilization using vid.stab [no]
+ --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
+ --enable-libvorbis enable Vorbis en/decoding via libvorbis,
+ native implementation exists [no]
+ --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
+ --enable-libwavpack enable wavpack encoding via libwavpack [no]
+ --enable-libwebp enable WebP encoding via libwebp [no]
+ --enable-libx264 enable H.264 encoding via x264 [no]
+ --enable-libx265 enable HEVC encoding via x265 [no]
+ --enable-libxavs enable AVS encoding via xavs [no]
+ --enable-libxcb enable X11 grabbing using XCB [autodetect]
+ --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
+ --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
+ --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
+ --enable-libxvid enable Xvid encoding via xvidcore,
+ native MPEG-4/Xvid encoder exists [no]
+ --enable-libzimg enable z.lib, needed for zscale filter [no]
+ --enable-libzmq enable message passing via libzmq [no]
+ --enable-libzvbi enable teletext support via libzvbi [no]
+ --disable-lzma disable lzma [autodetect]
+ --enable-decklink enable Blackmagic DeckLink I/O support [no]
+ --enable-mediacodec enable Android MediaCodec support [no]
+ --enable-netcdf enable NetCDF, needed for sofalizer filter [no]
+ --enable-openal enable OpenAL 1.1 capture support [no]
+ --enable-opencl enable OpenCL code
+ --enable-opengl enable OpenGL rendering [no]
+ --enable-openssl enable openssl, needed for https support
+ if gnutls is not used [no]
+ --disable-schannel disable SChannel SSP, needed for TLS support on
+ Windows if openssl and gnutls are not used [autodetect]
+ --disable-sdl2 disable sdl2 [autodetect]
+ --disable-securetransport disable Secure Transport, needed for TLS support
+ on OSX if openssl and gnutls are not used [autodetect]
- --enable-x11grab enable X11 grabbing (legacy) [no]
+ --disable-xlib disable xlib [autodetect]
+ --disable-zlib disable zlib [autodetect]
The following libraries provide various hardware acceleration features:
- --enable-cuda Nvidia CUDA (dynamically linked)
- --enable-d3d11va Microsoft Direct3D 11 video acceleration [auto]
- --enable-dxva2 Microsoft DirectX 9 video acceleration [auto]
- --enable-libmfx Intel MediaSDK (AKA Quick Sync Video)
- --enable-libnpp Nvidia CUDA processing
- --enable-mmal Broadcom Multi-Media Abstraction Layer (Raspberry Pi)
- --enable-nvenc Nvidia video encoding
- --enable-omx OpenMAX IL
- --enable-omx-rpi OpenMAX IL for Raspberry Pi
- --enable-vaapi Video Acceleration API (mainly Unix/Intel)
- --enable-vda Apple Video Decode Acceleration [auto]
- --enable-vdpau Nvidia Video Decode and Presentation API for Unix [auto]
+ --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
+ --disable-cuda disable dynamically linked Nvidia CUDA code [autodetect]
+ --disable-cuvid disable Nvidia CUVID support [autodetect]
+ --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
+ --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
+ --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
+ --enable-libnpp enable Nvidia Performance Primitives-based code [no]
+ --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
+ --disable-nvenc disable Nvidia video encoding code [autodetect]
+ --enable-omx enable OpenMAX IL code [no]
+ --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
+ --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
+ --disable-vda disable Apple Video Decode Acceleration code [autodetect]
+ --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
+ --disable-videotoolbox disable VideoToolbox code [autodetect]
Toolchain options:
--arch=ARCH select architecture [$arch]
@@@ -3022,25 -2362,14 +3020,24 @@@ opengl_outdev_deps="opengl
oss_indev_deps_any="soundcard_h sys_soundcard_h"
oss_outdev_deps_any="soundcard_h sys_soundcard_h"
pulse_indev_deps="libpulse"
+pulse_outdev_deps="libpulse"
+qtkit_indev_extralibs="-framework QTKit -framework Foundation -framework QuartzCore"
+qtkit_indev_select="qtkit"
+sdl2_outdev_deps="sdl2"
sndio_indev_deps="sndio_h"
sndio_outdev_deps="sndio_h"
+v4l_indev_deps="linux_videodev_h"
v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
+v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
vfwcap_indev_extralibs="-lavicap32"
- x11grab_indev_deps="x11grab"
x11grab_xcb_indev_deps="libxcb"
+xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
+xv_outdev_extralibs="-lXv -lX11 -lXext"
# protocols
+async_protocol_deps="threads"
+bluray_protocol_deps="libbluray"
ffrtmpcrypt_protocol_deps="!librtmp_protocol"
ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
ffrtmpcrypt_protocol_select="tcp_protocol"
@@@ -6029,57 -4747,27 +6026,51 @@@ if enabled libcdio; the
die "ERROR: No usable libcdio/cdparanoia found"
fi
-check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
+enabled xlib &&
+ check_lib X11/Xlib.h XOpenDisplay -lX11 || disable xlib
-if enabled libxcb; then
- check_pkg_config xcb-shape xcb/shape.h xcb_shape_rectangles || {
- enabled libxcb && die "ERROR: libxcb not found";
+if ! disabled libxcb; then
+ check_pkg_config "xcb >= 1.4" xcb/xcb.h xcb_connect || {
+ enabled libxcb && die "ERROR: libxcb >= 1.4 not found";
- } && disable x11grab && enable libxcb
+ } && enable libxcb
- disabled libxcb_shm ||
+if enabled libxcb; then
+ disabled libxcb_shm || {
check_pkg_config xcb-shm xcb/shm.h xcb_shm_attach || {
enabled libxcb_shm && die "ERROR: libxcb_shm not found";
- } && check_header sys/shm.h && enable libxcb_shm
+ } && check_header sys/shm.h && enable libxcb_shm; }
- disabled libxcb_xfixes ||
+ disabled libxcb_xfixes || {
check_pkg_config xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image || {
enabled libxcb_xfixes && die "ERROR: libxcb_xfixes not found";
- } && enable libxcb_xfixes
+ } && enable libxcb_xfixes; }
+
+ disabled libxcb_shape || {
+ check_pkg_config xcb-shape xcb/shape.h xcb_shape_get_rectangles || {
+ enabled libxcb_shape && die "ERROR: libxcb_shape not found";
+ } && enable libxcb_shape; }
- add_cflags "$xcb_event_cflags $xcb_shm_cflags $xcb_xfixes_cflags"
- add_extralibs "$xcb_event_libs $xcb_shm_libs $xcb_xfixes_libs"
+ add_cflags $xcb_cflags $xcb_shm_cflags $xcb_xfixes_cflags $xcb_shape_cflags
+ add_extralibs $xcb_libs $xcb_shm_libs $xcb_xfixes_libs $xcb_shape_libs
+fi
fi
- if enabled x11grab; then
- enabled xlib || die "ERROR: Xlib not found"
- require Xext X11/extensions/XShm.h XShmCreateImage -lXext
- require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
- fi
-
+check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
+
+enabled dxva2api_h &&
+ check_cc <<EOF && enable dxva2api_cobj
+#define _WIN32_WINNT 0x0600
+#define COBJMACROS
+#include <windows.h>
+#include <d3d9.h>
+#include <dxva2api.h>
+int main(void) { IDirectXVideoDecoder *o = NULL; IDirectXVideoDecoder_Release(o); return 0; }
+EOF
+
+enabled vaapi &&
+ check_lib va/va.h vaInitialize -lva ||
+ disable vaapi
+
enabled vaapi &&
check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" ||
disable vaapi
diff --cc libavdevice/Makefile
index 256e140,a4c96ef..90ebc95
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@@ -12,44 -9,21 +12,43 @@@ OBJS = alldevices.
OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
# input/output devices
-OBJS-$(CONFIG_ALSA_INDEV) += alsa_dec.o alsa.o
+OBJS-$(CONFIG_ALSA_INDEV) += alsa_dec.o alsa.o timefilter.o
OBJS-$(CONFIG_ALSA_OUTDEV) += alsa_enc.o alsa.o
-OBJS-$(CONFIG_AVFOUNDATION_INDEV) += avfoundation_dec.o
+OBJS-$(CONFIG_AVFOUNDATION_INDEV) += avfoundation.o
OBJS-$(CONFIG_BKTR_INDEV) += bktr.o
+OBJS-$(CONFIG_CACA_OUTDEV) += caca.o
+OBJS-$(CONFIG_DECKLINK_OUTDEV) += decklink_enc.o decklink_enc_c.o decklink_common.o
+OBJS-$(CONFIG_DECKLINK_INDEV) += decklink_dec.o decklink_dec_c.o decklink_common.o
+OBJS-$(CONFIG_DSHOW_INDEV) += dshow_crossbar.o dshow.o dshow_enummediatypes.o \
+ dshow_enumpins.o dshow_filter.o \
+ dshow_pin.o dshow_common.o
OBJS-$(CONFIG_DV1394_INDEV) += dv1394.o
-OBJS-$(CONFIG_FBDEV_INDEV) += fbdev.o
+OBJS-$(CONFIG_FBDEV_INDEV) += fbdev_dec.o \
+ fbdev_common.o
+OBJS-$(CONFIG_FBDEV_OUTDEV) += fbdev_enc.o \
+ fbdev_common.o
+OBJS-$(CONFIG_GDIGRAB_INDEV) += gdigrab.o
+OBJS-$(CONFIG_IEC61883_INDEV) += iec61883.o
OBJS-$(CONFIG_JACK_INDEV) += jack.o timefilter.o
+OBJS-$(CONFIG_LAVFI_INDEV) += lavfi.o
+OBJS-$(CONFIG_OPENAL_INDEV) += openal-dec.o
+OBJS-$(CONFIG_OPENGL_OUTDEV) += opengl_enc.o
OBJS-$(CONFIG_OSS_INDEV) += oss_dec.o oss.o
OBJS-$(CONFIG_OSS_OUTDEV) += oss_enc.o oss.o
-OBJS-$(CONFIG_PULSE_INDEV) += pulse.o
+OBJS-$(CONFIG_PULSE_INDEV) += pulse_audio_dec.o \
+ pulse_audio_common.o timefilter.o
+OBJS-$(CONFIG_PULSE_OUTDEV) += pulse_audio_enc.o \
+ pulse_audio_common.o
+OBJS-$(CONFIG_QTKIT_INDEV) += qtkit.o
+OBJS-$(CONFIG_SDL2_OUTDEV) += sdl2.o
OBJS-$(CONFIG_SNDIO_INDEV) += sndio_dec.o sndio.o
OBJS-$(CONFIG_SNDIO_OUTDEV) += sndio_enc.o sndio.o
-OBJS-$(CONFIG_V4L2_INDEV) += v4l2.o
+OBJS-$(CONFIG_V4L2_INDEV) += v4l2.o v4l2-common.o timefilter.o
+OBJS-$(CONFIG_V4L2_OUTDEV) += v4l2enc.o v4l2-common.o
+OBJS-$(CONFIG_V4L_INDEV) += v4l.o
OBJS-$(CONFIG_VFWCAP_INDEV) += vfwcap.o
- OBJS-$(CONFIG_X11GRAB_INDEV) += x11grab.o
OBJS-$(CONFIG_X11GRAB_XCB_INDEV) += xcbgrab.o
+OBJS-$(CONFIG_XV_OUTDEV) += xv.o
# external libraries
OBJS-$(CONFIG_LIBCDIO_INDEV) += libcdio.o
diff --cc libavdevice/alldevices.c
index 75f4ae0,8541dba..f8f31ed
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@@ -44,28 -50,15 +44,27 @@@ static void register_all(void
REGISTER_INOUTDEV(ALSA, alsa);
REGISTER_INDEV (AVFOUNDATION, avfoundation);
REGISTER_INDEV (BKTR, bktr);
+ REGISTER_OUTDEV (CACA, caca);
+ REGISTER_INOUTDEV(DECKLINK, decklink);
+ REGISTER_INDEV (DSHOW, dshow);
REGISTER_INDEV (DV1394, dv1394);
- REGISTER_INDEV (FBDEV, fbdev);
+ REGISTER_INOUTDEV(FBDEV, fbdev);
+ REGISTER_INDEV (GDIGRAB, gdigrab);
+ REGISTER_INDEV (IEC61883, iec61883);
REGISTER_INDEV (JACK, jack);
+ REGISTER_INDEV (LAVFI, lavfi);
+ REGISTER_INDEV (OPENAL, openal);
+ REGISTER_OUTDEV (OPENGL, opengl);
REGISTER_INOUTDEV(OSS, oss);
- REGISTER_INDEV (PULSE, pulse);
+ REGISTER_INOUTDEV(PULSE, pulse);
+ REGISTER_INDEV (QTKIT, qtkit);
+ REGISTER_OUTDEV (SDL2, sdl2);
REGISTER_INOUTDEV(SNDIO, sndio);
- REGISTER_INDEV (V4L2, v4l2);
+ REGISTER_INOUTDEV(V4L2, v4l2);
+// REGISTER_INDEV (V4L, v4l
REGISTER_INDEV (VFWCAP, vfwcap);
- REGISTER_INDEV (X11GRAB, x11grab);
REGISTER_INDEV (X11GRAB_XCB, x11grab_xcb);
+ REGISTER_OUTDEV (XV, xv);
/* external libraries */
REGISTER_INDEV (LIBCDIO, libcdio);
More information about the ffmpeg-cvslog
mailing list