User may close X11 window by close button on tray.
FFmpeg leaves in graceless way.
This commit detects it and return EPIPE error.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.
Since v4l2 is compiled only on Linux where av_gettime_relative()
is monotonic, a small wrapper function av_gettime_monotonic() is used
(should be inlined the compiler) to put emphasis on that fact.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Device is able to use existing window, that can be a
part of existing GUI - instead of newly created one.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Functions allow to connect and disconnect from server.
Helpfull to implement utility functions with nested loops.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
class is reserved keyword in C++ and compilator complains about that variable.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
AVDeviceInfoList was allocated with first device set as default
even though there is no device after allocation.
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Provides API to query device capabilities.
Each device must implement callbacks to benefit from this API.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Based on original code by Christophe Gisquet in 2010, updated to work
with current ffmpeg APIs.
Supports grabbing a single window or an area of the screen, including
support for multiple monitors (Windows does funky stuff with negative
coordinates here).
I've moved most of the configuration to AVOptions; the input file name
is now only the string "desktop", or "title=<windowname>" to select a
single window. The AVOptions are the same as x11grab where possible.
Code has been added to support a "show_region" mode, like x11grab, which
will draw a rectangle on the screen around the area being captured.
Instead of duplicating code for paletted image handling, I make use of
the GDI API's ability to output DIB (BMP) images, which can be run
through ffmpeg's existing BMP decoder.
Signed-off-by: Calvin Walton <calvin.walton@kepstin.ca>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>