Commit Graph

60 Commits

Author SHA1 Message Date
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
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
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
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
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
Anton Khirnov
716d413c13 Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat 2012-10-08 07:13:26 +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
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Anton Khirnov
c4ef6a3e4b Add missing libavutil/time.h includes. 2012-07-28 09:02:07 +02:00
Diego Biurrun
24f8961f93 x11grab: cosmetics: consistent naming for x11grab-related things 2012-07-28 02:02:19 +02:00
Antonio Ospite
d3958ab4ed x11grab: fix a memory leak exposed by valgrind
When using "-f x11grab -i :0.0" valgrind reports a definitely lost
memory block with this message:

==31544== 5 bytes in 1 blocks are definitely lost in loss record 1 of 2
==31544==    at 0x4026E68: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31544==    by 0x4026F17: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31544==    by 0x60D399A: av_malloc (in /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1)
==31544==    by 0x60D3A70: av_strdup (in /usr/lib/x86_64-linux-gnu/libavutil.so.51.22.1)
==31544==    by 0x4A2BE58: ??? (in /usr/lib/x86_64-linux-gnu/libavdevice.so.53.2.0)
==31544==    by 0x506D29E: avformat_open_input (in /usr/lib/x86_64-linux-gnu/libavformat.so.53.21.0)
==31544==    by 0x400A80: main (in /home/ao2/WIP/am7xxx-play/tests/a.out)

The 5 bytes lost are the ones from param = av_strdup(":0.0"), so let's
free param in the exit path.

Also check the av_strdup() return value.

Note: calling av_free(param) even when av_strdup() fails and param is
NULL is OK and keeps the code simpler without adding another label to
skip av_free().

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-16 15:39:33 -07:00
Diego Biurrun
cfac648e6a doxygen: Remove documentation for non-existing parameters; misc small fixes. 2012-02-28 20:48:43 +01:00
Anton Khirnov
6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Diego Biurrun
e873c03ac7 misc Doxygen markup improvements 2011-12-05 13:06:58 +01:00
Anton Khirnov
c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Anton Khirnov
3b3bbdd3e6 lavf,lavd: replace av_new_stream->avformat_new_stream part I.
Trivial replacements with sed are done in this commit:
sed 's/av_new_stream(\([^)]*\), 0)/avformat_new_stream(\1, NULL)/'
2011-10-19 17:02:11 +02:00
Anton Khirnov
145f741e11 AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_* 2011-10-12 16:51:16 +02:00
Diego Biurrun
30b4ee7901 Use explicit struct initializers for AVOutputFormat/AVInputFormat declarations. 2011-09-24 12:11:17 +02:00
Anton Khirnov
c14fe6bc99 lavf,lavd: remove all usage of AVFormatParameters from demuxers.
AVFormatParameters are converted into corresponding private options in
av_open_input_file/stream() compat wrappers, so accessing them from
demuxers is redundant.
2011-08-15 19:59:48 +02:00
Yu-Jie Lin
1442d29533 x11grab: add show_region AVOption.
Draw the current grabbing region for indication.

Signed-off-by: Yu-Jie Lin <livibetter@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-31 14:26:08 +02:00
Yu-Jie Lin
085791a92e x11grab: add follow_mouse AVOption.
-follow_mouse centered|PIXELS
  move grabbing region to where mouse pointer at the center; or
  only move when pointer reaches within PIXELS to the edge.

Signed-off-by: Yu-Jie Lin <livibetter@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-07-31 14:25:00 +02:00
Anton Khirnov
ce558c8f59 x11grab: replace undocumented nomouse hackery with a private option. 2011-07-08 18:30:21 +02:00
Diego Biurrun
f9853c1b9c libavdevice: Remove disabled code. 2011-07-07 22:53:51 +02:00
Sven C. Dack
2f2c60400a x11grab: remove a memory allocation and the associated memcpy.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-12 12:18:05 +02:00
Anton Khirnov
367732832f lavf,lavc: free avoptions in a generic way.
It's simpler and less error-prone.

Fixes some memleaks along the way.
2011-06-05 15:01:36 +02:00
Anton Khirnov
ff494cbdaf x11grab: add framerate private option. 2011-06-04 19:49:56 +02:00
Anton Khirnov
724a900c45 x11grab: add video_size private option. 2011-05-27 06:52:52 +02:00
Anton Khirnov
3102fb0351 x11grab: factorize returning error codes. 2011-05-27 06:52:52 +02:00
Diego Biurrun
046f081b46 configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.
Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems
since it causes certain system functions to be hidden on some (BSD) systems.
The solution is to only add the flag on systems that really require it, i.e.
glibc-based ones.

This change makes BSD systems compile out-of-the-box without the need for
adding specific flags manually.  It also allows dropping a number of flags
set manually on a file-per-file basis, but were only present to work around
breakage introduced by the presence of _POSIX_C_SOURCE.

Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems.  We use XSI extensions
in several places already, so it is preferable to define it globally instead
of littering source files with individual #defines only needed for glibc.
2011-05-12 11:41:59 +02:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Diego Elio Pettenò
c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Jason Garrett-Glaser
8ce803db51 Make x11grab cursor drawing suck less
This new version:
1.  Works on 24-bit and 32-bit input, not just 32-bit.
2.  Doesn't try to run on 16-bit or 8-bit, instead of outright crashing.
3.  Does proper alpha-blending, so cursor shadows look correct.
4.  Doesn't swap R and B.

Mostly fixes issue 1997.
Fixes issue 2056.

Originally committed as revision 25690 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-07 18:04:46 +00:00
Diego Biurrun
09f6a45dc2 Remove non-existing stray arguments from Doxygen function documentation.
Originally committed as revision 23976 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-02 11:19:29 +00:00
Måns Rullgård
49bd8e4b84 Fix grammar errors in documentation
Originally committed as revision 23904 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-30 15:38:06 +00:00
Carl Eugen Hoyos
33e7febdbe Remove stray semicolon.
Originally committed as revision 23691 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-21 22:54:53 +00:00
Diego Biurrun
ba87f0801d Remove explicit filename from Doxygen @file commands.
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-20 14:45:34 +00:00
Stefano Sabatini
72415b2adb Define AVMediaType enum, and use it instead of enum CodecType, which
is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-30 23:30:55 +00:00
Ramiro Polla
85f273c7ca x11grab: AVFormatParameters are always passed from av_open_input_stream(),
there is no need to check for it.

Originally committed as revision 22651 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-23 23:35:36 +00:00
Carl Eugen Hoyos
3d1ebac8f7 Define _XOPEN_SOURCE as 600 before including a XSI extension header.
Originally committed as revision 20871 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-14 23:23:09 +00:00
Carl Eugen Hoyos
1f15747fc9 Use enum PixelFormat as type for input_pixfmt to avoid one icc warning.
Originally committed as revision 20859 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-12-14 10:52:32 +00:00
Michael Niedermayer
f6dcc93705 Add nomouse option to not record the mouse cursor.
Implements issue877

Originally committed as revision 20633 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-27 19:36:18 +00:00
Michael Niedermayer
a5a61fac3b Remove unused stuff.
Originally committed as revision 20632 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-27 18:56:30 +00:00
Roxis
781c1aa6dc Real cursor support in x11grab.
Patch by Roxis /// roxis list dot ru
Slight changes by me to update the patch to current svn.

Originally committed as revision 20631 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-11-27 17:58:48 +00:00