[Cogl] [PATCH 08/13] cogl-gst: video-sink: add shutdown method on renderers
Lionel Landwerlin
llandwerlin at gmail.com
Mon Dec 9 03:17:55 PST 2013
---
cogl-gst/cogl-gst-video-sink.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index 5bbb266..fd6c18d 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -157,6 +157,7 @@ typedef struct _CoglGstRenderer
CoglPipeline *pipeline);
CoglBool (*upload) (CoglGstVideoSink *sink,
GstBuffer *buffer);
+ void (*shutdown) (CoglGstVideoSink *sink);
} CoglGstRenderer;
struct _CoglGstVideoSinkPrivate
@@ -431,6 +432,15 @@ clear_frame_textures (CoglGstVideoSink *sink)
priv->frame_dirty = TRUE;
}
+/**/
+
+static void
+cogl_gst_dummy_shutdown (CoglGstVideoSink *sink)
+{
+}
+
+/**/
+
static void
cogl_gst_rgb_setup_pipeline (CoglGstVideoSink *sink,
CoglPipeline *pipeline)
@@ -576,6 +586,7 @@ static CoglGstRenderer rgb24_renderer =
{ COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR, },
cogl_gst_rgb_setup_pipeline,
cogl_gst_rgb24_upload,
+ cogl_gst_dummy_shutdown,
};
static CoglBool
@@ -625,6 +636,7 @@ static CoglGstRenderer rgb32_renderer =
{ COGL_PIPELINE_FILTER_LINEAR_MIPMAP_LINEAR, COGL_PIPELINE_FILTER_LINEAR, },
cogl_gst_rgb_setup_pipeline,
cogl_gst_rgb32_upload,
+ cogl_gst_dummy_shutdown,
};
static CoglBool
@@ -784,6 +796,7 @@ static CoglGstRenderer yv12_glsl_renderer =
},
cogl_gst_yv12_glsl_setup_pipeline,
cogl_gst_yv12_upload,
+ cogl_gst_dummy_shutdown,
};
static CoglGstRenderer i420_glsl_renderer =
@@ -800,6 +813,7 @@ static CoglGstRenderer i420_glsl_renderer =
},
cogl_gst_yv12_glsl_setup_pipeline,
cogl_gst_i420_upload,
+ cogl_gst_dummy_shutdown,
};
static void
@@ -885,6 +899,7 @@ static CoglGstRenderer ayuv_glsl_renderer =
},
cogl_gst_ayuv_glsl_setup_pipeline,
cogl_gst_ayuv_upload,
+ cogl_gst_dummy_shutdown,
};
/**/
@@ -989,6 +1004,7 @@ static CoglGstRenderer nv12_glsl_renderer =
},
cogl_gst_nv12_glsl_setup_pipeline,
cogl_gst_nv12_upload,
+ cogl_gst_dummy_shutdown,
};
/**/
@@ -1381,6 +1397,11 @@ cogl_gst_video_sink_dispose (GObject *object)
clear_frame_textures (self);
+ if (priv->renderer) {
+ priv->renderer->shutdown (self);
+ priv->renderer = NULL;
+ }
+
if (priv->pipeline)
{
cogl_object_unref (priv->pipeline);
--
1.8.5
More information about the Cogl
mailing list