From: cedric Date: Fri, 24 Jun 2011 16:13:29 +0000 (+0000) Subject: emotion: keep last gstreamer buffer around as YUV data are not copied inside evas. X-Git-Tag: submit/2.0alpha-wayland/20121127.222018~249 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88d5d7a588b1680e1ba39042db4ebf805f986c96;p=profile%2Fivi%2Femotion.git emotion: keep last gstreamer buffer around as YUV data are not copied inside evas. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/emotion@60667 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/gstreamer/emotion_sink.c b/src/modules/gstreamer/emotion_sink.c index 65b8138..20f92b9 100644 --- a/src/modules/gstreamer/emotion_sink.c +++ b/src/modules/gstreamer/emotion_sink.c @@ -41,6 +41,8 @@ struct _EvasVideoSinkPrivate { GMutex* buffer_mutex; GCond* data_cond; + GstBuffer *last_buffer; /* We need to keep a copy of the last inserted buffer as evas doesn't copy YUV data around */ + // If this is TRUE all processing should finish ASAP // This is necessary because there could be a race between // unlock() and render(), where unlock() wins, signals the @@ -91,6 +93,7 @@ evas_video_sink_init(EvasVideoSink* sink, EvasVideoSinkClass* klass __UNUSED__) sink->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(sink, EVAS_TYPE_VIDEO_SINK, EvasVideoSinkPrivate); priv->o = NULL; priv->p = ecore_pipe_add(evas_video_sink_render_handler, sink); + priv->last_buffer = NULL; priv->width = 0; priv->height = 0; priv->format = GST_VIDEO_FORMAT_UNKNOWN; @@ -182,6 +185,11 @@ evas_video_sink_dispose(GObject* object) priv->p = NULL; } + if (priv->last_buffer) { + gst_buffer_unref(priv->last_buffer); + priv->last_buffer = NULL; + } + G_OBJECT_CLASS(parent_class)->dispose(object); } @@ -511,7 +519,8 @@ static void evas_video_sink_render_handler(void *data, _emotion_frame_resize(ev->obj, priv->width, priv->height, ev->ratio); exit_point: - gst_buffer_unref(buffer); + if (priv->last_buffer) gst_buffer_unref(priv->last_buffer); + priv->last_buffer = buffer; if (priv->preroll) return ;