]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '58396e806c65fe0eb00e6ccf1980f810cdceed05'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 28 Aug 2014 20:06:48 +0000 (22:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 28 Aug 2014 20:06:48 +0000 (22:06 +0200)
* commit '58396e806c65fe0eb00e6ccf1980f810cdceed05':
  x11grab: Use a typedef for the context, as most other code does

Conflicts:
libavdevice/x11grab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavdevice/x11grab.c

index b4d2560882cf54cb23f26c871c9a1b633390561d,56eeea98122ecb7056f41c21b3676039d72cf862..c2bb459fe7536ea5f423ac1ad9d37b85ba66ba98
@@@ -80,13 -79,10 +80,13 @@@ typedef struct X11GrabContext 
      int draw_mouse;          /**< Set by a private option. */
      int follow_mouse;        /**< Set by a private option. */
      int show_region;         /**< set by a private option. */
 -    char *framerate;         /**< 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
  
@@@ -364,9 -345,8 +364,9 @@@ out
   * @param s context used to retrieve original grabbing rectangle
   *          coordinates
   */
 -static void paint_mouse_pointer(XImage *image, X11GrabContext *s)
 +static void paint_mouse_pointer(XImage *image, AVFormatContext *s1)
  {
-     struct x11grab *s = s1->priv_data;
++    X11GrabContext *s = s1->priv_data;
      int x_off    = s->x_off;
      int y_off    = s->y_off;
      int width    = s->width;
@@@ -627,20 -583,16 +627,20 @@@ static int x11grab_read_close(AVFormatC
      return 0;
  }
  
- #define OFFSET(x) offsetof(struct x11grab, x)
+ #define OFFSET(x) offsetof(X11GrabContext, x)
  #define DEC AV_OPT_FLAG_DECODING_PARAM
  static const AVOption options[] = {
 -    { "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = "vga"}, 0, 0, DEC },
 -    { "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, 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" },
 -    { "show_region", "Show the grabbing region.", OFFSET(show_region), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, 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, 0, 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 },
  };