applemedia: videotesturecache: let CVOpenGLESTextureCache flush every 1s
authorAlessandro Decina <alessandro.d@gmail.com>
Wed, 10 Feb 2016 04:40:02 +0000 (15:40 +1100)
committerAlessandro Decina <alessandro.d@gmail.com>
Wed, 10 Feb 2016 04:40:02 +0000 (15:40 +1100)
Leave kCVOpenGLESTextureCacheMaximumTextureAgeKey to the default (1s). We used
to set it to 0 and flush manually, but apparently (looking at the GLES profiler)
0 means "disable the cache entirely".

sys/applemedia/videotexturecache.m

index 1675d21af0c2d0ebe82451500c9ee6cb894e3e67..e1bdb64d2f681e66c76abd474fd11418b5866022 100644 (file)
@@ -53,8 +53,6 @@ gst_video_texture_cache_new (GstGLContext * ctx)
   CFMutableDictionaryRef cache_attrs =
       CFDictionaryCreateMutable (NULL, 0, &kCFTypeDictionaryKeyCallBacks,
       &kCFTypeDictionaryValueCallBacks);
-  gst_vtutil_dict_set_i32 (cache_attrs,
-      kCVOpenGLESTextureCacheMaximumTextureAgeKey, 0);
   CVOpenGLESTextureCacheCreate (kCFAllocatorDefault, (CFDictionaryRef) cache_attrs,
       (CVEAGLContext) gst_gl_context_get_gl_context (ctx), NULL, &cache->cache);
 #else
@@ -160,8 +158,6 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data)
   output_buffer = gst_buffer_new ();
   gst_buffer_copy_into (output_buffer, data->input_buffer, GST_BUFFER_COPY_ALL, 0, -1);
 
-  CVOpenGLESTextureCacheFlush (cache->cache, 0);
-
   switch (GST_VIDEO_INFO_FORMAT (&cache->input_info)) {
       case GST_VIDEO_FORMAT_BGRA:
         /* avfvideosrc does BGRA on iOS when doing GLMemory */