From b18236648370591f20b6ab4bb72a678b6eee9982 Mon Sep 17 00:00:00 2001 From: gb Date: Wed, 24 Mar 2010 13:37:38 +0000 Subject: [PATCH] Move GValue specific stuff to a dedicated file. --- gst-libs/gst/vaapi/Makefile.am | 3 +- gst-libs/gst/vaapi/gstvaapiobject.c | 1 + gst-libs/gst/vaapi/gstvaapiparamspecs.c | 1 + gst-libs/gst/vaapi/gstvaapitypes.h | 28 +------- .../gst/vaapi/{gstvaapitypes.c => gstvaapivalue.c} | 83 +++++++++++----------- 5 files changed, 47 insertions(+), 69 deletions(-) rename gst-libs/gst/vaapi/{gstvaapitypes.c => gstvaapivalue.c} (95%) diff --git a/gst-libs/gst/vaapi/Makefile.am b/gst-libs/gst/vaapi/Makefile.am index 4b8280d..f1ecfce 100644 --- a/gst-libs/gst/vaapi/Makefile.am +++ b/gst-libs/gst/vaapi/Makefile.am @@ -17,8 +17,8 @@ libgstvaapi_source_c = \ gstvaapisubpicture.c \ gstvaapisurface.c \ gstvaapisurfacepool.c \ - gstvaapitypes.c \ gstvaapiutils.c \ + gstvaapivalue.c \ gstvaapivideobuffer.c \ gstvaapivideopool.c \ gstvaapivideosink.c \ @@ -36,6 +36,7 @@ libgstvaapi_source_h = \ gstvaapisurface.h \ gstvaapisurfacepool.h \ gstvaapitypes.h \ + gstvaapivalue.h \ gstvaapivideobuffer.h \ gstvaapivideopool.h \ gstvaapivideosink.h \ diff --git a/gst-libs/gst/vaapi/gstvaapiobject.c b/gst-libs/gst/vaapi/gstvaapiobject.c index 41b5372..32f82f1 100644 --- a/gst-libs/gst/vaapi/gstvaapiobject.c +++ b/gst-libs/gst/vaapi/gstvaapiobject.c @@ -27,6 +27,7 @@ #include "gstvaapiobject.h" #include "gstvaapiobject_priv.h" #include "gstvaapiparamspecs.h" +#include "gstvaapivalue.h" #include "gstvaapimarshal.h" #define DEBUG 1 diff --git a/gst-libs/gst/vaapi/gstvaapiparamspecs.c b/gst-libs/gst/vaapi/gstvaapiparamspecs.c index f297a9c..0409c6f 100644 --- a/gst-libs/gst/vaapi/gstvaapiparamspecs.c +++ b/gst-libs/gst/vaapi/gstvaapiparamspecs.c @@ -21,6 +21,7 @@ #include "config.h" #include #include "gstvaapiparamspecs.h" +#include "gstvaapivalue.h" /* --- GstVaapiParamSpecID --- */ diff --git a/gst-libs/gst/vaapi/gstvaapitypes.h b/gst-libs/gst/vaapi/gstvaapitypes.h index 48aadd3..451486a 100644 --- a/gst-libs/gst/vaapi/gstvaapitypes.h +++ b/gst-libs/gst/vaapi/gstvaapitypes.h @@ -21,7 +21,7 @@ #ifndef GST_VAAPI_TYPES_H #define GST_VAAPI_TYPES_H -#include +#include G_BEGIN_DECLS @@ -71,32 +71,6 @@ typedef guint64 GstVaapiID; #define GST_VAAPI_ID_ARGS(id) GUINT_TO_POINTER(id) /** - * GST_VAAPI_TYPE_ID: - * - * A #GValue type that represents a VA identifier. - * - * Return value: the #GType of GstVaapiID - */ -#define GST_VAAPI_TYPE_ID gst_vaapi_id_get_type() - -/** - * GST_VAAPI_VALUE_HOLDS_ID: - * @x: the #GValue to check - * - * Checks if the given #GValue contains a #GstVaapiID value. - */ -#define GST_VAAPI_VALUE_HOLDS_ID(x) (G_VALUE_HOLDS((x), GST_VAAPI_TYPE_ID)) - -GType -gst_vaapi_id_get_type(void); - -GstVaapiID -gst_vaapi_value_get_id(const GValue *value); - -void -gst_vaapi_value_set_id(GValue *value, GstVaapiID id); - -/** * GstVaapiPoint: * @x: X coordinate * @y: Y coordinate diff --git a/gst-libs/gst/vaapi/gstvaapitypes.c b/gst-libs/gst/vaapi/gstvaapivalue.c similarity index 95% rename from gst-libs/gst/vaapi/gstvaapitypes.c rename to gst-libs/gst/vaapi/gstvaapivalue.c index 42eef03..1ba30de 100644 --- a/gst-libs/gst/vaapi/gstvaapitypes.c +++ b/gst-libs/gst/vaapi/gstvaapivalue.c @@ -1,5 +1,5 @@ /* - * gstvaapitypes.h - Basic types + * gstvaapivalue.c - GValue implementations specific to VA-API * * gstreamer-vaapi (C) 2010 Splitted-Desktop Systems * @@ -19,14 +19,51 @@ */ /** - * SECTION:gstvaapitypes - * @short_description: Basic types + * SECTION:gstvaapivalue + * @short_description: GValue implementations specific to VA-API */ #include "config.h" -#include #include -#include "gstvaapitypes.h" +#include "gstvaapivalue.h" + +static GTypeInfo gst_vaapi_type_info = { + 0, + NULL, + NULL, + NULL, + NULL, + NULL, + 0, + 0, + NULL, + NULL, +}; + +static GTypeFundamentalInfo gst_vaapi_type_finfo = { + 0 +}; + +#define GST_VAAPI_TYPE_DEFINE(type, name) \ +GType gst_vaapi_ ## type ## _get_type(void) \ +{ \ + static GType gst_vaapi_ ## type ## _type = 0; \ + \ + if (G_UNLIKELY(gst_vaapi_ ## type ## _type == 0)) { \ + gst_vaapi_type_info.value_table = \ + &gst_vaapi_ ## type ## _value_table; \ + gst_vaapi_ ## type ## _type = g_type_register_fundamental( \ + g_type_fundamental_next(), \ + name, \ + &gst_vaapi_type_info, \ + &gst_vaapi_type_finfo, \ + 0 \ + ); \ + } \ + return gst_vaapi_ ## type ## _type; \ +} + +/* --- GstVaapiID --- */ #if GST_VAAPI_TYPE_ID_SIZE == 4 # define GST_VAAPI_VALUE_ID_(cvalue) ((cvalue).v_int) @@ -82,42 +119,6 @@ gst_vaapi_value_id_lcopy( return NULL; } -static GTypeInfo gst_vaapi_type_info = { - 0, - NULL, - NULL, - NULL, - NULL, - NULL, - 0, - 0, - NULL, - NULL, -}; - -static GTypeFundamentalInfo gst_vaapi_type_finfo = { - 0 -}; - -#define GST_VAAPI_TYPE_DEFINE(type, name) \ -GType gst_vaapi_ ## type ## _get_type(void) \ -{ \ - static GType gst_vaapi_ ## type ## _type = 0; \ - \ - if (G_UNLIKELY(gst_vaapi_ ## type ## _type == 0)) { \ - gst_vaapi_type_info.value_table = \ - &gst_vaapi_ ## type ## _value_table; \ - gst_vaapi_ ## type ## _type = g_type_register_fundamental( \ - g_type_fundamental_next(), \ - name, \ - &gst_vaapi_type_info, \ - &gst_vaapi_type_finfo, \ - 0 \ - ); \ - } \ - return gst_vaapi_ ## type ## _type; \ -} - static const GTypeValueTable gst_vaapi_id_value_table = { gst_vaapi_value_id_init, NULL, -- 2.7.4