summaryrefslogtreecommitdiff
path: root/sys/applemedia
diff options
context:
space:
mode:
authorNick Kallen <nickkallen@me.com>2017-03-08 14:16:43 +0100
committerSebastian Dröge <sebastian@centricular.com>2017-03-08 15:23:42 +0200
commit82c132aa508d5acfa038b509bd6a7f7963118c5f (patch)
treefe3a00cd24fad785b818e968c0225c4e8b354497 /sys/applemedia
parent2392ac7446af1f9f8837562b0249662a23d6634f (diff)
applemedia/gl: Fix compile issues for OSX
https://bugzilla.gnome.org/show_bug.cgi?id=778333
Diffstat (limited to 'sys/applemedia')
-rw-r--r--sys/applemedia/avfvideosrc.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m
index a362f6a8e..c4f3e7e4a 100644
--- a/sys/applemedia/avfvideosrc.m
+++ b/sys/applemedia/avfvideosrc.m
@@ -241,6 +241,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
@end
+#if HAVE_IOS
+
static AVCaptureDeviceType GstAVFVideoSourceDeviceType2AVCaptureDeviceType(GstAVFVideoSourceDeviceType deviceType) {
switch (deviceType) {
case GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_BUILT_IN_WIDE_ANGLE_CAMERA:
@@ -281,6 +283,8 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
}
}
+#endif
+
@implementation GstAVFVideoSrcImpl
@synthesize deviceIndex, position, orientation, deviceType, doStats,
@@ -332,6 +336,7 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
NSError *err;
if (deviceIndex == DEFAULT_DEVICE_INDEX) {
+#ifdef HAVE_IOS
if (deviceType != DEFAULT_DEVICE_TYPE && position != DEFAULT_POSITION) {
device = [AVCaptureDevice
defaultDeviceWithDeviceType:GstAVFVideoSourceDeviceType2AVCaptureDeviceType(deviceType)
@@ -340,6 +345,9 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
} else {
device = [AVCaptureDevice defaultDeviceWithMediaType:mediaType];
}
+#else
+ device = [AVCaptureDevice defaultDeviceWithMediaType:mediaType];
+#endif
if (device == nil) {
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
("No video capture devices found"), (NULL));
@@ -434,8 +442,10 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
/* retained by session */
connection = [[output connections] firstObject];
+#ifdef HAVE_IOS
if (orientation != DEFAULT_ORIENTATION)
connection.videoOrientation = GstAVFVideoSourceOrientation2AVCaptureVideoOrientation(orientation);
+#endif
inputClock = ((AVCaptureInputPort *)connection.inputPorts[0]).clock;
*successPtr = YES;