summaryrefslogtreecommitdiff
path: root/libavdevice/xcbgrab.c
Commit message (Collapse)AuthorAge
* avdevice/xcbgrab: check if frame size fits in INT_MAXMarton Balint2020-01-24
| | | | | | Also fixes a possible overflow and sets stream bitrate. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/xcbgrab: move some initialization code from ↵Marton Balint2020-01-24
| | | | | | pixfmt_from_pixmap_format to create_stream Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/xcbgrab: capture the full desktop if video_size is not specifiedMarton Balint2019-12-30
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/xcbgrab: fix packet timestampsMarton Balint2019-12-30
| | | | | | | Since 648b8cca6c56a4fa1760efc72dfe1363a5c6e31e and c991e9cd91845044e93a9c89dd25b48ae707461b timestamps were not set properly. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/xcbgrab: use a buffer pool for shared memory segmentsMarton Balint2019-12-26
| | | | | | | Also by wrapping the SHM buffer in an AVBufferRef we eliminate yet another possible memcpy improving performance. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/xcbgrab: wrap non-shm image replies in a buffer refMarton Balint2019-12-06
| | | | | | This avoids a memcpy improving performance if SHM is not used. Signed-off-by: Marton Balint <cus@passwd.hu>
* avdevice/xcbgrab: Handle reply and error properlyKusanagi Kouichi2019-12-03
| | | | | | | Fix a NULL dereference and leaks. Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavd/x11grab: fix vertical repositioningOctavio Alvarez2019-04-06
| | | | | | | | | | | | | | | | There is a calculation error in xcbgrab_reposition() that breaks vertical repositioning on follow_mouse. It made the bottom reposition occur when moving the mouse lower than N pixels after the capture bottom edge, instead of before. This commit fixes the calculation to match the documentation. follow_mouse: centered or number of pixels. The documentation says: When it is specified with "centered", the grabbing region follows the mouse pointer and keeps the pointer at the center of region; otherwise, the region follows only when the mouse pointer reaches within PIXELS (greater than zero) to the edge of region.
* avdevice: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit '67deba8a416d818f3d95aef0aa916589090396e2'Clément Bœsch2017-03-31
|\ | | | | | | | | | | | | * commit '67deba8a416d818f3d95aef0aa916589090396e2': Use avpriv_report_missing_feature() where appropriate Merged-by: Clément Bœsch <cboesch@gopro.com>
| * Use avpriv_report_missing_feature() where appropriateDiego Biurrun2016-11-08
| |
* | Merge commit '5ed4644d6de7f6112431dc2d9a5cfe9a0a75a688'Clément Bœsch2017-03-15
|\| | | | | | | | | | | | | * commit '5ed4644d6de7f6112431dc2d9a5cfe9a0a75a688': x11grab: Rename internal component to "xcbgrab" Merged-by: Clément Bœsch <u@pkh.me>
| * x11grab: Rename internal component to "xcbgrab"Diego Biurrun2016-07-29
| |
* | lavd/xcbgrab: do not try to create refcounted packets.Nicolas George2016-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The framework will allocate a buffer and copy the data to it, that takes time. But it avoids constently creating and destroyng the shared memory segment, and that saves more time. On my setup, from ~200 to ~300 FPS at full screen (1920×1200), from ~1400 to ~3300 at smaller size (640×480), similar to legacy x11grab and confirmed by others. Plus, shared memory segments are a scarce resource, allocating potentially many is a bad idea. Note: if the application were to drop all references to the buffer before the next call to av_read_frame(), then passing the shared memory segment as a refcounted buffer would be even more efficient, but it is hard to guarantee, and it does not happen with the ffmpeg command-line tool. Using a small number of preallocated buffers and resorting to a copy when the pool is exhausted would be a solution to get the better of both worlds.
* | Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '9200514ad8717c63f82101dc394f4378854325bf': lavf: replace AVStream.codec with AVStream.codecpar This has been a HUGE effort from: - Derek Buitenhuis <derek.buitenhuis@gmail.com> - Hendrik Leppkes <h.leppkes@gmail.com> - wm4 <nfxjfg@googlemail.com> - Clément Bœsch <clement@stupeflix.com> - James Almer <jamrial@gmail.com> - Michael Niedermayer <michael@niedermayer.cc> - Rostislav Pehlivanov <atomnuker@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
* | avdevice/xcbgrab: fix -Wunused-variableGanesh Ajjanagadde2015-09-19
| | | | | | | | | | | | | | | | | | This patch fixes a -Wunused-variable reported in e.g http://fate.ffmpeg.org/log.cgi?time=20150918194649&log=compile&slot=x86_64-debian-asan-144800. av_unused is used as opposed to a header guard for readability. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * xcbgrab: Explicitly include xcb/shape.hLuca Barbato2015-07-06
| | | | | | | | Found-By: Cheristheus
| * xcbgrab: Accept geometries matching the screen sizeNicolas George2015-05-06
| | | | | | | | Introduced in e8c4db0d4d077.
* | lavd/xcbgrab: fix comparison with screen size.Nicolas George2015-05-06
| | | | | | | | | | Signed-off-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e8c4db0d4d07738fed716b1d2f20c85aac944641'Michael Niedermayer2015-04-30
|\| | | | | | | | | | | | | * commit 'e8c4db0d4d07738fed716b1d2f20c85aac944641': xcbgrab: Validate the capture area Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Validate the capture areaLuca Barbato2015-04-30
| | | | | | | | | | | | And notify why the capture is impossible. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '82a10225f817b2612fdd2b23af9d4f0a3408df3b'Michael Niedermayer2015-04-30
|\| | | | | | | | | | | | | * commit '82a10225f817b2612fdd2b23af9d4f0a3408df3b': xcbgrab: Do not assume the non shm image data is always available Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Do not assume the non shm image data is always availableLuca Barbato2015-04-30
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'c201069fac9a76e6604f9d84d76a172434d62200'Michael Niedermayer2015-04-09
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * avdevice: Add missing header for NULL_IF_CONFIG_SMALLDiego Biurrun2015-04-09
| | | | | | | | Also reshuffle headers into canonical order where appropriate.
| * xcbgrab: Check av_strdup() allocationVittorio Giovara2015-03-12
| | | | | | | | Bug-Id: CID 1274038
* | Merge commit '5f5b78aca35d07c771f5c4c73a984be9fe04a0b8'Michael Niedermayer2015-03-08
|\| | | | | | | | | | | | | | | | | | | | | | | * commit '5f5b78aca35d07c771f5c4c73a984be9fe04a0b8': xcbgrab: Free the host string after checking the connection Conflicts: libavdevice/xcbgrab.c No change as the bug was not in FFmpeg Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Free the host string after checking the connectionLuca Barbato2015-03-08
| | | | | | | | | | | | | | Prevent an use after free in the error message. Bug-Id: CID 1274040 CC: libav-stable@libav.org
* | Merge commit '85b3b1c4ba7af9c2658442b0aafd27d613e1854b'Michael Niedermayer2015-02-25
|\| | | | | | | | | | | | | | | | | | | | | * commit '85b3b1c4ba7af9c2658442b0aafd27d613e1854b': xcbgrab: Unbreak parsing filename options Conflicts: libavdevice/xcbgrab.c See: db442c873631065e8719df6da91c016d25501084 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Unbreak parsing filename optionsLuca Barbato2015-02-24
| | | | | | | | | | | | CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'b31328d008985f87f0a7c83c700847cef1a4f08c'Michael Niedermayer2015-02-25
|\| | | | | | | | | | | | | | | | | | | | | * 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>
| * xcbgrab: Provide better names for the y and x optionLuca Barbato2015-02-24
| | | | | | | | | | | | | | | | | | | | 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>
| * xcbgrab: Use the correct geometry for the region highlightDaniel Moran2015-02-15
| | | | | | | | | | | | | | The feature is implemented using a transparent window and drawing inside it a rectangle filling the whole window to highlight it. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'd40815a982c36ff9da09ae3edb5e3bd7d97b5d42'Michael Niedermayer2015-02-15
|\| | | | | | | | | | | | | | | | | | | | | * commit 'd40815a982c36ff9da09ae3edb5e3bd7d97b5d42': xcbgrab: Correctly make shm optional Conflicts: libavdevice/xcbgrab.c See: 8c0ae9015a2bd8b3f4f92c35570e592e7fdeaef0 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Correctly make shm optionalLuca Barbato2015-02-15
| | | | | | | | | | The segment field in the struct has to be conditionally build as well.
* | Merge commit '9e06327ecb8f73c7904d10af7ad339c57cdaa788'Michael Niedermayer2014-12-19
|\| | | | | | | | | | | | | | | | | | | | | * commit '9e06327ecb8f73c7904d10af7ad339c57cdaa788': xcbgrab: Move NULL check before pointer dereference Conflicts: libavdevice/xcbgrab.c See: e86df0206f06b8d1e97e2b60db8f74a398d53127 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Move NULL check before pointer dereferenceVittorio Giovara2014-12-18
| | | | | | | | Bug-Id: CID 1254668
* | Merge commit '2c3f29c4894ee50635b846f202296ad79a7c0d33'Michael Niedermayer2014-12-10
|\| | | | | | | | | | | | | | | | | | | | | * commit '2c3f29c4894ee50635b846f202296ad79a7c0d33': xcbgrab: Support empty filename string correctly Conflicts: libavdevice/xcbgrab.c See: 62eca2f827d441f52125191fd78c96b67a7ba30c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * xcbgrab: Support empty filename string correctlyLuca Barbato2014-12-10
| | | | | | | | | | Bug-Id: CID 1254664 CC: libav-stable@libav.org
* | avdevice/xcbgrab: check xcb_query_pointer_reply_t pointer before useMichael Niedermayer2014-12-09
| | | | | | | | | | | | Fixes CID1254668 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix xcb 32bit pix_fmts: There is no screen transparency.Carl Eugen Hoyos2014-12-08
| |
* | avdevice/xcbgrab: Fix show_region rectangleDaniel Moran2014-12-07
| | | | | | | | | | | | | | | | | | Fixes trac ticket #4164 This is to address an error when using show_region, which would cause part of the captured area to become static. It looks like the rectangle specifying the capture area was relative to the capture window. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avdevice/xcbgrab: fix undefined reference to xcb_shape_rectangles in xcbgrab.cBoris Reisig2014-11-24
| | | | | | | | | | | | works with (--enable-libxcb-shape) and without (--disable-libxcb-shape) now. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avdevice/xcbgrab: Fix/remove unneeded NULL checksMichael Niedermayer2014-11-16
| | | | | | | | | | | | Fixes CID1254664 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avdevice/xcbgrab: Fix offset supportMichael Niedermayer2014-10-30
| | | | | | | | | | Found-by: carl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Fix compilation of xcbgrab if xcb/shape.h is not available.Carl Eugen Hoyos2014-10-30
| | | | | | | | | | | | | | | | | | Old versions of libxcb do not provide xcb_shape_rectangles(). The issue can be fixed differently but this small change fixes some fate platforms and a user reported compilation problem. Reported and tested by trac user kevmitch. Fixes ticket #4067.
* | Fix xcbgrab build if shm is not available.Carl Eugen Hoyos2014-10-30
| |