diff options
author | Matthieu Bouron <matthieu.bouron@gmail.com> | 2015-03-07 22:01:03 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-29 03:50:31 +0200 |
commit | c908cae74cd1a16f8aebbfb4cd7b23288b029132 (patch) | |
tree | 15a9f346dac9c4e2c6ed4c8773b4202086386541 /libavdevice/avfoundation.m | |
parent | 573a77a1b6f5b8929f06462f1cf8d1633f400fef (diff) | |
download | ffmpeg-c908cae74cd1a16f8aebbfb4cd7b23288b029132.tar.gz |
libavdevice/avfoundation: add capture_cursor option
Add support for cursor capturing while recording a screen for OSX >=
10.8.
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.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m index 7b7cd68ab4..84f49a69c2 100644 --- a/libavdevice/avfoundation.m +++ b/libavdevice/avfoundation.m @@ -94,6 +94,8 @@ typedef struct AVRational framerate; int width, height; + int capture_cursor; + int list_devices; int video_device_index; int video_stream_index; @@ -732,6 +734,14 @@ static int avf_read_header(AVFormatContext *s) capture_screen_input.minFrameDuration = CMTimeMake(ctx->framerate.den, ctx->framerate.num); } +#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 + if (ctx->capture_cursor) { + capture_screen_input.capturesCursor = YES; + } else { + capture_screen_input.capturesCursor = NO; + } +#endif + video_device = (AVCaptureDevice*) capture_screen_input; capture_screen = 1; #endif @@ -767,6 +777,14 @@ static int avf_read_header(AVFormatContext *s) if (ctx->framerate.num > 0) { capture_screen_input.minFrameDuration = CMTimeMake(ctx->framerate.den, ctx->framerate.num); } + +#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 + if (ctx->capture_cursor) { + capture_screen_input.capturesCursor = YES; + } else { + capture_screen_input.capturesCursor = NO; + } +#endif } } #endif @@ -983,6 +1001,7 @@ static const AVOption options[] = { { "pixel_format", "set pixel format", offsetof(AVFContext, pixel_format), AV_OPT_TYPE_PIXEL_FMT, {.i64 = AV_PIX_FMT_YUV420P}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM}, { "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 }, { NULL }, }; |