mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
applemedia/gl: Fix compile issues for OSX
https://bugzilla.gnome.org/show_bug.cgi?id=778333
This commit is contained in:
parent
2392ac7446
commit
82c132aa50
2 changed files with 11 additions and 0 deletions
|
@ -125,6 +125,7 @@ endif
|
||||||
libgstopengl_la_OBJCFLAGS = \
|
libgstopengl_la_OBJCFLAGS = \
|
||||||
-I$(top_srcdir)/gst-libs \
|
-I$(top_srcdir)/gst-libs \
|
||||||
-I$(top_builddir)/gst-libs \
|
-I$(top_builddir)/gst-libs \
|
||||||
|
-fobjc-arc \
|
||||||
$(GST_OBJCFLAGS) \
|
$(GST_OBJCFLAGS) \
|
||||||
$(GST_BASE_CFLAGS) \
|
$(GST_BASE_CFLAGS) \
|
||||||
$(GST_PLUGINS_BASE_CFLAGS) \
|
$(GST_PLUGINS_BASE_CFLAGS) \
|
||||||
|
|
|
@ -241,6 +241,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#if HAVE_IOS
|
||||||
|
|
||||||
static AVCaptureDeviceType GstAVFVideoSourceDeviceType2AVCaptureDeviceType(GstAVFVideoSourceDeviceType deviceType) {
|
static AVCaptureDeviceType GstAVFVideoSourceDeviceType2AVCaptureDeviceType(GstAVFVideoSourceDeviceType deviceType) {
|
||||||
switch (deviceType) {
|
switch (deviceType) {
|
||||||
case GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_BUILT_IN_WIDE_ANGLE_CAMERA:
|
case GST_AVF_VIDEO_SOURCE_DEVICE_TYPE_BUILT_IN_WIDE_ANGLE_CAMERA:
|
||||||
|
@ -281,6 +283,8 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
@implementation GstAVFVideoSrcImpl
|
@implementation GstAVFVideoSrcImpl
|
||||||
|
|
||||||
@synthesize deviceIndex, position, orientation, deviceType, doStats,
|
@synthesize deviceIndex, position, orientation, deviceType, doStats,
|
||||||
|
@ -332,6 +336,7 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
|
||||||
NSError *err;
|
NSError *err;
|
||||||
|
|
||||||
if (deviceIndex == DEFAULT_DEVICE_INDEX) {
|
if (deviceIndex == DEFAULT_DEVICE_INDEX) {
|
||||||
|
#ifdef HAVE_IOS
|
||||||
if (deviceType != DEFAULT_DEVICE_TYPE && position != DEFAULT_POSITION) {
|
if (deviceType != DEFAULT_DEVICE_TYPE && position != DEFAULT_POSITION) {
|
||||||
device = [AVCaptureDevice
|
device = [AVCaptureDevice
|
||||||
defaultDeviceWithDeviceType:GstAVFVideoSourceDeviceType2AVCaptureDeviceType(deviceType)
|
defaultDeviceWithDeviceType:GstAVFVideoSourceDeviceType2AVCaptureDeviceType(deviceType)
|
||||||
|
@ -340,6 +345,9 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
|
||||||
} else {
|
} else {
|
||||||
device = [AVCaptureDevice defaultDeviceWithMediaType:mediaType];
|
device = [AVCaptureDevice defaultDeviceWithMediaType:mediaType];
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
device = [AVCaptureDevice defaultDeviceWithMediaType:mediaType];
|
||||||
|
#endif
|
||||||
if (device == nil) {
|
if (device == nil) {
|
||||||
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
|
GST_ELEMENT_ERROR (element, RESOURCE, NOT_FOUND,
|
||||||
("No video capture devices found"), (NULL));
|
("No video capture devices found"), (NULL));
|
||||||
|
@ -434,8 +442,10 @@ static AVCaptureVideoOrientation GstAVFVideoSourceOrientation2AVCaptureVideoOrie
|
||||||
|
|
||||||
/* retained by session */
|
/* retained by session */
|
||||||
connection = [[output connections] firstObject];
|
connection = [[output connections] firstObject];
|
||||||
|
#ifdef HAVE_IOS
|
||||||
if (orientation != DEFAULT_ORIENTATION)
|
if (orientation != DEFAULT_ORIENTATION)
|
||||||
connection.videoOrientation = GstAVFVideoSourceOrientation2AVCaptureVideoOrientation(orientation);
|
connection.videoOrientation = GstAVFVideoSourceOrientation2AVCaptureVideoOrientation(orientation);
|
||||||
|
#endif
|
||||||
inputClock = ((AVCaptureInputPort *)connection.inputPorts[0]).clock;
|
inputClock = ((AVCaptureInputPort *)connection.inputPorts[0]).clock;
|
||||||
|
|
||||||
*successPtr = YES;
|
*successPtr = YES;
|
||||||
|
|
Loading…
Reference in a new issue