diff --git a/sys/applemedia/videotexturecache.h b/sys/applemedia/videotexturecache.h index b9103a664c..0b43566c0b 100644 --- a/sys/applemedia/videotexturecache.h +++ b/sys/applemedia/videotexturecache.h @@ -40,7 +40,6 @@ typedef struct _GstVideoTextureCache gboolean configured; GstCaps *in_caps; GstCaps *out_caps; - GstGLColorConvert *convert; } GstVideoTextureCache; GstVideoTextureCache *gst_video_texture_cache_new (GstGLContext * ctx); diff --git a/sys/applemedia/videotexturecache.m b/sys/applemedia/videotexturecache.m index 68cb6978f7..3a5cf31e0f 100644 --- a/sys/applemedia/videotexturecache.m +++ b/sys/applemedia/videotexturecache.m @@ -48,8 +48,6 @@ gst_video_texture_cache_new (GstGLContext * ctx) cache->ctx = gst_object_ref (ctx); gst_video_info_init (&cache->input_info); - cache->convert = gst_gl_color_convert_new (cache->ctx); - cache->configured = FALSE; #if HAVE_IOS CFMutableDictionaryRef cache_attrs = @@ -82,7 +80,6 @@ gst_video_texture_cache_free (GstVideoTextureCache * cache) gst_object_unref (cache->pool); #endif #endif - gst_object_unref (cache->convert); gst_object_unref (cache->ctx); if (cache->in_caps) gst_caps_unref (cache->in_caps); @@ -112,7 +109,6 @@ gst_video_texture_cache_set_format (GstVideoTextureCache * cache, gst_caps_features_add (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY); gst_video_info_from_caps (&cache->input_info, in_caps); - cache->configured = FALSE; if (cache->in_caps) gst_caps_unref (cache->in_caps); if (cache->out_caps) @@ -271,34 +267,11 @@ _do_get_gl_buffer (GstGLContext * context, ContextThreadData * data) return; } - if (!cache->configured) { - cache->in_caps = gst_caps_make_writable (cache->in_caps); -#if HAVE_IOS - gst_caps_set_simple (cache->in_caps, "texture-target", G_TYPE_STRING, GST_GL_TEXTURE_TARGET_2D_STR, NULL); -#else - gst_caps_set_simple (cache->in_caps, "texture-target", G_TYPE_STRING, GST_GL_TEXTURE_TARGET_RECTANGLE_STR, NULL); -#endif - gst_caps_set_simple (cache->out_caps, "texture-target", G_TYPE_STRING, "2D", NULL); - - if (!gst_gl_color_convert_set_caps (cache->convert, cache->in_caps, cache->out_caps)) { - if (mem1) - gst_memory_unref (mem1); - if (mem2) - gst_memory_unref (mem2); - gst_buffer_unref (buffer); - - return; - } - - cache->configured = TRUE; - } - gst_buffer_append_memory (buffer, mem1); if (mem2) gst_buffer_append_memory (buffer, mem2); - data->output_buffer = gst_gl_color_convert_perform (cache->convert, buffer); - gst_buffer_unref (buffer); + data->output_buffer = buffer; } GstBuffer * diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c index bba3b28c0d..0e0836725a 100644 --- a/sys/applemedia/vtdec.c +++ b/sys/applemedia/vtdec.c @@ -108,17 +108,11 @@ const CFStringRef CFSTR ("RequireHardwareAcceleratedVideoDecoder"); #endif -#define GST_VTDEC_VIDEO_FORMAT_STR "NV12" - #define VIDEO_SRC_CAPS \ - "video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), " \ - "format = (string) RGBA, " \ - "width = " GST_VIDEO_SIZE_RANGE ", " \ - "height = " GST_VIDEO_SIZE_RANGE ", " \ - "framerate = " GST_VIDEO_FPS_RANGE ", " \ - "texture-target = (string) 2D " \ - " ; " \ - GST_VIDEO_CAPS_MAKE(GST_VTDEC_VIDEO_FORMAT_STR) ";" + GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_GL_MEMORY,\ + "NV12") ", " \ + "texture-target = (string) rectangle;" \ + GST_VIDEO_CAPS_MAKE("NV12") ";" G_DEFINE_TYPE (GstVtdec, gst_vtdec, GST_TYPE_VIDEO_DECODER); @@ -290,6 +284,10 @@ gst_vtdec_negotiate (GstVideoDecoder * decoder) output_textures = gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY); + if (output_textures) + gst_caps_set_simple (output_state->caps, + "texture-target", G_TYPE_STRING, GST_GL_TEXTURE_TARGET_RECTANGLE_STR, + NULL); } gst_caps_unref (caps);