applemedia: avfvideosrc: output at highest fps/resolution by default
authorAlessandro Decina <alessandro.d@gmail.com>
Mon, 28 Dec 2015 23:57:36 +0000 (10:57 +1100)
committerAlessandro Decina <alessandro.d@gmail.com>
Mon, 28 Dec 2015 23:57:36 +0000 (10:57 +1100)
Fixate to the highest possible resolution and fps. Otherwise by default we end
up fixating at 2fps and the lowest supported resolution, which is hardly what
someone who bought an overpriced smartphone wants.

sys/applemedia/avfvideosrc.m

index 075adffec25b08331591b92325a810c0277faf44..455fd2f0ae07455afc4d4117804e557d47a7769b 100644 (file)
@@ -996,6 +996,7 @@ caps_filter_out_gl_memory (GstCapsFeatures * features, GstStructure * structure,
 - (GstCaps *)fixate:(GstCaps *)new_caps
 {
   GstGLContext *context;
+  GstStructure *structure;
 
   new_caps = gst_caps_make_writable (new_caps);
 
@@ -1005,6 +1006,13 @@ caps_filter_out_gl_memory (GstCapsFeatures * features, GstStructure * structure,
   else
     gst_object_unref (context);
 
+  new_caps = gst_caps_truncate (new_caps);
+  structure = gst_caps_get_structure (new_caps, 0);
+  /* crank up to 11. This is what the presets do, but we don't use the presets
+   * in ios >= 7.0 */
+  gst_structure_fixate_field_nearest_int (structure, "height", G_MAXINT);
+  gst_structure_fixate_field_nearest_fraction (structure, "framerate", G_MAXINT, 1);
+
   return gst_caps_fixate (new_caps);
 }