gint i = 0;
for (i = 0; i < NEEDED_TEXTURES; i++) {
+
+ if (effects->midtexture[i]) {
+ gl->DeleteTextures (1, &effects->midtexture[i]);
+ effects->midtexture[i] = 0;
+ }
+
gl->GenTextures (1, &effects->midtexture[i]);
gl->BindTexture (GL_TEXTURE_2D, effects->midtexture[i]);
gl->TexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8,
out_width = GST_VIDEO_INFO_WIDTH (&vagg->info);
out_height = GST_VIDEO_INFO_HEIGHT (&vagg->info);
+ if (mix->fbo) {
+ gst_gl_context_del_fbo (mix->context, mix->fbo, mix->depthbuffer);
+ mix->fbo = 0;
+ mix->depthbuffer = 0;
+ }
+
if (!gst_gl_context_gen_fbo (mix->context, out_width, out_height,
&mix->fbo, &mix->depthbuffer))
goto context_error;
if (!gst_gl_context_check_framebuffer_status (convert->context)) {
gst_gl_context_set_error (convert->context,
"GL framebuffer status incomplete");
+
+ gl->DeleteTextures (1, &fake_texture);
+
return FALSE;
}
gst_gl_context_del_fbo (filter->context, filter->fbo,
filter->depthbuffer);
}
+
+ if (filter->in_tex_id) {
+ gst_gl_context_del_texture (filter->context, &filter->in_tex_id);
+ filter->in_tex_id = 0;
+ }
+
+ if (filter->out_tex_id) {
+ gst_gl_context_del_texture (filter->context, &filter->out_tex_id);
+ filter->out_tex_id = 0;
+ }
+
gst_object_unref (filter->context);
filter->context = NULL;
}
out_width = GST_VIDEO_INFO_WIDTH (&filter->out_info);
out_height = GST_VIDEO_INFO_HEIGHT (&filter->out_info);
+ if (filter->fbo) {
+ gst_gl_context_del_fbo (filter->context, filter->fbo, filter->depthbuffer);
+ filter->fbo = 0;
+ filter->depthbuffer = 0;
+ }
+
+ if (filter->in_tex_id) {
+ gst_gl_context_del_texture (filter->context, &filter->in_tex_id);
+ filter->in_tex_id = 0;
+ }
+
+ if (filter->out_tex_id) {
+ gst_gl_context_del_texture (filter->context, &filter->out_tex_id);
+ filter->out_tex_id = 0;
+ }
//blocking call, generate a FBO
if (!gst_gl_context_gen_fbo (filter->context, out_width, out_height,
&filter->fbo, &filter->depthbuffer))
if (gl->CheckFramebufferStatus (GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
gst_gl_context_set_error (frame->context,
"GL framebuffer status incomplete");
+
+ gl->DeleteTextures (1, &fake_texture);
+
return FALSE;
}