avfvideosrc: check if low preset is available
authorMatthieu Bouron <matthieu.bouron@collabora.com>
Tue, 29 Oct 2013 15:36:06 +0000 (15:36 +0000)
committerAndoni Morales Alastruey <ylatuya@gmail.com>
Thu, 7 Nov 2013 14:24:28 +0000 (15:24 +0100)
sys/applemedia/avfvideosrc.m

index 9667f5e..f7f4b6d 100644 (file)
@@ -295,7 +295,8 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
       continue;
     }
 
-    gst_caps_append (result, GST_AVF_CAPS_NEW (gstformat, 192, 144));
+    if ([session canSetSessionPreset:AVCaptureSessionPresetLow])
+      gst_caps_append (result, GST_AVF_CAPS_NEW (gstformat, 192, 144));
     if ([session canSetSessionPreset:AVCaptureSessionPreset352x288])
       gst_caps_append (result, GST_AVF_CAPS_NEW (gstformat, 352, 288));
     if ([session canSetSessionPreset:AVCaptureSessionPresetMedium])