[clutter-gst] content: add set_frame()
- From: Lionel Landwerlin <llandwerlin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter-gst] content: add set_frame()
- Date: Sun, 7 Dec 2014 00:02:18 +0000 (UTC)
commit 98a86e242f55ec9eb649dddf19c1f904e2df7a36
Author: Lionel Landwerlin <llandwerlin gmail com>
Date: Sat Dec 6 21:54:15 2014 +0000
content: add set_frame()
clutter-gst/clutter-gst-content.c | 58 ++++++++++++++++++++++++++++++++
clutter-gst/clutter-gst-content.h | 3 ++
doc/reference/clutter-gst-sections.txt | 1 +
3 files changed, 62 insertions(+), 0 deletions(-)
---
diff --git a/clutter-gst/clutter-gst-content.c b/clutter-gst/clutter-gst-content.c
index 3c625c7..82dee44 100644
--- a/clutter-gst/clutter-gst-content.c
+++ b/clutter-gst/clutter-gst-content.c
@@ -69,6 +69,7 @@ enum
{
PROP_0,
+ PROP_FRAME,
PROP_SINK,
PROP_PLAYER,
PROP_PAINT_FRAME,
@@ -281,6 +282,30 @@ content_set_sink (ClutterGstContent *self,
g_object_notify (G_OBJECT (self), "sink");
}
+static void
+content_set_frame (ClutterGstContent *self,
+ ClutterGstFrame *frame)
+{
+ ClutterGstContentPrivate *priv = self->priv;
+
+ if (!frame)
+ {
+ if (priv->current_frame)
+ {
+ g_boxed_free (CLUTTER_GST_TYPE_FRAME, priv->current_frame);
+ priv->current_frame = NULL;
+
+ clutter_content_invalidate (CLUTTER_CONTENT (self));
+ }
+ return;
+ }
+
+ update_frame (self, frame);
+
+ if (CLUTTER_GST_CONTENT_GET_CLASS (self)->has_painting_content (self))
+ clutter_content_invalidate (CLUTTER_CONTENT (self));
+}
+
static gboolean
clutter_gst_content_get_preferred_size (ClutterContent *content,
gfloat *width,
@@ -414,6 +439,10 @@ clutter_gst_content_set_property (GObject *object,
switch (prop_id)
{
+ case PROP_FRAME:
+ content_set_frame (self, g_value_get_boxed (value));
+ break;
+
case PROP_SINK:
content_set_sink (self, g_value_get_object (value), FALSE);
break;
@@ -447,6 +476,10 @@ clutter_gst_content_get_property (GObject *object,
switch (prop_id)
{
+ case PROP_FRAME:
+ g_value_set_boxed (value, priv->current_frame);
+ break;
+
case PROP_SINK:
g_value_set_object (value, priv->sink);
break;
@@ -512,6 +545,13 @@ clutter_gst_content_class_init (ClutterGstContentClass *klass)
G_TYPE_OBJECT,
G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
+ props[PROP_FRAME] =
+ g_param_spec_boxed ("frame",
+ "ClutterGst Frame",
+ "ClutterGst Frame",
+ CLUTTER_GST_TYPE_FRAME,
+ G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE);
+
props[PROP_SINK] =
g_param_spec_object ("sink",
"Cogl Video Sink",
@@ -615,6 +655,24 @@ clutter_gst_content_get_frame (ClutterGstContent *self)
}
/**
+ * clutter_gst_content_set_frame:
+ * @self: A #ClutterGstContent
+ * @frame: A #ClutterGstFrame
+ *
+ * Set the current frame.
+ *
+ * Since: 3.0
+ */
+void
+clutter_gst_content_set_frame (ClutterGstContent *self,
+ ClutterGstFrame *frame)
+{
+ g_return_if_fail (CLUTTER_GST_IS_CONTENT (self));
+
+ content_set_frame (self, frame);
+}
+
+/**
* clutter_gst_content_get_overlays:
* @self: A #ClutterGstContent
*
diff --git a/clutter-gst/clutter-gst-content.h b/clutter-gst/clutter-gst-content.h
index dfd0633..9175e3f 100644
--- a/clutter-gst/clutter-gst-content.h
+++ b/clutter-gst/clutter-gst-content.h
@@ -87,6 +87,9 @@ ClutterContent * clutter_gst_content_new_with_sink (ClutterGstVideoSink
ClutterGstFrame * clutter_gst_content_get_frame (ClutterGstContent *self);
+void clutter_gst_content_set_frame (ClutterGstContent *self,
+ ClutterGstFrame *frame);
+
ClutterGstOverlays * clutter_gst_content_get_overlays (ClutterGstContent *self);
void clutter_gst_content_set_sink (ClutterGstContent *self,
diff --git a/doc/reference/clutter-gst-sections.txt b/doc/reference/clutter-gst-sections.txt
index 3723c5f..9e9bd26 100644
--- a/doc/reference/clutter-gst-sections.txt
+++ b/doc/reference/clutter-gst-sections.txt
@@ -39,6 +39,7 @@ clutter_gst_content_new_with_sink
clutter_gst_content_get_frame
clutter_gst_content_get_player
clutter_gst_content_get_sink
+clutter_gst_content_set_frame
clutter_gst_content_set_player
clutter_gst_content_set_sink
clutter_gst_content_get_overlays
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]