Commit 5da9f87a authored by jehan's avatar jehan

add AVFoundation capture card for Macosx

parent f4731200
......@@ -494,7 +494,7 @@ if(APPLE)
list(APPEND LINK_FLAGS "-framework Carbon" "-framework AudioUnit")
endif()
if(ENABLE_VIDEO)
list(APPEND LINK_FLAGS "-framework Cocoa" "-framework OpenGL" "-framework QuartzCore" "-framework QTKit")
list(APPEND LINK_FLAGS "-framework Cocoa" "-framework OpenGL" "-framework QuartzCore" "-framework AVFoundation")
if(ENABLE_VT_H264)
list(APPEND LINK_FLAGS "-framework VideoToolbox -framework CoreMedia")
endif()
......
......@@ -309,16 +309,8 @@ if(ENABLE_VIDEO)
else()
list(APPEND VOIP_SOURCE_FILES_OBJC
videofilters/msosxdisplay.m
videofilters/avfound-capture.m
)
find_path(QTKIT_FOUND HINTS ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks NAMES QTKit/QTKit.h NO_CMAKE_SYSTEM_PATH)
if (QTKIT_FOUND)
list(APPEND VOIP_SOURCE_FILES_OBJC
videofilters/qtcapture.m
)
add_definitions(-DHAVE_QTKIT)
else()
message("QTKIT not found, disabling old fashion capture")
endif()
list(APPEND VOIP_SOURCE_FILES_C
utils/opengles_display.c
......
This diff is collapsed.
......@@ -135,6 +135,18 @@ static void h264_enc_configure(VTH264EncCtx *ctx) {
value = CFNumberCreate(NULL, kCFNumberFloatType, &ctx->conf.fps);
VTSessionSetProperty(ctx->session, kVTCompressionPropertyKey_ExpectedFrameRate, value);
int bytes_per_seconds = ctx->conf.required_bitrate/8 * 2; /*allow to have 2 times the average bitrate in one second*/
CFNumberRef bytes = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &bytes_per_seconds);
int dur= 1;
CFNumberRef duration = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &dur);
CFMutableArrayRef data_rate_limits = CFArrayCreateMutable(kCFAllocatorDefault, 2, &kCFTypeArrayCallBacks);
CFArrayAppendValue(data_rate_limits, bytes);
CFArrayAppendValue(data_rate_limits, duration);
VTSessionSetProperty(ctx->session, kVTCompressionPropertyKey_DataRateLimits, data_rate_limits);
CFRelease(bytes);
CFRelease(duration);
CFRelease(data_rate_limits);
value = CFNumberCreate(NULL, kCFNumberIntType, &delay_count);
if (VTSessionSetProperty(ctx->session, kVTCompressionPropertyKey_MaxFrameDelayCount, value) != 0){
ms_error("Could not set kVTCompressionPropertyKey_MaxFrameDelayCount");
......
......@@ -198,7 +198,7 @@ extern MSWebCamDesc ms_directx_cam_desc;
extern MSWebCamDesc ms_dshow_cam_desc;
#endif
#if HAVE_QTKIT
#if TARGET_OS_OSX
extern MSWebCamDesc ms_v4m_cam_desc;
#endif
......@@ -236,7 +236,7 @@ static MSWebCamDesc * ms_web_cam_descs[]={
#if defined(__MINGW32__) || defined (HAVE_DIRECTSHOW)
&ms_dshow_cam_desc,
#endif
#if HAVE_QTKIT
#if TARGET_OS_OSX
&ms_v4m_cam_desc,
#endif
#ifdef __QNX__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment