summaryrefslogtreecommitdiff
path: root/cogl-gst/cogl-gst-video-sink.c
diff options
context:
space:
mode:
Diffstat (limited to 'cogl-gst/cogl-gst-video-sink.c')
-rw-r--r--cogl-gst/cogl-gst-video-sink.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index 31891ea2..f70a01e9 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -39,6 +39,8 @@
#include <gst/riff/riff-ids.h>
#include <string.h>
+#include "cogl-gtype-private.h"
+
/* We just need the public Cogl api for cogl-gst but we first need to
* undef COGL_COMPILATION to avoid getting an error that normally
* checks cogl.h isn't used internally. */
@@ -175,6 +177,34 @@ struct _CoglGstVideoSinkPrivate
GstVideoInfo info;
};
+/* GTypes */
+
+static gpointer
+cogl_gst_rectangle_copy (gpointer src)
+{
+ if (G_LIKELY (src))
+ {
+ CoglGstRectangle *new = g_slice_new (CoglGstRectangle);
+ memcpy (new, src, sizeof (CoglGstRectangle));
+ return new;
+ }
+ else
+ return NULL;
+}
+
+static void
+cogl_gst_rectangle_free (gpointer ptr)
+{
+ g_slice_free (CoglGstRectangle, ptr);
+}
+
+COGL_GTYPE_DEFINE_BOXED (GstRectangle,
+ gst_rectangle,
+ cogl_gst_rectangle_copy,
+ cogl_gst_rectangle_free);
+
+/**/
+
static void
cogl_gst_source_finalize (GSource *source)
{