Commit dea50d0b authored by Wim Taymans's avatar Wim Taymans

use G_DEFINE_TYPE

parent d67288dd
......@@ -64,12 +64,8 @@ static void gst_pulsemixer_finalize (GObject * object);
static GstStateChangeReturn gst_pulsemixer_change_state (GstElement * element,
GstStateChange transition);
static void gst_pulsemixer_init_interfaces (GType type);
GST_IMPLEMENT_PULSEMIXER_CTRL_METHODS (GstPulseMixer, gst_pulsemixer);
GST_IMPLEMENT_PULSEPROBE_METHODS (GstPulseMixer, gst_pulsemixer);
GST_BOILERPLATE_FULL (GstPulseMixer, gst_pulsemixer, GstElement,
GST_TYPE_ELEMENT, gst_pulsemixer_init_interfaces);
static gboolean
gst_pulsemixer_interface_supported (GstImplementsInterface
......@@ -92,41 +88,13 @@ gst_pulsemixer_implements_interface_init (GstImplementsInterfaceClass * klass)
klass->supported = gst_pulsemixer_interface_supported;
}
static void
gst_pulsemixer_init_interfaces (GType type)
{
static const GInterfaceInfo implements_iface_info = {
(GInterfaceInitFunc) gst_pulsemixer_implements_interface_init,
NULL,
NULL,
};
static const GInterfaceInfo mixer_iface_info = {
(GInterfaceInitFunc) gst_pulsemixer_mixer_interface_init,
NULL,
NULL,
};
static const GInterfaceInfo probe_iface_info = {
(GInterfaceInitFunc) gst_pulsemixer_property_probe_interface_init,
NULL,
NULL,
};
g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE,
&implements_iface_info);
g_type_add_interface_static (type, GST_TYPE_MIXER, &mixer_iface_info);
g_type_add_interface_static (type, GST_TYPE_PROPERTY_PROBE,
&probe_iface_info);
}
static void
gst_pulsemixer_base_init (gpointer g_class)
{
gst_element_class_set_details_simple (GST_ELEMENT_CLASS (g_class),
"PulseAudio Mixer",
"Generic/Audio",
"Control sound input and output levels for PulseAudio",
"Lennart Poettering");
}
#define gst_pulsemixer_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstPulseMixer, gst_pulsemixer, GST_TYPE_ELEMENT,
G_IMPLEMENT_INTERFACE (GST_TYPE_IMPLEMENTS_INTERFACE,
gst_pulsemixer_implements_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_MIXER, gst_pulsemixer_mixer_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_PROPERTY_PROBE,
gst_pulsemixer_property_probe_interface_init));
static void
gst_pulsemixer_class_init (GstPulseMixerClass * g_class)
......@@ -158,10 +126,16 @@ gst_pulsemixer_class_init (GstPulseMixerClass * g_class)
g_param_spec_string ("device-name", "Device name",
"Human-readable name of the sound device", NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
gst_element_class_set_details_simple (GST_ELEMENT_CLASS (g_class),
"PulseAudio Mixer",
"Generic/Audio",
"Control sound input and output levels for PulseAudio",
"Lennart Poettering");
}
static void
gst_pulsemixer_init (GstPulseMixer * this, GstPulseMixerClass * g_class)
gst_pulsemixer_init (GstPulseMixer * this)
{
this->mixer = NULL;
this->server = NULL;
......
......@@ -1072,8 +1072,8 @@ gst_pulseringbuffer_start (GstRingBuffer * buf)
/* EOS needs running clock */
if (GST_BASE_SINK_CAST (psink)->eos ||
g_atomic_int_get (&GST_BASE_AUDIO_SINK (psink)->abidata.ABI.
eos_rendering))
g_atomic_int_get (&GST_BASE_AUDIO_SINK (psink)->abidata.
ABI.eos_rendering))
gst_pulsering_set_corked (pbuf, FALSE, FALSE);
pa_threaded_mainloop_unlock (mainloop);
......@@ -1708,23 +1708,67 @@ static gboolean gst_pulsesink_event (GstBaseSink * sink, GstEvent * event);
static GstStateChangeReturn gst_pulsesink_change_state (GstElement * element,
GstStateChange transition);
static void gst_pulsesink_init_interfaces (GType type);
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
# define ENDIANNESS "LITTLE_ENDIAN, BIG_ENDIAN"
#else
# define ENDIANNESS "BIG_ENDIAN, LITTLE_ENDIAN"
#endif
static GstStaticPadTemplate pad_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-float, "
"endianness = (int) { " ENDIANNESS " }, "
"width = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 32, "
"depth = (int) 32, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 32 ];"
#ifdef HAVE_PULSE_0_9_15
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 24, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 32, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 32 ];"
#endif
"audio/x-raw-int, "
"signed = (boolean) FALSE, "
"width = (int) 8, "
"depth = (int) 8, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-alaw, "
"rate = (int) [ 1, MAX], "
"channels = (int) [ 1, 32 ];"
"audio/x-mulaw, "
"rate = (int) [ 1, MAX], " "channels = (int) [ 1, 32 ]")
);
GST_IMPLEMENT_PULSEPROBE_METHODS (GstPulseSink, gst_pulsesink);
#define _do_init(type) \
gst_pulsesink_init_contexts (); \
gst_pulsesink_init_interfaces (type);
GST_BOILERPLATE_FULL (GstPulseSink, gst_pulsesink, GstBaseAudioSink,
GST_TYPE_BASE_AUDIO_SINK, _do_init);
static gboolean
gst_pulsesink_interface_supported (GstImplementsInterface *
iface, GType interface_type)
......@@ -1745,93 +1789,17 @@ gst_pulsesink_implements_interface_init (GstImplementsInterfaceClass * klass)
klass->supported = gst_pulsesink_interface_supported;
}
static void
gst_pulsesink_init_interfaces (GType type)
{
static const GInterfaceInfo implements_iface_info = {
(GInterfaceInitFunc) gst_pulsesink_implements_interface_init,
NULL,
NULL,
};
static const GInterfaceInfo probe_iface_info = {
(GInterfaceInitFunc) gst_pulsesink_property_probe_interface_init,
NULL,
NULL,
};
#define gst_pulsesink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstPulseSink, gst_pulsesink, GST_TYPE_BASE_AUDIO_SINK,
gst_pulsesink_init_contexts ();
G_IMPLEMENT_INTERFACE (GST_TYPE_IMPLEMENTS_INTERFACE,
gst_pulsesink_implements_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_PROPERTY_PROBE,
gst_pulsesink_property_probe_interface_init);
#ifdef HAVE_PULSE_0_9_12
static const GInterfaceInfo svol_iface_info = {
NULL, NULL, NULL
};
g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_iface_info);
#endif
g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE,
&implements_iface_info);
g_type_add_interface_static (type, GST_TYPE_PROPERTY_PROBE,
&probe_iface_info);
}
static void
gst_pulsesink_base_init (gpointer g_class)
{
static GstStaticPadTemplate pad_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-float, "
"endianness = (int) { " ENDIANNESS " }, "
"width = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 32, "
"depth = (int) 32, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 32 ];"
#ifdef HAVE_PULSE_0_9_15
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 24, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 32, "
"depth = (int) 24, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 32 ];"
G_IMPLEMENT_INTERFACE (GST_TYPE_STREAM_VOLUME, NULL)
#endif
"audio/x-raw-int, "
"signed = (boolean) FALSE, "
"width = (int) 8, "
"depth = (int) 8, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-alaw, "
"rate = (int) [ 1, MAX], "
"channels = (int) [ 1, 32 ];"
"audio/x-mulaw, "
"rate = (int) [ 1, MAX], " "channels = (int) [ 1, 32 ]")
);
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (element_class,
"PulseAudio Audio Sink",
"Sink/Audio", "Plays audio to a PulseAudio server", "Lennart Poettering");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&pad_template));
}
);
static GstRingBuffer *
gst_pulsesink_create_ringbuffer (GstBaseAudioSink * sink)
......@@ -1937,6 +1905,12 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
g_param_spec_boxed ("stream-properties", "stream properties",
"list of pulseaudio stream properties",
GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_set_details_simple (gstelement_class,
"PulseAudio Audio Sink",
"Sink/Audio", "Plays audio to a PulseAudio server", "Lennart Poettering");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&pad_template));
}
/* returns the current time of the sink ringbuffer */
......@@ -1982,7 +1956,7 @@ server_dead:
}
static void
gst_pulsesink_init (GstPulseSink * pulsesink, GstPulseSinkClass * klass)
gst_pulsesink_init (GstPulseSink * pulsesink)
{
pulsesink->server = NULL;
pulsesink->device = NULL;
......
......@@ -95,18 +95,50 @@ static gboolean gst_pulsesrc_negotiate (GstBaseSrc * basesrc);
static GstStateChangeReturn gst_pulsesrc_change_state (GstElement *
element, GstStateChange transition);
static void gst_pulsesrc_init_interfaces (GType type);
#if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
# define ENDIANNESS "LITTLE_ENDIAN, BIG_ENDIAN"
#else
# define ENDIANNESS "BIG_ENDIAN, LITTLE_ENDIAN"
#endif
static GstStaticPadTemplate pad_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-float, "
"endianness = (int) { " ENDIANNESS " }, "
"width = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 32, "
"depth = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"signed = (boolean) FALSE, "
"width = (int) 8, "
"depth = (int) 8, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-alaw, "
"rate = (int) [ 1, MAX], "
"channels = (int) [ 1, 32 ];"
"audio/x-mulaw, "
"rate = (int) [ 1, MAX], " "channels = (int) [ 1, 32 ]")
);
GST_IMPLEMENT_PULSEMIXER_CTRL_METHODS (GstPulseSrc, gst_pulsesrc);
GST_IMPLEMENT_PULSEPROBE_METHODS (GstPulseSrc, gst_pulsesrc);
GST_BOILERPLATE_FULL (GstPulseSrc, gst_pulsesrc, GstAudioSrc,
GST_TYPE_AUDIO_SRC, gst_pulsesrc_init_interfaces);
static gboolean
gst_pulsesrc_interface_supported (GstImplementsInterface *
......@@ -129,80 +161,13 @@ gst_pulsesrc_implements_interface_init (GstImplementsInterfaceClass * klass)
klass->supported = gst_pulsesrc_interface_supported;
}
static void
gst_pulsesrc_init_interfaces (GType type)
{
static const GInterfaceInfo implements_iface_info = {
(GInterfaceInitFunc) gst_pulsesrc_implements_interface_init,
NULL,
NULL,
};
static const GInterfaceInfo mixer_iface_info = {
(GInterfaceInitFunc) gst_pulsesrc_mixer_interface_init,
NULL,
NULL,
};
static const GInterfaceInfo probe_iface_info = {
(GInterfaceInitFunc) gst_pulsesrc_property_probe_interface_init,
NULL,
NULL,
};
g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE,
&implements_iface_info);
g_type_add_interface_static (type, GST_TYPE_MIXER, &mixer_iface_info);
g_type_add_interface_static (type, GST_TYPE_PROPERTY_PROBE,
&probe_iface_info);
}
static void
gst_pulsesrc_base_init (gpointer g_class)
{
static GstStaticPadTemplate pad_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-float, "
"endianness = (int) { " ENDIANNESS " }, "
"width = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"endianness = (int) { " ENDIANNESS " }, "
"signed = (boolean) TRUE, "
"width = (int) 32, "
"depth = (int) 32, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-raw-int, "
"signed = (boolean) FALSE, "
"width = (int) 8, "
"depth = (int) 8, "
"rate = (int) [ 1, MAX ], "
"channels = (int) [ 1, 32 ];"
"audio/x-alaw, "
"rate = (int) [ 1, MAX], "
"channels = (int) [ 1, 32 ];"
"audio/x-mulaw, "
"rate = (int) [ 1, MAX], " "channels = (int) [ 1, 32 ]")
);
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (element_class,
"PulseAudio Audio Source",
"Source/Audio",
"Captures audio from a PulseAudio server", "Lennart Poettering");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&pad_template));
}
#define gst_pulsesrc_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstPulseSrc, gst_pulsesrc, GST_TYPE_AUDIO_SRC,
G_IMPLEMENT_INTERFACE (GST_TYPE_IMPLEMENTS_INTERFACE,
gst_pulsesrc_implements_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_MIXER, gst_pulsesrc_mixer_interface_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_PROPERTY_PROBE,
gst_pulsesrc_property_probe_interface_init));
static void
gst_pulsesrc_class_init (GstPulseSrcClass * klass)
......@@ -283,10 +248,17 @@ gst_pulsesrc_class_init (GstPulseSrcClass * klass)
g_param_spec_boxed ("stream-properties", "stream properties",
"list of pulseaudio stream properties",
GST_TYPE_STRUCTURE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_set_details_simple (gstelement_class,
"PulseAudio Audio Source",
"Source/Audio",
"Captures audio from a PulseAudio server", "Lennart Poettering");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&pad_template));
}
static void
gst_pulsesrc_init (GstPulseSrc * pulsesrc, GstPulseSrcClass * klass)
gst_pulsesrc_init (GstPulseSrc * pulsesrc)
{
pulsesrc->server = NULL;
pulsesrc->device = NULL;
......
......@@ -61,27 +61,14 @@ static void gst_auto_audio_sink_set_property (GObject * object, guint prop_id,
static void gst_auto_audio_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstAutoAudioSink, gst_auto_audio_sink, GstBin, GST_TYPE_BIN);
#define gst_auto_audio_sink_parent_class parent_class
G_DEFINE_TYPE (GstAutoAudioSink, gst_auto_audio_sink, GST_TYPE_BIN);
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static void
gst_auto_audio_sink_base_init (gpointer klass)
{
GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&sink_template));
gst_element_class_set_details_simple (eklass, "Auto audio sink",
"Sink/Audio",
"Wrapper audio sink for automatically detected audio sink",
"Jan Schmidt <thaytan@noraisin.net>");
}
static void
gst_auto_audio_sink_class_init (GstAutoAudioSinkClass * klass)
{
......@@ -112,6 +99,14 @@ gst_auto_audio_sink_class_init (GstAutoAudioSinkClass * klass)
g_param_spec_boxed ("filter-caps", "Filter caps",
"Filter sink candidates using these caps.", GST_TYPE_CAPS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&sink_template));
gst_element_class_set_details_simple (eklass, "Auto audio sink",
"Sink/Audio",
"Wrapper audio sink for automatically detected audio sink",
"Jan Schmidt <thaytan@noraisin.net>");
}
static void
......@@ -163,8 +158,7 @@ static GstStaticCaps raw_caps =
GST_STATIC_CAPS ("audio/x-raw-int; audio/x-raw-float");
static void
gst_auto_audio_sink_init (GstAutoAudioSink * sink,
GstAutoAudioSinkClass * g_class)
gst_auto_audio_sink_init (GstAutoAudioSink * sink)
{
sink->pad = gst_ghost_pad_new_no_target ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (sink), sink->pad);
......
......@@ -62,28 +62,14 @@ static void gst_auto_audio_src_set_property (GObject * object, guint prop_id,
static void gst_auto_audio_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstAutoAudioSrc, gst_auto_audio_src, GstBin, GST_TYPE_BIN);
#define gst_auto_audio_src_parent_class parent_class
G_DEFINE_TYPE (GstAutoAudioSrc, gst_auto_audio_src, GST_TYPE_BIN);
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static void
gst_auto_audio_src_base_init (gpointer klass)
{
GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&src_template));
gst_element_class_set_details_simple (eklass, "Auto audio source",
"Source/Audio",
"Wrapper audio source for automatically detected audio source",
"Jan Schmidt <thaytan@noraisin.net>, "
"Stefan Kost <ensonic@users.sf.net>");
}
static void
gst_auto_audio_src_class_init (GstAutoAudioSrcClass * klass)
{
......@@ -114,6 +100,15 @@ gst_auto_audio_src_class_init (GstAutoAudioSrcClass * klass)
g_param_spec_boxed ("filter-caps", "Filter caps",
"Filter sink candidates using these caps.", GST_TYPE_CAPS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&src_template));
gst_element_class_set_details_simple (eklass, "Auto audio source",
"Source/Audio",
"Wrapper audio source for automatically detected audio source",
"Jan Schmidt <thaytan@noraisin.net>, "
"Stefan Kost <ensonic@users.sf.net>");
}
static void
......@@ -166,7 +161,7 @@ static GstStaticCaps raw_caps =
GST_STATIC_CAPS ("audio/x-raw-int; audio/x-raw-float");
static void
gst_auto_audio_src_init (GstAutoAudioSrc * src, GstAutoAudioSrcClass * g_class)
gst_auto_audio_src_init (GstAutoAudioSrc * src)
{
src->pad = gst_ghost_pad_new_no_target ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (src), src->pad);
......
......@@ -62,26 +62,14 @@ static void gst_auto_video_sink_set_property (GObject * object, guint prop_id,
static void gst_auto_video_sink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstAutoVideoSink, gst_auto_video_sink, GstBin, GST_TYPE_BIN);
#define gst_auto_video_sink_parent_class parent_class
G_DEFINE_TYPE (GstAutoVideoSink, gst_auto_video_sink, GST_TYPE_BIN);
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static void
gst_auto_video_sink_base_init (gpointer klass)
{
GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&sink_template));
gst_element_class_set_details_simple (eklass, "Auto video sink",
"Sink/Video",
"Wrapper video sink for automatically detected video sink",
"Jan Schmidt <thaytan@noraisin.net>");
}
static void
gst_auto_video_sink_class_init (GstAutoVideoSinkClass * klass)
{
......@@ -109,6 +97,13 @@ gst_auto_video_sink_class_init (GstAutoVideoSinkClass * klass)
g_param_spec_boxed ("filter-caps", "Filter caps",
"Filter sink candidates using these caps.", GST_TYPE_CAPS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&sink_template));
gst_element_class_set_details_simple (eklass, "Auto video sink",
"Sink/Video",
"Wrapper video sink for automatically detected video sink",
"Jan Schmidt <thaytan@noraisin.net>");
}
static void
......@@ -162,8 +157,7 @@ static GstStaticCaps raw_caps =
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb");
static void
gst_auto_video_sink_init (GstAutoVideoSink * sink,
GstAutoVideoSinkClass * g_class)
gst_auto_video_sink_init (GstAutoVideoSink * sink)
{
sink->pad = gst_ghost_pad_new_no_target ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (sink), sink->pad);
......
......@@ -63,27 +63,14 @@ static void gst_auto_video_src_set_property (GObject * object, guint prop_id,
static void gst_auto_video_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
GST_BOILERPLATE (GstAutoVideoSrc, gst_auto_video_src, GstBin, GST_TYPE_BIN);
#define gst_auto_video_src_parent_class parent_class
G_DEFINE_TYPE (GstAutoVideoSrc, gst_auto_video_src, GST_TYPE_BIN);
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
static void
gst_auto_video_src_base_init (gpointer klass)
{
GstElementClass *eklass = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&src_template));
gst_element_class_set_details_simple (eklass, "Auto video source",
"Source/Video",
"Wrapper video source for automatically detected video source",
"Jan Schmidt <thaytan@noraisin.net>, "
"Stefan Kost <ensonic@users.sf.net>");
}
static void
gst_auto_video_src_class_init (GstAutoVideoSrcClass * klass)
{
......@@ -112,6 +99,14 @@ gst_auto_video_src_class_init (GstAutoVideoSrcClass * klass)
g_param_spec_boxed ("filter-caps", "Filter caps",
"Filter src candidates using these caps.", GST_TYPE_CAPS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (eklass,
gst_static_pad_template_get (&src_template));
gst_element_class_set_details_simple (eklass, "Auto video source",
"Source/Video",
"Wrapper video source for automatically detected video source",
"Jan Schmidt <thaytan@noraisin.net>, "
"Stefan Kost <ensonic@users.sf.net>");
}
static void
......@@ -165,7 +160,7 @@ static GstStaticCaps raw_caps =
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb");
static void
gst_auto_video_src_init (GstAutoVideoSrc * src, GstAutoVideoSrcClass * g_class)
gst_auto_video_src_init (GstAutoVideoSrc * src)
{
src->pad = gst_ghost_pad_new_no_target ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (src), src->pad);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment