diff options
author | Lionel Landwerlin <llandwerlin@gmail.com> | 2014-01-12 03:49:18 +0000 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2014-02-09 20:01:27 +0000 |
commit | d086fac04358566376d559115a0a295a7e464864 (patch) | |
tree | de51d2e471984c0db49e1339ac32ef594bfaeb23 | |
parent | 879425b83d774cd2f021b3e238003713e7158381 (diff) | |
download | cogl-lionel/introspection-next.tar.gz |
cogl-gst: add gtype definition for CoglGstRectanglelionel/introspection-next
-rw-r--r-- | cogl-gst/cogl-gst-video-sink.c | 30 | ||||
-rw-r--r-- | cogl-gst/cogl-gst-video-sink.h | 6 |
2 files changed, 36 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) { diff --git a/cogl-gst/cogl-gst-video-sink.h b/cogl-gst/cogl-gst-video-sink.h index fc737920..95fabb3e 100644 --- a/cogl-gst/cogl-gst-video-sink.h +++ b/cogl-gst/cogl-gst-video-sink.h @@ -91,6 +91,10 @@ G_BEGIN_DECLS +#define COGL_GST_GTYPE_DECLARE_TYPE(name) \ + GType cogl_gst_ ## name ## _get_gtype (void) + + #define COGL_GST_TYPE_VIDEO_SINK cogl_gst_video_sink_get_type() #define COGL_GST_VIDEO_SINK(obj) \ @@ -433,6 +437,8 @@ typedef struct _CoglGstRectangle float height; } CoglGstRectangle; +COGL_GST_GTYPE_DECLARE_TYPE (rectangle); + /** * cogl_gst_video_sink_fit_size: * @sink: A #CoglGstVideoSink |