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.
This commit is contained in:
Alessandro Decina 2015-12-29 10:57:36 +11:00
parent 22a0914cce
commit bf86d7fef1

View file

@ -996,6 +996,7 @@ caps_filter_out_gl_memory (GstCapsFeatures * features, GstStructure * structure,
- (GstCaps *)fixate:(GstCaps *)new_caps - (GstCaps *)fixate:(GstCaps *)new_caps
{ {
GstGLContext *context; GstGLContext *context;
GstStructure *structure;
new_caps = gst_caps_make_writable (new_caps); new_caps = gst_caps_make_writable (new_caps);
@ -1005,6 +1006,13 @@ caps_filter_out_gl_memory (GstCapsFeatures * features, GstStructure * structure,
else else
gst_object_unref (context); 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); return gst_caps_fixate (new_caps);
} }