Browse Source

Fix mac-avcapture compilation with OSX SDK version < 10.9

Palana 11 năm trước cách đây
mục cha
commit
c57d883506

+ 8 - 0
plugins/mac-avcapture/AVCaptureInputPort+PreMavericksCompat.h

@@ -0,0 +1,8 @@
+#import <AVFoundation/AVFoundation.h>
+
+#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && \
+				__MAC_OS_X_VERSION_MAX_ALLOWED < 1090
+@interface AVCaptureInputPort (PreMavericksCompat)
+@property(nonatomic, readonly) CMClockRef clock;
+@end
+#endif

+ 1 - 1
plugins/mac-avcapture/CMakeLists.txt

@@ -15,7 +15,7 @@ include_directories(${AVFOUNDATION}
 		    ${COCOA})
 
 set(mac-avcapture_HEADERS
-	)
+	AVCaptureInputPort+PreMavericksCompat.h)
 
 set(mac-avcapture_SOURCES
 	av-capture.m

+ 2 - 0
plugins/mac-avcapture/av-capture.m

@@ -6,6 +6,8 @@
 #include <obs.h>
 #include <media-io/video-io.h>
 
+#import "AVCaptureInputPort+PreMavericksCompat.h"
+
 #define MILLI_TIMESCALE 1000
 #define MICRO_TIMESCALE (MILLI_TIMESCALE * 1000)
 #define NANO_TIMESCALE  (MICRO_TIMESCALE * 1000)