gst-libs: remove GstImplementsInterface usage

Will need to add replacement API for some of these.
This commit is contained in:
Tim-Philipp Müller 2011-06-26 21:46:08 +01:00
parent ac6c07a955
commit 56df7800a0
10 changed files with 37 additions and 22 deletions

View file

@ -41,6 +41,11 @@
* </refsect2> * </refsect2>
*/ */
/* FIXME 0.11: check if we need to add API for sometimes-supportedness
* (aka making up for GstImplementsInterface removal) */
/* FIXME 0.11: replace signals with messages (+ make API thread-safe) */
enum enum
{ {
VALUE_CHANGED, VALUE_CHANGED,
@ -71,8 +76,6 @@ gst_color_balance_get_type (void)
gst_color_balance_type = g_type_register_static (G_TYPE_INTERFACE, gst_color_balance_type = g_type_register_static (G_TYPE_INTERFACE,
"GstColorBalance", &gst_color_balance_info, 0); "GstColorBalance", &gst_color_balance_info, 0);
g_type_interface_add_prerequisite (gst_color_balance_type,
GST_TYPE_IMPLEMENTS_INTERFACE);
} }
return gst_color_balance_type; return gst_color_balance_type;

View file

@ -28,16 +28,16 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_COLOR_BALANCE \ #define GST_TYPE_COLOR_BALANCE \
(gst_color_balance_get_type ()) (gst_color_balance_get_type ())
#define GST_COLOR_BALANCE(obj) \ #define GST_COLOR_BALANCE(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_COLOR_BALANCE, \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_COLOR_BALANCE, GstColorBalance))
GstColorBalance))
#define GST_COLOR_BALANCE_CLASS(klass) \ #define GST_COLOR_BALANCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_COLOR_BALANCE, \ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_COLOR_BALANCE, \
GstColorBalanceClass)) GstColorBalanceClass))
#define GST_IS_COLOR_BALANCE(obj) \ #define GST_IS_COLOR_BALANCE(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE))
#define GST_IS_COLOR_BALANCE_CLASS(klass) \ #define GST_IS_COLOR_BALANCE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE))
#define GST_COLOR_BALANCE_GET_CLASS(inst) \ #define GST_COLOR_BALANCE_GET_CLASS(inst) \

View file

@ -50,6 +50,9 @@
* macro (in C) and the mixer API can be used. * macro (in C) and the mixer API can be used.
*/ */
/* FIXME 0.11: check if we need to add API for sometimes-supportedness
* (aka making up for GstImplementsInterface removal) */
#ifndef GST_DISABLE_DEPRECATED #ifndef GST_DISABLE_DEPRECATED
enum enum
{ {
@ -86,8 +89,6 @@ gst_mixer_get_type (void)
gst_mixer_type = g_type_register_static (G_TYPE_INTERFACE, gst_mixer_type = g_type_register_static (G_TYPE_INTERFACE,
"GstMixer", &gst_mixer_info, 0); "GstMixer", &gst_mixer_info, 0);
g_type_interface_add_prerequisite (gst_mixer_type,
GST_TYPE_IMPLEMENTS_INTERFACE);
} }
return gst_mixer_type; return gst_mixer_type;

View file

@ -29,14 +29,16 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_MIXER \ #define GST_TYPE_MIXER \
(gst_mixer_get_type ()) (gst_mixer_get_type ())
#define GST_MIXER(obj) \ #define GST_MIXER(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER, GstMixer)) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MIXER, GstMixer))
#define GST_MIXER_CLASS(klass) \ #define GST_MIXER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER, GstMixerClass)) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MIXER, GstMixerClass))
#define GST_IS_MIXER(obj) \ #define GST_IS_MIXER(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MIXER))
#define GST_IS_MIXER_CLASS(klass) \ #define GST_IS_MIXER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MIXER))
#define GST_MIXER_GET_CLASS(inst) \ #define GST_MIXER_GET_CLASS(inst) \

View file

@ -69,6 +69,11 @@
* </refsect2> * </refsect2>
*/ */
/* FIXME 0.11: check if we need to add API for sometimes-supportedness
* (aka making up for GstImplementsInterface removal) */
/* FIXME 0.11: replace signals with messages (+ make API thread-safe) */
enum enum
{ {
NORM_CHANGED, NORM_CHANGED,
@ -102,8 +107,6 @@ gst_tuner_get_type (void)
gst_tuner_type = g_type_register_static (G_TYPE_INTERFACE, gst_tuner_type = g_type_register_static (G_TYPE_INTERFACE,
"GstTuner", &gst_tuner_info, 0); "GstTuner", &gst_tuner_info, 0);
g_type_interface_add_prerequisite (gst_tuner_type,
GST_TYPE_IMPLEMENTS_INTERFACE);
} }
return gst_tuner_type; return gst_tuner_type;

View file

@ -29,14 +29,16 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_TUNER \ #define GST_TYPE_TUNER \
(gst_tuner_get_type ()) (gst_tuner_get_type ())
#define GST_TUNER(obj) \ #define GST_TUNER(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TUNER, GstTuner)) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TUNER, GstTuner))
#define GST_TUNER_CLASS(klass) \ #define GST_TUNER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TUNER, GstTunerClass)) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TUNER, GstTunerClass))
#define GST_IS_TUNER(obj) \ #define GST_IS_TUNER(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TUNER))
#define GST_IS_TUNER_CLASS(klass) \ #define GST_IS_TUNER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TUNER))
#define GST_TUNER_GET_CLASS(inst) \ #define GST_TUNER_GET_CLASS(inst) \

View file

@ -39,6 +39,9 @@
* Since: 0.10.11 * Since: 0.10.11
*/ */
/* FIXME 0.11: check if we need to add API for sometimes-supportedness
* (aka making up for GstImplementsInterface removal) (probably yes) */
static void gst_video_orientation_iface_init (GstVideoOrientationInterface * static void gst_video_orientation_iface_init (GstVideoOrientationInterface *
iface); iface);
@ -62,8 +65,6 @@ gst_video_orientation_get_type (void)
gst_video_orientation_type = g_type_register_static (G_TYPE_INTERFACE, gst_video_orientation_type = g_type_register_static (G_TYPE_INTERFACE,
"GstVideoOrientation", &gst_video_orientation_info, 0); "GstVideoOrientation", &gst_video_orientation_info, 0);
g_type_interface_add_prerequisite (gst_video_orientation_type,
GST_TYPE_IMPLEMENTS_INTERFACE);
} }
return gst_video_orientation_type; return gst_video_orientation_type;

View file

@ -30,9 +30,9 @@ G_BEGIN_DECLS
#define GST_TYPE_VIDEO_ORIENTATION \ #define GST_TYPE_VIDEO_ORIENTATION \
(gst_video_orientation_get_type ()) (gst_video_orientation_get_type ())
#define GST_VIDEO_ORIENTATION(obj) \ #define GST_VIDEO_ORIENTATION(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientation)) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientation))
#define GST_IS_VIDEO_ORIENTATION(obj) \ #define GST_IS_VIDEO_ORIENTATION(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_ORIENTATION)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_ORIENTATION))
#define GST_VIDEO_ORIENTATION_GET_IFACE(inst) \ #define GST_VIDEO_ORIENTATION_GET_IFACE(inst) \
(G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientationInterface)) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientationInterface))
@ -61,6 +61,10 @@ typedef struct _GstVideoOrientationInterface GstVideoOrientationInterface;
struct _GstVideoOrientationInterface { struct _GstVideoOrientationInterface {
GTypeInterface parent; GTypeInterface parent;
/* FIXME 0.11: fix awkward API? add some kind of get_supported flags thing
* and then just return booleans/int from all vfuncs requiring the caller
* to check the flags first */
/* virtual functions */ /* virtual functions */
gboolean (* get_hflip) (GstVideoOrientation *video_orientation, gboolean *flip); gboolean (* get_hflip) (GstVideoOrientation *video_orientation, gboolean *flip);
gboolean (* get_vflip) (GstVideoOrientation *video_orientation, gboolean *flip); gboolean (* get_vflip) (GstVideoOrientation *video_orientation, gboolean *flip);

View file

@ -318,8 +318,6 @@ gst_x_overlay_get_type (void)
gst_x_overlay_type = g_type_register_static (G_TYPE_INTERFACE, gst_x_overlay_type = g_type_register_static (G_TYPE_INTERFACE,
"GstXOverlay", &gst_x_overlay_info, 0); "GstXOverlay", &gst_x_overlay_info, 0);
g_type_interface_add_prerequisite (gst_x_overlay_type,
GST_TYPE_IMPLEMENTS_INTERFACE);
} }
return gst_x_overlay_type; return gst_x_overlay_type;

View file

@ -27,15 +27,16 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* FIXME 0.11: remove all CLASS bits, this is an interface */
#define GST_TYPE_X_OVERLAY \ #define GST_TYPE_X_OVERLAY \
(gst_x_overlay_get_type ()) (gst_x_overlay_get_type ())
#define GST_X_OVERLAY(obj) \ #define GST_X_OVERLAY(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_X_OVERLAY, \ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_X_OVERLAY, GstXOverlay))
GstXOverlay))
#define GST_X_OVERLAY_CLASS(klass) \ #define GST_X_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_X_OVERLAY, GstXOverlayClass)) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_X_OVERLAY, GstXOverlayClass))
#define GST_IS_X_OVERLAY(obj) \ #define GST_IS_X_OVERLAY(obj) \
(GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_X_OVERLAY)) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_X_OVERLAY))
#define GST_IS_X_OVERLAY_CLASS(klass) \ #define GST_IS_X_OVERLAY_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_X_OVERLAY)) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_X_OVERLAY))
#define GST_X_OVERLAY_GET_CLASS(inst) \ #define GST_X_OVERLAY_GET_CLASS(inst) \