Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 31 Jul 2011 22:35:57 +0000 (00:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 31 Jul 2011 22:35:57 +0000 (00:35 +0200)
* qatar/master:
  lavc: Deprecate unused FF_ER_VERY_AGGRESSIVE
  x11grab: add show_region AVOption.
  x11grab: add follow_mouse AVOption.
  Do not convert RGB buffer at once when stride does not fit exact samples.

Conflicts:
libswscale/swscale_unscaled.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
doc/ffmpeg.texi
doc/indevs.texi
libavcodec/avcodec.h
libavcodec/options.c
libavcodec/version.h
libavdevice/x11grab.c
libswscale/swscale_unscaled.c

diff --cc doc/ffmpeg.texi
Simple merge
diff --cc doc/indevs.texi
Simple merge
Simple merge
Simple merge
Simple merge
  #include <X11/Xproto.h>
  #include <X11/Xutil.h>
  #include <sys/shm.h>
+ #include <X11/extensions/shape.h>
  #include <X11/extensions/XShm.h>
  #include <X11/extensions/Xfixes.h>
 +#include "avdevice.h"
  
  /**
   * X11 Device Demuxer context
@@@ -95,8 -161,9 +161,9 @@@ x11grab_read_header(AVFormatContext *s1
      XImage *image;
      int x_off = 0;
      int y_off = 0;
+     int screen;
      int use_shm;
 -    char *param, *offset;
 +    char *dpyname, *offset;
      int ret = 0;
      AVRational framerate;
  
      }
      av_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 = FFMIN(FFMAX(x_off, 0), screen_w - x11grab->width);
+         y_off = FFMIN(FFMAX(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);
+     }
      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);
Simple merge