summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <reynaldo@collabora.com>2012-08-14 10:44:51 -0400
committerReynaldo H. Verdejo Pinochet <reynaldo@collabora.com>2012-08-15 01:13:35 -0400
commitc34bf0ae7dceb2f749a259e26e28cae1ffd56078 (patch)
tree1c16fead1ecf38f8dc5221ec127071d6413f423c
parent5f49d4e39b48958ca71ea5aabd17f479d393a316 (diff)
Quick safeguard on context prevalence
-rw-r--r--sys/android/gstvidroidsink.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/android/gstvidroidsink.c b/sys/android/gstvidroidsink.c
index 0c37e9ba7..ad90763d6 100644
--- a/sys/android/gstvidroidsink.c
+++ b/sys/android/gstvidroidsink.c
@@ -736,8 +736,10 @@ gst_vidroidsink_stop (GstBaseSink * sink)
{
GstViDroidSink *vidroidsink = GST_VIDROIDSINK (sink);
+ platform_destroy_native_window (vidroidsink->display, vidroidsink->window);
g_mutex_free (vidroidsink->flow_lock);
vidroidsink->flow_lock = NULL;
+
return TRUE;
}
@@ -1060,6 +1062,14 @@ gst_vidroidsink_render_and_display (GstViDroidSink * vidroidsink,
"Got good buffer %x. Sink geometry is %dx%d size %d", buf, w, h,
GST_BUFFER_SIZE (buf));
+ /* Make sure we stay on our context to avoid threading nightmares */
+ if (!eglMakeCurrent (vidroidsink->display, vidroidsink->surface,
+ vidroidsink->surface, vidroidsink->context)) {
+ GST_ERROR_OBJECT (vidroidsink, "Couldn't bind surface/context, "
+ "eglMakeCurrent");
+ goto HANDLE_ERROR;
+ }
+
/* XXX: This should actually happen each time
* frame/window dimension changes.
* Also might want to find a way to pass buffer's