#if HAVE_IOS
return NO;
#else
+ GST_DEBUG_OBJECT (element, "Opening screen input");
+
AVCaptureScreenInput *screenInput =
[[AVCaptureScreenInput alloc] initWithDisplayID:displayId];
{
BOOL success = NO, *successPtr = &success;
+ GST_DEBUG_OBJECT (element, "Opening device");
+
dispatch_sync (mainQueue, ^{
BOOL ret;
*successPtr = YES;
});
+ GST_DEBUG_OBJECT (element, "Opening device %s", success ? "succeed" : "failed");
+
return success;
}
- (void)closeDevice
{
+ GST_DEBUG_OBJECT (element, "Closing device");
+
dispatch_sync (mainQueue, ^{
g_assert (![session isRunning]);
gst_format = GST_VIDEO_FORMAT_YUY2;
break;
default:
- GST_DEBUG ("Pixel format %s is not handled by avfvideosrc", [[pixel_format stringValue] UTF8String]);
+ GST_LOG_OBJECT (element, "Pixel format %s is not handled by avfvideosrc",
+ [[pixel_format stringValue] UTF8String]);
break;
}
NSArray *formats = [device valueForKey:@"formats"];
NSArray *pixel_formats = output.availableVideoCVPixelFormatTypes;
+ GST_DEBUG_OBJECT (element, "Getting device caps");
+
for (AVCaptureDeviceFormat *f in [formats reverseObjectEnumerator]) {
CMFormatDescriptionRef formatDescription = f.formatDescription;
CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(formatDescription);
}
}
}
+ GST_LOG_OBJECT (element, "Device returned the following caps %" GST_PTR_FORMAT, result);
return YES;
}
NSArray *formats = [device valueForKey:@"formats"];
gst_util_fraction_to_double (info->fps_n, info->fps_d, &framerate);
+ GST_DEBUG_OBJECT (element, "Setting device caps");
+
if ([device lockForConfiguration:NULL] == YES) {
for (AVCaptureDeviceFormat *f in formats) {
CMFormatDescriptionRef formatDescription = f.formatDescription;
if ([session canSetSessionPreset:AVCaptureSessionPresetLow])
gst_caps_append (result, GST_AVF_CAPS_NEW (gst_format, 192, 144, DEVICE_FPS_N, DEVICE_FPS_D));
}
+
+ GST_LOG_OBJECT (element, "Session presets returned the following caps %" GST_PTR_FORMAT, result);
+
return YES;
}
- (BOOL)setSessionPresetCaps:(GstVideoInfo *)info;
{
+ GST_DEBUG_OBJECT (element, "Setting session presset caps");
if ([device lockForConfiguration:NULL] != YES) {
GST_WARNING ("Couldn't lock device for configuration");