From bf86d7fef1de204eec08b18e1aebb8fc5797b220 Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 29 Dec 2015 10:57:36 +1100 Subject: [PATCH] applemedia: avfvideosrc: output at highest fps/resolution by default 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/applemedia/avfvideosrc.m b/sys/applemedia/avfvideosrc.m index 075adffec2..455fd2f0ae 100644 --- a/sys/applemedia/avfvideosrc.m +++ b/sys/applemedia/avfvideosrc.m @@ -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); }