summaryrefslogtreecommitdiff
path: root/libavdevice/avfoundation.m
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2015-03-07 22:10:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-29 04:07:43 +0200
commit021b0237518100cee39241ef64596086af616375 (patch)
tree5e1c5eb11b77ae01494d19d89ef3bac6bcb447b8 /libavdevice/avfoundation.m
parentc908cae74cd1a16f8aebbfb4cd7b23288b029132 (diff)
downloadffmpeg-021b0237518100cee39241ef64596086af616375.tar.gz
libavdevice/avfoundation: add capture_mouse_clicks option
Support mouse clicks capture while recording a screen on OSX >= 10.7. Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/avfoundation.m')
-rw-r--r--libavdevice/avfoundation.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 84f49a69c2..52e686a97f 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -95,6 +95,7 @@ typedef struct
int width, height;
int capture_cursor;
+ int capture_mouse_clicks;
int list_devices;
int video_device_index;
@@ -742,6 +743,12 @@ static int avf_read_header(AVFormatContext *s)
}
#endif
+ if (ctx->capture_mouse_clicks) {
+ capture_screen_input.capturesMouseClicks = YES;
+ } else {
+ capture_screen_input.capturesMouseClicks = NO;
+ }
+
video_device = (AVCaptureDevice*) capture_screen_input;
capture_screen = 1;
#endif
@@ -785,6 +792,12 @@ static int avf_read_header(AVFormatContext *s)
capture_screen_input.capturesCursor = NO;
}
#endif
+
+ if (ctx->capture_mouse_clicks) {
+ capture_screen_input.capturesMouseClicks = YES;
+ } else {
+ capture_screen_input.capturesMouseClicks = NO;
+ }
}
}
#endif
@@ -1002,6 +1015,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 },
{ "video_size", "set video size", offsetof(AVFContext, width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
{ "capture_cursor", "capture the screen cursor", offsetof(AVFContext, capture_cursor), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+ { "capture_mouse_clicks", "capture the screen mouse clicks", offsetof(AVFContext, capture_mouse_clicks), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+
{ NULL },
};