[FFmpeg-devel] [PATCH 3/4] libavdevice/avfoundation: add capture_screen_mouse_clicks option
Thilo Borgmann
thilo.borgmann at mail.de
Sat Mar 21 18:42:57 CET 2015
Am 18.03.15 um 09:37 schrieb Matthieu Bouron:
> On Fri, Mar 13, 2015 at 8:16 PM, <matthieu.bouron at gmail.com> wrote:
>
>> From: Matthieu Bouron <matthieu.bouron at gmail.com>
>>
>> Support mouse clicks capture while recording a screen on OSX >= 10.7.
>> ---
>> libavdevice/avfoundation.m | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
>> index e574518..8112229 100644
>> --- a/libavdevice/avfoundation.m
>> +++ b/libavdevice/avfoundation.m
>> @@ -95,6 +95,7 @@ typedef struct
>> int width, height;
>>
>> int capture_screen_cursor;
>> + int capture_screen_mouse_clicks;
>>
>> int list_devices;
>> int video_device_index;
>> @@ -715,6 +716,12 @@ static int avf_read_header(AVFormatContext *s)
>> }
>> #endif
>>
>> + if (ctx->capture_screen_mouse_clicks) {
>> + capture_screen_input.capturesMouseClicks = YES;
>> + } else {
>> + capture_screen_input.capturesMouseClicks = NO;
>> + }
>> +
>> video_device = (AVCaptureDevice*) capture_screen_input;
>> capture_screen = 1;
>> #endif
>> @@ -758,6 +765,12 @@ static int avf_read_header(AVFormatContext *s)
>> capture_screen_input.capturesCursor = NO;
>> }
>> #endif
>> +
>> + if (ctx->capture_screen_mouse_clicks) {
>> + capture_screen_input.capturesMouseClicks = YES;
>> + } else {
>> + capture_screen_input.capturesMouseClicks = NO;
>> + }
>> }
>> }
>> #endif
>> @@ -975,6 +988,8 @@ static const AVOption options[] = {
>> { "framerate", "set frame rate", offsetof(AVFContext, framerate),
>> AV_OPT_TYPE_VIDEO_RATE, {.str = "ntsc"}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
>> { "size", "set video size", offsetof(AVFContext, width),
>> AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
>> { "capture_screen_cursor", "capture the screen cursor",
>> offsetof(AVFContext, capture_screen_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0,
>> 1, AV_OPT_FLAG_DECODING_PARAM },
>> + { "capture_screen_mouse_clicks", "capture the screen mouse clicks",
>> offsetof(AVFContext, capture_screen_mouse_clicks), AV_OPT_TYPE_INT,
>> {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
>> +
>> { NULL },
>> };
>>
>> --
>> 2.3.2
>>
>>
> ping
Ok if tested.
-Thilo
More information about the ffmpeg-devel
mailing list