interfaces: clean up the use of iface and class/klass

This commit is contained in:
Stefan Sauer 2011-10-21 14:51:23 +02:00
parent 2b385c0799
commit 2468492f02
15 changed files with 82 additions and 80 deletions

View file

@ -158,16 +158,16 @@ interface_as_function ## _get_mixer_flags (GstMixer * mixer)
return gst_pulsemixer_ctrl_get_mixer_flags (this->mixer); \
} \
static void \
interface_as_function ## _mixer_interface_init (GstMixerClass * klass) \
interface_as_function ## _mixer_interface_init (GstMixerInterface * iface) \
{ \
GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE; \
GST_MIXER_TYPE (iface) = GST_MIXER_HARDWARE; \
\
klass->list_tracks = interface_as_function ## _list_tracks; \
klass->set_volume = interface_as_function ## _set_volume; \
klass->get_volume = interface_as_function ## _get_volume; \
klass->set_mute = interface_as_function ## _set_mute; \
klass->set_record = interface_as_function ## _set_record; \
klass->get_mixer_flags = interface_as_function ## _get_mixer_flags; \
iface->list_tracks = interface_as_function ## _list_tracks; \
iface->set_volume = interface_as_function ## _set_volume; \
iface->get_volume = interface_as_function ## _get_volume; \
iface->set_mute = interface_as_function ## _set_mute; \
iface->set_record = interface_as_function ## _set_record; \
iface->get_mixer_flags = interface_as_function ## _get_mixer_flags; \
}
G_END_DECLS

View file

@ -90,7 +90,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
"I420, YV12, IYUV, Y41B }"))
);
static void gst_video_balance_colorbalance_init (GstColorBalanceClass * iface);
static void gst_video_balance_colorbalance_init (GstColorBalanceInterface *
iface);
static void gst_video_balance_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
@ -660,7 +661,7 @@ gst_video_balance_colorbalance_get_value (GstColorBalance * balance,
}
static void
gst_video_balance_colorbalance_init (GstColorBalanceClass * iface)
gst_video_balance_colorbalance_init (GstColorBalanceInterface * iface)
{
GST_COLOR_BALANCE_TYPE (iface) = GST_COLOR_BALANCE_SOFTWARE;
iface->list_channels = gst_video_balance_colorbalance_list_channels;

View file

@ -92,7 +92,8 @@ static void gst_directsound_sink_interfaces_init (GType type);
static void
gst_directsound_sink_implements_interface_init (GstImplementsInterfaceClass *
iface);
static void gst_directsound_sink_mixer_interface_init (GstMixerClass * iface);
static void gst_directsound_sink_mixer_interface_init (GstMixerInterface *
iface);
static GstStaticPadTemplate directsoundsink_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
@ -223,7 +224,7 @@ gst_directsound_sink_mixer_get_volume (GstMixer * mixer,
}
static void
gst_directsound_sink_mixer_interface_init (GstMixerClass * iface)
gst_directsound_sink_mixer_interface_init (GstMixerInterface * iface)
{
/* the mixer interface requires a definition of the mixer type:
* hardware or software? */

View file

@ -152,16 +152,16 @@ interface_as_function ## _set_mute (GstMixer * mixer, GstMixerTrack * track,
} \
\
static void \
interface_as_function ## _interface_init (GstMixerClass * klass) \
interface_as_function ## _interface_init (GstMixerInterface * iface) \
{ \
GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE; \
GST_MIXER_TYPE (iface) = GST_MIXER_HARDWARE; \
\
/* set up the interface hooks */ \
klass->list_tracks = interface_as_function ## _list_tracks; \
klass->set_volume = interface_as_function ## _set_volume; \
klass->get_volume = interface_as_function ## _get_volume; \
klass->set_mute = interface_as_function ## _set_mute; \
klass->set_record = interface_as_function ## _set_record; \
iface->list_tracks = interface_as_function ## _list_tracks; \
iface->set_volume = interface_as_function ## _set_volume; \
iface->get_volume = interface_as_function ## _get_volume; \
iface->set_mute = interface_as_function ## _set_mute; \
iface->set_record = interface_as_function ## _set_record; \
}

View file

@ -1800,18 +1800,18 @@ gst_oss4_mixer_get_mixer_flags (GstMixer * mixer)
}
static void
gst_oss4_mixer_interface_init (GstMixerClass * klass)
gst_oss4_mixer_interface_init (GstMixerInterface * iface)
{
GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE;
GST_MIXER_TYPE (iface) = GST_MIXER_HARDWARE;
klass->list_tracks = gst_oss4_mixer_list_tracks;
klass->set_volume = gst_oss4_mixer_set_volume;
klass->get_volume = gst_oss4_mixer_get_volume;
klass->set_mute = gst_oss4_mixer_set_mute;
klass->set_record = gst_oss4_mixer_set_record;
klass->set_option = gst_oss4_mixer_set_option;
klass->get_option = gst_oss4_mixer_get_option;
klass->get_mixer_flags = gst_oss4_mixer_get_mixer_flags;
iface->list_tracks = gst_oss4_mixer_list_tracks;
iface->set_volume = gst_oss4_mixer_set_volume;
iface->get_volume = gst_oss4_mixer_get_volume;
iface->set_mute = gst_oss4_mixer_set_mute;
iface->set_record = gst_oss4_mixer_set_record;
iface->set_option = gst_oss4_mixer_set_option;
iface->get_option = gst_oss4_mixer_get_option;
iface->get_mixer_flags = gst_oss4_mixer_get_mixer_flags;
}
/* Implement the horror that is GstImplementsInterface */

View file

@ -935,15 +935,15 @@ gst_oss4_source_mixer_set_mute (GstMixer * mixer, GstMixerTrack * track,
}
static void
gst_oss4_source_mixer_interface_init (GstMixerClass * klass)
gst_oss4_source_mixer_interface_init (GstMixerInterface * iface)
{
GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE;
GST_MIXER_TYPE (iface) = GST_MIXER_HARDWARE;
klass->list_tracks = gst_oss4_source_mixer_list_tracks;
klass->set_volume = gst_oss4_source_mixer_set_volume;
klass->get_volume = gst_oss4_source_mixer_get_volume;
klass->set_mute = gst_oss4_source_mixer_set_mute;
klass->set_record = gst_oss4_source_mixer_set_record;
iface->list_tracks = gst_oss4_source_mixer_list_tracks;
iface->set_volume = gst_oss4_source_mixer_set_volume;
iface->get_volume = gst_oss4_source_mixer_get_volume;
iface->set_mute = gst_oss4_source_mixer_set_mute;
iface->set_record = gst_oss4_source_mixer_set_record;
}
/* Implement the horror that is GstImplementsInterface */

View file

@ -50,7 +50,7 @@
#include "gstosxaudioelement.h"
static void
gst_osx_audio_element_class_init (GstOsxAudioElementInterface * klass);
gst_osx_audio_element_interface_init (GstOsxAudioElementInterface * iface);
GType
gst_osx_audio_element_get_type (void)
@ -60,7 +60,7 @@ gst_osx_audio_element_get_type (void)
if (!gst_osxaudioelement_type) {
static const GTypeInfo gst_osxaudioelement_info = {
sizeof (GstOsxAudioElementInterface),
(GBaseInitFunc) gst_osx_audio_element_class_init,
(GBaseInitFunc) gst_osx_audio_element_interface_init,
NULL,
NULL,
NULL,
@ -79,7 +79,7 @@ gst_osx_audio_element_get_type (void)
}
static void
gst_osx_audio_element_class_init (GstOsxAudioElementInterface * klass)
gst_osx_audio_element_interface_init (GstOsxAudioElementInterface * iface)
{
static gboolean initialized = FALSE;
@ -88,5 +88,5 @@ gst_osx_audio_element_class_init (GstOsxAudioElementInterface * klass)
}
/* default virtual functions */
klass->io_proc = NULL;
iface->io_proc = NULL;
}

View file

@ -169,19 +169,19 @@ interface_as_function ## _get_mixer_flags (GstMixer * mixer)
} \
\
static void \
interface_as_function ## _interface_init (GstMixerClass * klass) \
interface_as_function ## _interface_init (GstMixerInterface * iface) \
{ \
GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE; \
GST_MIXER_TYPE (iface) = GST_MIXER_HARDWARE; \
\
/* set up the interface hooks */ \
klass->list_tracks = interface_as_function ## _list_tracks; \
klass->set_volume = interface_as_function ## _set_volume; \
klass->get_volume = interface_as_function ## _get_volume; \
klass->set_mute = interface_as_function ## _set_mute; \
klass->set_record = interface_as_function ## _set_record; \
klass->get_option = interface_as_function ## _get_option; \
klass->set_option = interface_as_function ## _set_option; \
klass->get_mixer_flags = interface_as_function ## _get_mixer_flags; \
iface->list_tracks = interface_as_function ## _list_tracks; \
iface->set_volume = interface_as_function ## _set_volume; \
iface->get_volume = interface_as_function ## _get_volume; \
iface->set_mute = interface_as_function ## _set_mute; \
iface->set_record = interface_as_function ## _set_record; \
iface->get_option = interface_as_function ## _get_option; \
iface->set_option = interface_as_function ## _set_option; \
iface->get_mixer_flags = interface_as_function ## _get_mixer_flags; \
}
G_END_DECLS

View file

@ -91,14 +91,14 @@ interface_as_function ## _color_balance_get_value (GstColorBalance * balance,
} \
\
static void \
interface_as_function ## _color_balance_interface_init (GstColorBalanceClass * klass) \
interface_as_function ## _color_balance_interface_init (GstColorBalanceInterface * iface) \
{ \
GST_COLOR_BALANCE_TYPE (klass) = GST_COLOR_BALANCE_HARDWARE; \
GST_COLOR_BALANCE_TYPE (iface) = GST_COLOR_BALANCE_HARDWARE; \
\
/* default virtual functions */ \
klass->list_channels = interface_as_function ## _color_balance_list_channels; \
klass->set_value = interface_as_function ## _color_balance_set_value; \
klass->get_value = interface_as_function ## _color_balance_get_value; \
iface->list_channels = interface_as_function ## _color_balance_list_channels; \
iface->set_value = interface_as_function ## _color_balance_set_value; \
iface->get_value = interface_as_function ## _color_balance_get_value; \
} \
#endif /* __GST_V4L2_COLOR_BALANCE_H__ */

View file

@ -258,7 +258,7 @@ static void gst_v4l2radio_uri_handler_init (gpointer g_iface,
gpointer iface_data);
static void
gst_v4l2radio_tuner_interface_reinit (GstTunerClass * iface)
gst_v4l2radio_tuner_interface_reinit (GstTunerInterface * iface)
{
gst_v4l2radio_tuner_interface_init (iface);
}

View file

@ -179,20 +179,20 @@ interface_as_function ## _tuner_signal_strength (GstTuner * mixer,
} \
\
static void \
interface_as_function ## _tuner_interface_init (GstTunerClass * klass) \
interface_as_function ## _tuner_interface_init (GstTunerInterface * iface) \
{ \
/* default virtual functions */ \
klass->list_channels = interface_as_function ## _tuner_list_channels; \
klass->set_channel = interface_as_function ## _tuner_set_channel; \
klass->get_channel = interface_as_function ## _tuner_get_channel; \
iface->list_channels = interface_as_function ## _tuner_list_channels; \
iface->set_channel = interface_as_function ## _tuner_set_channel; \
iface->get_channel = interface_as_function ## _tuner_get_channel; \
\
klass->list_norms = interface_as_function ## _tuner_list_norms; \
klass->set_norm = interface_as_function ## _tuner_set_norm_and_notify; \
klass->get_norm = interface_as_function ## _tuner_get_norm; \
iface->list_norms = interface_as_function ## _tuner_list_norms; \
iface->set_norm = interface_as_function ## _tuner_set_norm_and_notify; \
iface->get_norm = interface_as_function ## _tuner_get_norm; \
\
klass->set_frequency = interface_as_function ## _tuner_set_frequency_and_notify; \
klass->get_frequency = interface_as_function ## _tuner_get_frequency; \
klass->signal_strength = interface_as_function ## _tuner_signal_strength; \
iface->set_frequency = interface_as_function ## _tuner_set_frequency_and_notify; \
iface->get_frequency = interface_as_function ## _tuner_get_frequency; \
iface->signal_strength = interface_as_function ## _tuner_signal_strength; \
} \
#endif /* __GST_V4L2_TUNER_H__ */

View file

@ -51,7 +51,7 @@ GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug);
#define GST_CAT_DEFAULT v4l2xv_debug
void
gst_v4l2_video_overlay_interface_init (GstVideoOverlayIface * klass)
gst_v4l2_video_overlay_interface_init (GstVideoOverlayInterface * iface)
{
GST_DEBUG_CATEGORY_INIT (v4l2xv_debug, "v4l2xv", 0,
"V4L2 GstVideoOverlay interface debugging");

View file

@ -39,7 +39,7 @@ void gst_v4l2_video_overlay_stop (GstV4l2Object *v4l2object);
gboolean gst_v4l2_video_overlay_get_render_rect (GstV4l2Object *v4l2object,
GstVideoRectangle *rect);
void gst_v4l2_video_overlay_interface_init (GstVideoOverlayIface * iface);
void gst_v4l2_video_overlay_interface_init (GstVideoOverlayInterface * iface);
void gst_v4l2_video_overlay_set_window_handle (GstV4l2Object * v4l2object,
guintptr id);
void gst_v4l2_video_overlay_prepare_window_handle (GstV4l2Object * v4l2object,
@ -57,7 +57,7 @@ interface_as_function ## _video_overlay_set_window_handle (GstVideoOverlay * ove
} \
\
static void \
interface_as_function ## _video_overlay_interface_init (GstVideoOverlayIface * iface) \
interface_as_function ## _video_overlay_interface_init (GstVideoOverlayInterface * iface) \
{ \
/* default virtual functions */ \
iface->set_window_handle = interface_as_function ## _video_overlay_set_window_handle; \

View file

@ -42,7 +42,7 @@ GST_DEBUG_CATEGORY_STATIC (v4l2vo_debug);
#endif
void
gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * klass)
gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * iface)
{
GST_DEBUG_CATEGORY_INIT (v4l2vo_debug, "v4l2vo", 0,
"V4L2 VideoOrientation interface debugging");

View file

@ -30,7 +30,7 @@
G_BEGIN_DECLS
void gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * klass);
void gst_v4l2_video_orientation_interface_init (GstVideoOrientationInterface * iface);
gboolean gst_v4l2_video_orientation_get_hflip (GstV4l2Object *v4l2object, gboolean *flip);
gboolean gst_v4l2_video_orientation_get_vflip (GstV4l2Object *v4l2object, gboolean *flip);
@ -101,17 +101,17 @@ gboolean gst_v4l2_video_orientation_set_vcenter (GstV4l2Object *v4l2object, gint
} \
\
static void \
interface_as_function ## _video_orientation_interface_init (GstVideoOrientationInterface * klass) \
interface_as_function ## _video_orientation_interface_init (GstVideoOrientationInterface * iface) \
{ \
/* default virtual functions */ \
klass->get_hflip = interface_as_function ## _video_orientation_get_hflip; \
klass->get_vflip = interface_as_function ## _video_orientation_get_vflip; \
klass->get_hcenter = interface_as_function ## _video_orientation_get_hcenter; \
klass->get_vcenter = interface_as_function ## _video_orientation_get_vcenter; \
klass->set_hflip = interface_as_function ## _video_orientation_set_hflip; \
klass->set_vflip = interface_as_function ## _video_orientation_set_vflip; \
klass->set_hcenter = interface_as_function ## _video_orientation_set_hcenter; \
klass->set_vcenter = interface_as_function ## _video_orientation_set_vcenter; \
iface->get_hflip = interface_as_function ## _video_orientation_get_hflip; \
iface->get_vflip = interface_as_function ## _video_orientation_get_vflip; \
iface->get_hcenter = interface_as_function ## _video_orientation_get_hcenter; \
iface->get_vcenter = interface_as_function ## _video_orientation_get_vcenter; \
iface->set_hflip = interface_as_function ## _video_orientation_set_hflip; \
iface->set_vflip = interface_as_function ## _video_orientation_set_vflip; \
iface->set_hcenter = interface_as_function ## _video_orientation_set_hcenter; \
iface->set_vcenter = interface_as_function ## _video_orientation_set_vcenter; \
}
#endif /* __GST_V4L2_VIDORIENT_H__ */