Commit Graph

121 Commits

Author SHA1 Message Date
Clément Bœsch 272f87fc5c avdevice/x11grab: use av_clip() instead of nested min & max
Note: [xy]_off and screen_[wh] variables are int, as well as
X11GrabContext.{width,height,x_off,y_off}.
2015-06-06 13:18:29 +02:00
Michael Niedermayer fe25194c58 Merge commit 'c201069fac9a76e6604f9d84d76a172434d62200'
* commit 'c201069fac9a76e6604f9d84d76a172434d62200':
  avdevice: Add missing header for NULL_IF_CONFIG_SMALL

Conflicts:
	libavdevice/alsa-audio-dec.c
	libavdevice/alsa-audio-enc.c
	libavdevice/pulse_audio_dec.c
	libavdevice/sndio_enc.c
	libavdevice/vfwcap.c
	libavdevice/x11grab.c
	libavdevice/xcbgrab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-09 21:07:24 +02:00
Diego Biurrun c201069fac avdevice: Add missing header for NULL_IF_CONFIG_SMALL
Also reshuffle headers into canonical order where appropriate.
2015-04-09 16:40:12 +02:00
Michael Niedermayer 8a77672645 Merge commit '802987f8c7033ec8b82b35438d3822cf7f761166'
* commit '802987f8c7033ec8b82b35438d3822cf7f761166':
  x11grab: Unbreak building

Conflicts:
	libavdevice/x11grab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-01 00:17:36 +01:00
Christian Hujer 802987f8c7 x11grab: Unbreak building
The correct macro is DEC not D. Broken in
b31328d008

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-02-28 21:51:24 +01:00
Michael Niedermayer 2fbdf30efe Merge commit 'b31328d008985f87f0a7c83c700847cef1a4f08c'
* commit 'b31328d008985f87f0a7c83c700847cef1a4f08c':
  xcbgrab: Provide better names for the y and x option

Conflicts:
	doc/indevs.texi
	libavdevice/x11grab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-25 01:12:50 +01:00
Luca Barbato b31328d008 xcbgrab: Provide better names for the y and x option
Incidentally `-y` also collides with avconv global options.

Update x11grab to match and document the option.

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-02-24 22:31:20 +01:00
Michael Niedermayer 345160a9cd Merge commit '2a5ac99e6e06078713f684fee2466c91f677b303'
* commit '2a5ac99e6e06078713f684fee2466c91f677b303':
  x11grab: Check the XQueryPointer return value

Conflicts:
	libavdevice/x11grab.c

See: 69c34a6ac9
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 03:42:55 +02:00
Michael Niedermayer 8e5be0fffe Merge commit '5b9c817dc7577b6d44acc94d73b9c77c52cda489'
* commit '5b9c817dc7577b6d44acc94d73b9c77c52cda489':
  x11grab: Check XFixesGetCursorImage return value

Conflicts:
	libavdevice/x11grab.c

See: a65c0a3fe8

The warning with adjusted text is kept from a65c0a3fe8
but drawing the cursor is not disabled in case XFixesGetCursorImage() fails

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 03:22:55 +02:00
Michael Niedermayer 98baa8151a Merge commit '89fa2b5616274194d90bde0aeebf6adbd1245193'
* commit '89fa2b5616274194d90bde0aeebf6adbd1245193':
  x11grab: Check for XFixes availability at runtime

See: a65c0a3fe8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 03:14:35 +02:00
Antonio Ospite 2a5ac99e6e x11grab: Check the XQueryPointer return value
The paint_mouse_pointer() code uses XFixes to retrieve the cursor
coordinates, but XFixes gives no information about which screen the
pointer is on; this results in always drawing the cursor on the
captured screen even if the mouse pointer was on another screen.

For example, when capturing from screen 1 (i.e. -f x11grab -i ":0.1")
the cursor was being drawn in the captured image even when the mouse
pointer was actually on screen 0, which is wrong and visually confusing.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-10-04 23:46:46 +02:00
Luca Barbato 5b9c817dc7 x11grab: Check XFixesGetCursorImage return value
It could return NULL if the cursor is outside the screen, the connection
timed out or the system is out of memory.

CC: libav-stable@libav.org
2014-10-04 23:46:46 +02:00
Luca Barbato 89fa2b5616 x11grab: Check for XFixes availability at runtime 2014-10-04 23:46:46 +02:00
Antonio Ospite 69c34a6ac9 avdevice/x11grab: fix cursor drawing in multi-screen setup
The code uses XFixes to retrieve the cursor coordinates, but XFixes
gives no information of what screen the pointer is on; this results in
always drawing the cursor on the captured screen even if the mouse
pointer was on another screen.

For example, when capturing from screen 1 (i.e. -f x11grab -i ":0.1")
the cursor was being drawn in the captured image even when the mouse
pointer was actually on screen 0, which is wrong and visually confusing.

Use XQueryPointer to check that the pointer is actually on the screen
which is being captured.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-09 02:22:06 +02:00
Antonio Ospite 5a8e51f661 avdevice/x11grab: rename the "w" Window to "root" in paint_mouse_pointer
This specifies better the meaning of the variable, and is also in
preparation of a subsequent change which will introduce a temporary
Window variable for which "w" is an good name.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-09 02:22:01 +02:00
Michael Niedermayer 4f63d6d3b5 avdevice/x11grab: fix error handling in pixel formats
Reviewed-by: Benoit Fouet <benoit.fouet@free.fr>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-04 13:42:53 +02:00
Michael Niedermayer 7509a95656 Merge commit '65e78a2e4b111627c0ebdf2c9baec95e5e21560d'
* commit '65e78a2e4b111627c0ebdf2c9baec95e5e21560d':
  x11grab: Refactor pixel format parsing

Conflicts:
	libavdevice/x11grab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-03 13:58:41 +02:00
Michael Niedermayer 33bf66af02 Merge commit 'bb3ead7e54fec205c595cfb8b1d8900d50d3d1cc'
* commit 'bb3ead7e54fec205c595cfb8b1d8900d50d3d1cc':
  x11grab: Fallback to normal XImage if SHM is not supported

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-03 13:30:24 +02:00
Luca Barbato 65e78a2e4b x11grab: Refactor pixel format parsing 2014-09-03 02:38:03 +02:00
Luca Barbato bb3ead7e54 x11grab: Fallback to normal XImage if SHM is not supported 2014-09-03 02:38:03 +02:00
Michael Niedermayer c6a3b00924 Merge commit '58396e806c65fe0eb00e6ccf1980f810cdceed05'
* 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>
2014-08-28 22:06:48 +02:00
Michael Niedermayer 1fc3963188 Merge commit '7bb505a33ca131906b2ceb2f298e104c862740ea'
* commit '7bb505a33ca131906b2ceb2f298e104c862740ea':
  x11grab: Drop a spurious space in the extension reporting message

Conflicts:
	libavdevice/x11grab.c

See: 9af2097120
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-28 21:51:34 +02:00
Michael Niedermayer 65c9e2d003 Merge commit '20e82b41fcad23ebbb18d89948aebfcc53921198'
* commit '20e82b41fcad23ebbb18d89948aebfcc53921198':
  x11grab: Small near-cosmetic refactorings

Conflicts:
	libavdevice/x11grab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-28 21:39:19 +02:00
Michael Niedermayer 5393c9dadd Merge commit 'f07a4290a0e8f31796e348edd3ed06b8d15132d8'
* commit 'f07a4290a0e8f31796e348edd3ed06b8d15132d8':
  x11grab: K&R formatting cosmetics

Conflicts:
	libavdevice/x11grab.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-28 21:21:47 +02:00
Luca Barbato 58396e806c x11grab: Use a typedef for the context, as most other code does
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-28 15:49:05 +02:00
Luca Barbato 7bb505a33c x11grab: Drop a spurious space in the extension reporting message
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-28 15:46:56 +02:00
Luca Barbato 20e82b41fc x11grab: Small near-cosmetic refactorings
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-28 15:20:12 +02:00
Luca Barbato f07a4290a0 x11grab: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-28 14:58:48 +02:00
Nicolas George 8e2976860f lavd/x11grab: reindent after last commit. 2014-07-17 18:28:58 +02:00
Nicolas George 1d12df1ad7 lavd/x11grab: add an option to disable MIT-SHM.
With remote displays supporting the MIT-SHM extension,
the extension is detected and used, but attaching fails
asynchronously.
2014-07-17 18:12:15 +02:00
Nicolas George 16c6795465 lavd/x11grab: check 32-bits color masks.
The X11 servers by VNC, at 32-bits depths, has the following masks:
R:0x000007ff G:0x003ff800 B:0xffc00000
This is not compatible with AV_PIX_FMT_0RGB32, and the result
is success with completely wrong colors.
2014-07-17 18:11:56 +02:00
Nicolas George 36fbe3c789 lavd/x11grab: change error code for unsupported visuals. 2014-07-17 18:11:55 +02:00
Nicolas George a65c0a3fe8 lavd/x11grab: disable drawing mouse without XFixes.
Fix a segfault if the XFixes extension is not available on
the X11 server.
Can be reproduced using the VNC server.
2014-07-17 18:11:55 +02:00
Lukasz Marek f607767d93 lavd: add categories to device implementations
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-03-03 23:34:46 +01:00
Carl Eugen Hoyos f60c3a7c1b lavd/x11grab: Support AV_PIX_FMT_PAL8.
Fixes ticket #3068.
2013-10-24 11:56:36 +02:00
Paul B Mahol 0addc82880 avdevice/x11grab: use AV_OPT_TYPE_VIDEO_RATE
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-07-26 15:21:21 +00:00
Michael Niedermayer 1ee8fadb81 avdevice/x11grab: allocate just one Cursor
Fixes resource leak and Ticket2450

Reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-21 12:00:11 +02:00
Michael Niedermayer 11d695d120 x11grab: fix mixed declaration and code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-29 22:24:10 +01:00
Isaac Dooley 469a65b150 x11: Fix x11grab BadCursor
Fixes Ticket1738

Based-on: A fix found in a perl module (http://ffmpeg.org/pipermail/ffmpeg-user/2012-August/008804.html)
Reviewed-by: Clemens Fruhwirth <clemens@endorphin.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-23 21:49:01 +02:00
Michael Niedermayer ac627b3d38 Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
  Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

Conflicts:
	doc/examples/muxing.c
	ffmpeg.h
	ffmpeg_filter.c
	ffmpeg_opt.c
	ffplay.c
	ffprobe.c
	libavcodec/8bps.c
	libavcodec/aasc.c
	libavcodec/aura.c
	libavcodec/avcodec.h
	libavcodec/avs.c
	libavcodec/bfi.c
	libavcodec/bmp.c
	libavcodec/bmpenc.c
	libavcodec/c93.c
	libavcodec/cscd.c
	libavcodec/cyuv.c
	libavcodec/dpx.c
	libavcodec/dpxenc.c
	libavcodec/eatgv.c
	libavcodec/escape124.c
	libavcodec/ffv1.c
	libavcodec/flashsv.c
	libavcodec/fraps.c
	libavcodec/h264.c
	libavcodec/huffyuv.c
	libavcodec/iff.c
	libavcodec/imgconvert.c
	libavcodec/indeo3.c
	libavcodec/kmvc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c
	libavcodec/motionpixels.c
	libavcodec/mpeg12.c
	libavcodec/mpeg12enc.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pamenc.c
	libavcodec/pcxenc.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/pnm.c
	libavcodec/pnmdec.c
	libavcodec/pnmenc.c
	libavcodec/ptx.c
	libavcodec/qdrw.c
	libavcodec/qpeg.c
	libavcodec/qtrleenc.c
	libavcodec/raw.c
	libavcodec/rawdec.c
	libavcodec/rl2.c
	libavcodec/sgidec.c
	libavcodec/sgienc.c
	libavcodec/snowdec.c
	libavcodec/snowenc.c
	libavcodec/sunrast.c
	libavcodec/targa.c
	libavcodec/targaenc.c
	libavcodec/tiff.c
	libavcodec/tiffenc.c
	libavcodec/tmv.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/vb.c
	libavcodec/vp3.c
	libavcodec/wnv1.c
	libavcodec/xl.c
	libavcodec/xwddec.c
	libavcodec/xwdenc.c
	libavcodec/yop.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/avfilter.c
	libavfilter/avfilter.h
	libavfilter/buffersrc.c
	libavfilter/drawutils.c
	libavfilter/formats.c
	libavfilter/src_movie.c
	libavfilter/vf_ass.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fade.c
	libavfilter/vf_format.c
	libavfilter/vf_hflip.c
	libavfilter/vf_lut.c
	libavfilter/vf_overlay.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavfilter/vf_transpose.c
	libavfilter/vf_yadif.c
	libavfilter/video.c
	libavfilter/vsrc_testsrc.c
	libavformat/movenc.c
	libavformat/mxf.h
	libavformat/utils.c
	libavformat/yuv4mpeg.c
	libavutil/imgutils.c
	libavutil/pixdesc.c
	libswscale/input.c
	libswscale/output.c
	libswscale/swscale_internal.h
	libswscale/swscale_unscaled.c
	libswscale/utils.c
	libswscale/x86/swscale_template.c
	libswscale/x86/yuv2rgb.c
	libswscale/x86/yuv2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-08 21:06:57 +02:00
Anton Khirnov 716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +02:00
Michael Niedermayer d46c1c72e4 Merge commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9'
* commit 'e6153f173a49e5bfa70b0c04d2f82930533597b9':
  avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member

Conflicts:
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libx264.c
	libavcodec/mpeg12enc.c
	libavcodec/options_table.h
	libavcodec/snowenc.c
	libavcodec/tiffenc.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/af_amix.c
	libavfilter/af_asyncts.c
	libavfilter/af_join.c
	libavfilter/buffersrc.c
	libavfilter/src_movie.c
	libavfilter/vf_delogo.c
	libavfilter/vf_drawtext.c
	libavformat/http.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/movenc.c
	libavformat/mpegenc.c
	libavformat/mpegtsenc.c
	libavformat/options_table.h
	libavformat/segment.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-05 14:33:32 +02:00
Michael Niedermayer d5f65e9d40 Merge commit '124134e42455763b28cc346fed1d07017a76e84e'
* commit '124134e42455763b28cc346fed1d07017a76e84e':
  avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member

Conflicts:
	libavcodec/aacenc.c
	libavcodec/libopenjpegenc.c
	libavcodec/options_table.h
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavdevice/x11grab.c
	libavfilter/af_amix.c
	libavfilter/vf_drawtext.c
	libavformat/movenc.c
	libavformat/options_table.h
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-05 13:58:11 +02:00
Martin Storsjö e6153f173a avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:44 +03:00
Martin Storsjö 124134e424 avopt: Store defaults for AV_OPT_TYPE_CONST in the i64 union member
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-04 23:13:32 +03:00
Stefano Sabatini 4270d8c04d lavd/x11grab: deprecate "nomouse" specification in filename
Favor draw_mouse option. Should simplify parsing, and make it more
robust.
2012-08-08 23:43:37 +02:00
Stefano Sabatini c93b796c3e lavd/x11grab: apply misc consistency fixes to options definition
In particular, do not upcase first word, do not use final dot, use a verb
to specify what the option does, sort entries by name, apply random
vertical align.
2012-08-08 23:43:37 +02:00
Michael Niedermayer 7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Clément Bœsch 16dc5f2050 Replace various inlined inverse AVRational with av_inv_q(). 2012-08-06 00:04:36 +02:00