borgify further clean up docs a little

Original commit message from CVS:
borgify further
clean up docs a little
This commit is contained in:
Thomas Vander Stichele 2005-12-01 01:12:55 +00:00
parent 109cd71c76
commit f39b477379
24 changed files with 831 additions and 601 deletions

View file

@ -1,3 +1,85 @@
2005-12-01 Thomas Vander Stichele <thomas at apestaart dot org>
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-base-plugins.args:
* docs/plugins/inspect/plugin-libvisual.xml:
* gst/audioconvert/plugin.h:
* gst/audiorate/gstaudiorate.c: (gst_audio_rate_get_type),
(gst_audio_rate_base_init), (gst_audio_rate_class_init),
(gst_audio_rate_setcaps), (gst_audio_rate_init),
(gst_audio_rate_chain), (gst_audio_rate_set_property),
(gst_audio_rate_get_property), (gst_audio_rate_change_state),
(plugin_init):
* gst/audiotestsrc/gstaudiotestsrc.c:
(gst_audiostestsrc_wave_get_type), (gst_audio_test_src_base_init),
(gst_audio_test_src_class_init), (gst_audio_test_src_init),
(gst_audio_test_src_src_fixate), (gst_audio_test_src_setcaps),
(gst_audio_test_src_get_query_types),
(gst_audio_test_src_src_query), (gst_audio_test_src_create_sine),
(gst_audio_test_src_create_square),
(gst_audio_test_src_create_saw),
(gst_audio_test_src_create_triangle),
(gst_audio_test_src_create_silence),
(gst_audio_test_src_create_white_noise),
(gst_audio_test_src_init_pink_noise),
(gst_audio_test_src_generate_pink_noise_value),
(gst_audio_test_src_create_pink_noise),
(gst_audio_test_src_change_wave), (gst_audio_test_src_get_times),
(gst_audio_test_src_create), (gst_audio_test_src_set_property),
(gst_audio_test_src_get_property), (gst_audio_test_src_start),
(plugin_init):
* gst/audiotestsrc/gstaudiotestsrc.h:
* gst/subparse/gstsubparse.c: (gst_sub_parse_get_type),
(gst_sub_parse_base_init), (gst_sub_parse_class_init),
(gst_sub_parse_init), (gst_sub_parse_formats),
(gst_sub_parse_src_eventmask), (gst_sub_parse_src_event),
(convert_encoding), (get_next_line),
(gst_sub_parse_data_format_autodetect),
(gst_sub_parse_format_autodetect), (feed_textbuf), (handle_buffer),
(gst_sub_parse_loop), (gst_sub_parse_chain),
(gst_sub_parse_change_state), (gst_sub_parse_type_find),
(plugin_init):
* gst/subparse/gstsubparse.h:
* gst/videorate/gstvideorate.c: (gst_video_rate_get_type),
(gst_video_rate_base_init), (gst_video_rate_class_init),
(gst_video_rate_transformcaps), (gst_video_rate_getcaps),
(gst_video_rate_setcaps), (gst_video_rate_blank_data),
(gst_video_rate_init), (gst_video_rate_event),
(gst_video_rate_chain), (gst_video_rate_set_property),
(gst_video_rate_get_property), (gst_video_rate_change_state),
(plugin_init):
* gst/videoscale/gstvideoscale.c:
(gst_video_scale_method_get_type), (gst_video_scale_get_capslist),
(gst_video_scale_src_template_factory),
(gst_video_scale_sink_template_factory),
(gst_video_scale_get_type), (gst_video_scale_base_init),
(gst_video_scale_class_init), (gst_video_scale_init),
(gst_video_scale_set_property), (gst_video_scale_get_property),
(gst_video_scale_transform_caps), (gst_video_scale_get_format),
(gst_video_scale_prepare_size), (parse_caps),
(gst_video_scale_set_caps), (gst_video_scale_get_unit_size),
(gst_video_scale_fixate_caps), (gst_video_scale_prepare_image),
(gst_video_scale_transform), (gst_video_scale_handle_src_event),
(plugin_init):
* gst/videoscale/gstvideoscale.h:
* gst/videotestsrc/gstvideotestsrc.c:
(gst_video_test_src_pattern_get_type),
(gst_video_test_src_base_init), (gst_video_test_src_class_init),
(gst_video_test_src_init), (gst_video_test_src_src_fixate),
(gst_video_test_src_set_pattern),
(gst_video_test_src_set_property),
(gst_video_test_src_get_property), (gst_video_test_src_getcaps),
(gst_video_test_src_parse_caps), (gst_video_test_src_setcaps),
(gst_video_test_src_event), (gst_video_test_src_get_times),
(gst_video_test_src_create), (plugin_init):
* gst/videotestsrc/gstvideotestsrc.h:
* gst/videotestsrc/videotestsrc.c: (gst_video_test_src_get_size),
(gst_video_test_src_smpte), (gst_video_test_src_snow),
(gst_video_test_src_black):
* gst/videotestsrc/videotestsrc.h:
borgify further
clean up docs a little
2005-11-30 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/rtp/gstbasertpdepayload.h:

View file

@ -14,6 +14,9 @@ a support library for audio elements
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### ENUM GstAudioFieldFlag ##### -->
<para>

View file

@ -14,6 +14,9 @@ interface for adjusting color balance settings
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstColorBalance ##### -->
<para>

View file

@ -14,3 +14,6 @@ gconf default elements support
</para>
<!-- ##### SECTION Stability_Level ##### -->

View file

@ -14,6 +14,9 @@ interface for elements that provide mixer operations
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstMixer ##### -->
<para>

View file

@ -14,6 +14,9 @@ an implementation of an audio ringbuffer
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstRingBuffer ##### -->
<para>

View file

@ -14,6 +14,9 @@ interface for elements that provide tuner operations
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstTuner ##### -->
<para>

View file

@ -14,6 +14,9 @@ interface for setting/getting a Window on elements supporting it.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT GstXOverlay ##### -->
<para>

View file

@ -80,6 +80,7 @@ EXTRA_HFILES = \
$(top_srcdir)/ext/theora/gsttheoraenc.h \
$(top_srcdir)/ext/vorbis/vorbisenc.h \
$(top_srcdir)/gst/audioconvert/gstaudioconvert.h \
$(top_srcdir)/gst/audiotestsrc/gstaudiotestsrc.h \
$(top_srcdir)/gst/ffmpegcolorspace/gstffmpegcolorspace.h \
$(top_srcdir)/gst/tcp/gstmultifdsink.h \
$(top_srcdir)/gst/tcp/gsttcpserversink.h \

View file

@ -1008,3 +1008,123 @@
<DEFAULT>Sine</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoScale::method</NAME>
<TYPE>GstVideoScaleMethod</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>method</NICK>
<BLURB>method.</BLURB>
<DEFAULT>Nearest Neighbour</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::drop</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>Drop</NICK>
<BLURB>Number of dropped frames.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::duplicate</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>Duplicate</NICK>
<BLURB>Number of duplicated frames.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::in</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>In</NICK>
<BLURB>Number of input frames.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::new-pref</NAME>
<TYPE>gdouble</TYPE>
<RANGE>[0,1]</RANGE>
<FLAGS>rw</FLAGS>
<NICK>New Pref</NICK>
<BLURB>Value indicating how much to prefer new frames.</BLURB>
<DEFAULT>1</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::out</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>Out</NICK>
<BLURB>Number of output frames.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstVideoRate::silent</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>silent</NICK>
<BLURB>Don't emit notify for dropped and duplicated frames.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioRate::add</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>Add</NICK>
<BLURB>Number of added samples.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioRate::drop</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>Drop</NICK>
<BLURB>Number of dropped samples.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioRate::in</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>In</NICK>
<BLURB>Number of input samples.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioRate::out</NAME>
<TYPE>guint64</TYPE>
<RANGE></RANGE>
<FLAGS>r</FLAGS>
<NICK>Out</NICK>
<BLURB>Number of output samples.</BLURB>
<DEFAULT>0</DEFAULT>
</ARG>
<ARG>
<NAME>GstAudioRate::silent</NAME>
<TYPE>gboolean</TYPE>
<RANGE></RANGE>
<FLAGS>rw</FLAGS>
<NICK>silent</NICK>
<BLURB>Don't emit notify for dropped and duplicated frames.</BLURB>
<DEFAULT>TRUE</DEFAULT>
</ARG>

View file

@ -3,10 +3,10 @@
<description>libvisual visualization plugins</description>
<filename>../../ext/libvisual/.libs/libgstlibvisual.so</filename>
<basename>libgstlibvisual.so</basename>
<version>0.9.6</version>
<version>0.9.6.1</version>
<license>LGPL</license>
<source>gst-plugins-base</source>
<package>GStreamer Base Plug-ins source release</package>
<package>GStreamer Base Plug-ins CVS/prerelease</package>
<origin>Unknown package origin</origin>
<elements>
<element>

View file

@ -20,8 +20,8 @@
*/
#ifndef __GST_PLUGIN_AUDIOCONVERT_H__
#define __GST_PLUGIN_AUDIOCONVERT_H__
#ifndef __GST_PLUGIN_AUDIO_CONVERT_H__
#define __GST_PLUGIN_AUDIO_CONVERT_H__
#include <gst/gst.h>
@ -32,4 +32,4 @@ GType gst_audio_convert_get_type (void);
G_END_DECLS
#endif /* __GST_PLUGIN_AUDIOCONVERT_H__ */
#endif /* __GST_PLUGIN_AUDIO_CONVERT_H__ */

View file

@ -25,21 +25,21 @@
#include <gst/gst.h>
#include <gst/audio/audio.h>
#define GST_TYPE_AUDIORATE \
(gst_audiorate_get_type())
#define GST_AUDIORATE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIORATE,GstAudiorate))
#define GST_AUDIORATE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIORATE,GstAudiorate))
#define GST_IS_AUDIORATE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIORATE))
#define GST_IS_AUDIORATE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIORATE))
#define GST_TYPE_AUDIO_RATE \
(gst_audio_rate_get_type())
#define GST_AUDIO_RATE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_RATE,GstAudioRate))
#define GST_AUDIO_RATE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_RATE,GstAudioRate))
#define GST_IS_AUDIO_RATE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_RATE))
#define GST_IS_AUDIO_RATE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_RATE))
typedef struct _GstAudiorate GstAudiorate;
typedef struct _GstAudiorateClass GstAudiorateClass;
typedef struct _GstAudioRate GstAudioRate;
typedef struct _GstAudioRateClass GstAudioRateClass;
struct _GstAudiorate
struct _GstAudioRate
{
GstElement element;
@ -54,19 +54,19 @@ struct _GstAudiorate
gboolean silent;
};
struct _GstAudiorateClass
struct _GstAudioRateClass
{
GstElementClass parent_class;
};
/* elementfactory information */
static GstElementDetails audiorate_details =
static GstElementDetails audio_rate_details =
GST_ELEMENT_DETAILS ("Audio rate adjuster",
"Filter/Effect/Audio",
"Drops/duplicates/adjusts timestamps on audio samples to make a perfect stream",
"Wim Taymans <wim@fluendo.com>");
/* GstAudiorate signals and args */
/* GstAudioRate signals and args */
enum
{
/* FILL ME */
@ -86,84 +86,84 @@ enum
/* FILL ME */
};
static GstStaticPadTemplate gst_audiorate_src_template =
static GstStaticPadTemplate gst_audio_rate_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS)
);
static GstStaticPadTemplate gst_audiorate_sink_template =
static GstStaticPadTemplate gst_audio_rate_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS)
);
static void gst_audiorate_base_init (gpointer g_class);
static void gst_audiorate_class_init (GstAudiorateClass * klass);
static void gst_audiorate_init (GstAudiorate * audiorate);
static GstFlowReturn gst_audiorate_chain (GstPad * pad, GstBuffer * buf);
static void gst_audio_rate_base_init (gpointer g_class);
static void gst_audio_rate_class_init (GstAudioRateClass * klass);
static void gst_audio_rate_init (GstAudioRate * audiorate);
static GstFlowReturn gst_audio_rate_chain (GstPad * pad, GstBuffer * buf);
static void gst_audiorate_set_property (GObject * object,
static void gst_audio_rate_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_audiorate_get_property (GObject * object,
static void gst_audio_rate_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GstStateChangeReturn gst_audiorate_change_state (GstElement * element,
static GstStateChangeReturn gst_audio_rate_change_state (GstElement * element,
GstStateChange transition);
static GstElementClass *parent_class = NULL;
/*static guint gst_audiorate_signals[LAST_SIGNAL] = { 0 }; */
/*static guint gst_audio_rate_signals[LAST_SIGNAL] = { 0 }; */
static GType
gst_audiorate_get_type (void)
gst_audio_rate_get_type (void)
{
static GType audiorate_type = 0;
static GType audio_rate_type = 0;
if (!audiorate_type) {
static const GTypeInfo audiorate_info = {
sizeof (GstAudiorateClass),
gst_audiorate_base_init,
if (!audio_rate_type) {
static const GTypeInfo audio_rate_info = {
sizeof (GstAudioRateClass),
gst_audio_rate_base_init,
NULL,
(GClassInitFunc) gst_audiorate_class_init,
(GClassInitFunc) gst_audio_rate_class_init,
NULL,
NULL,
sizeof (GstAudiorate),
sizeof (GstAudioRate),
0,
(GInstanceInitFunc) gst_audiorate_init,
(GInstanceInitFunc) gst_audio_rate_init,
};
audiorate_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstAudiorate", &audiorate_info, 0);
audio_rate_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstAudioRate", &audio_rate_info, 0);
}
return audiorate_type;
return audio_rate_type;
}
static void
gst_audiorate_base_init (gpointer g_class)
gst_audio_rate_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &audiorate_details);
gst_element_class_set_details (element_class, &audio_rate_details);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_audiorate_sink_template));
gst_static_pad_template_get (&gst_audio_rate_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_audiorate_src_template));
gst_static_pad_template_get (&gst_audio_rate_src_template));
}
static void
gst_audiorate_class_init (GstAudiorateClass * klass)
gst_audio_rate_class_init (GstAudioRateClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gst_audiorate_set_property;
object_class->get_property = gst_audiorate_get_property;
object_class->set_property = gst_audio_rate_set_property;
object_class->get_property = gst_audio_rate_get_property;
g_object_class_install_property (object_class, ARG_IN,
g_param_spec_uint64 ("in", "In",
@ -182,18 +182,18 @@ gst_audiorate_class_init (GstAudiorateClass * klass)
"Don't emit notify for dropped and duplicated frames",
DEFAULT_SILENT, G_PARAM_READWRITE));
element_class->change_state = gst_audiorate_change_state;
element_class->change_state = gst_audio_rate_change_state;
}
static gboolean
gst_audiorate_setcaps (GstPad * pad, GstCaps * caps)
gst_audio_rate_setcaps (GstPad * pad, GstCaps * caps)
{
GstAudiorate *audiorate;
GstAudioRate *audiorate;
GstStructure *structure;
GstPad *otherpad;
gint ret, channels, depth;
audiorate = GST_AUDIORATE (gst_pad_get_parent (pad));
audiorate = GST_AUDIO_RATE (gst_pad_get_parent (pad));
otherpad = (pad == audiorate->srcpad) ? audiorate->sinkpad :
audiorate->srcpad;
@ -217,19 +217,19 @@ gst_audiorate_setcaps (GstPad * pad, GstCaps * caps)
}
static void
gst_audiorate_init (GstAudiorate * audiorate)
gst_audio_rate_init (GstAudioRate * audiorate)
{
audiorate->sinkpad =
gst_pad_new_from_static_template (&gst_audiorate_sink_template, "sink");
gst_pad_new_from_static_template (&gst_audio_rate_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (audiorate), audiorate->sinkpad);
gst_pad_set_chain_function (audiorate->sinkpad, gst_audiorate_chain);
gst_pad_set_setcaps_function (audiorate->sinkpad, gst_audiorate_setcaps);
gst_pad_set_chain_function (audiorate->sinkpad, gst_audio_rate_chain);
gst_pad_set_setcaps_function (audiorate->sinkpad, gst_audio_rate_setcaps);
gst_pad_set_getcaps_function (audiorate->sinkpad, gst_pad_proxy_getcaps);
audiorate->srcpad =
gst_pad_new_from_static_template (&gst_audiorate_src_template, "src");
gst_pad_new_from_static_template (&gst_audio_rate_src_template, "src");
gst_element_add_pad (GST_ELEMENT (audiorate), audiorate->srcpad);
gst_pad_set_setcaps_function (audiorate->srcpad, gst_audiorate_setcaps);
gst_pad_set_setcaps_function (audiorate->srcpad, gst_audio_rate_setcaps);
gst_pad_set_getcaps_function (audiorate->srcpad, gst_pad_proxy_getcaps);
audiorate->bytes_per_sample = 1;
@ -241,15 +241,15 @@ gst_audiorate_init (GstAudiorate * audiorate)
}
static GstFlowReturn
gst_audiorate_chain (GstPad * pad, GstBuffer * buf)
gst_audio_rate_chain (GstPad * pad, GstBuffer * buf)
{
GstAudiorate *audiorate;
GstAudioRate *audiorate;
GstClockTime in_time, in_duration;
guint64 in_offset, in_offset_end;
gint in_size;
GstFlowReturn ret = GST_FLOW_OK;
audiorate = GST_AUDIORATE (gst_pad_get_parent (pad));
audiorate = GST_AUDIO_RATE (gst_pad_get_parent (pad));
audiorate->in++;
@ -338,10 +338,10 @@ beach:
}
static void
gst_audiorate_set_property (GObject * object,
gst_audio_rate_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstAudiorate *audiorate = GST_AUDIORATE (object);
GstAudioRate *audiorate = GST_AUDIO_RATE (object);
switch (prop_id) {
case ARG_SILENT:
@ -354,10 +354,10 @@ gst_audiorate_set_property (GObject * object,
}
static void
gst_audiorate_get_property (GObject * object,
gst_audio_rate_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
GstAudiorate *audiorate = GST_AUDIORATE (object);
GstAudioRate *audiorate = GST_AUDIO_RATE (object);
switch (prop_id) {
case ARG_IN:
@ -382,9 +382,9 @@ gst_audiorate_get_property (GObject * object,
}
static GstStateChangeReturn
gst_audiorate_change_state (GstElement * element, GstStateChange transition)
gst_audio_rate_change_state (GstElement * element, GstStateChange transition)
{
GstAudiorate *audiorate = GST_AUDIORATE (element);
GstAudioRate *audiorate = GST_AUDIO_RATE (element);
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
@ -406,7 +406,7 @@ static gboolean
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "audiorate", GST_RANK_NONE,
GST_TYPE_AUDIORATE);
GST_TYPE_AUDIO_RATE);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -54,7 +54,7 @@
#include "gstaudiotestsrc.h"
GstElementDetails gst_audiotestsrc_details = {
GstElementDetails gst_audio_test_src_details = {
"Audio test source",
"Source/Audio",
"Creates audio test signals of given frequency and volume",
@ -74,7 +74,7 @@ enum
};
static GstStaticPadTemplate gst_audiotestsrc_src_template =
static GstStaticPadTemplate gst_audio_test_src_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
@ -86,22 +86,22 @@ GST_STATIC_PAD_TEMPLATE ("src",
);
GST_BOILERPLATE (GstAudioTestSrc, gst_audiotestsrc, GstBaseSrc,
GST_BOILERPLATE (GstAudioTestSrc, gst_audio_test_src, GstBaseSrc,
GST_TYPE_BASE_SRC);
#define GST_TYPE_AUDIOTESTSRC_WAVE (gst_audiostestsrc_wave_get_type())
#define GST_TYPE_AUDIO_TEST_SRC_WAVE (gst_audiostestsrc_wave_get_type())
static GType
gst_audiostestsrc_wave_get_type (void)
{
static GType audiostestsrc_wave_type = 0;
static GEnumValue audiostestsrc_waves[] = {
{GST_AUDIOTESTSRC_WAVE_SINE, "Sine", "sine"},
{GST_AUDIOTESTSRC_WAVE_SQUARE, "Square", "square"},
{GST_AUDIOTESTSRC_WAVE_SAW, "Saw", "saw"},
{GST_AUDIOTESTSRC_WAVE_TRIANGLE, "Triangle", "triangle"},
{GST_AUDIOTESTSRC_WAVE_SILENCE, "Silence", "silence"},
{GST_AUDIOTESTSRC_WAVE_WHITE_NOISE, "White noise", "white-noise"},
{GST_AUDIOTESTSRC_WAVE_PINK_NOISE, "Pink noise", "pink-noise"},
{GST_AUDIO_TEST_SRC_WAVE_SINE, "Sine", "sine"},
{GST_AUDIO_TEST_SRC_WAVE_SQUARE, "Square", "square"},
{GST_AUDIO_TEST_SRC_WAVE_SAW, "Saw", "saw"},
{GST_AUDIO_TEST_SRC_WAVE_TRIANGLE, "Triangle", "triangle"},
{GST_AUDIO_TEST_SRC_WAVE_SILENCE, "Silence", "silence"},
{GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE, "White noise", "white-noise"},
{GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE, "Pink noise", "pink-noise"},
{0, NULL, NULL},
};
@ -112,38 +112,39 @@ gst_audiostestsrc_wave_get_type (void)
return audiostestsrc_wave_type;
}
static void gst_audiotestsrc_set_property (GObject * object,
static void gst_audio_test_src_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_audiotestsrc_get_property (GObject * object,
static void gst_audio_test_src_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static gboolean gst_audiotestsrc_setcaps (GstBaseSrc * basesrc, GstCaps * caps);
static void gst_audiotestsrc_src_fixate (GstPad * pad, GstCaps * caps);
static gboolean gst_audio_test_src_setcaps (GstBaseSrc * basesrc,
GstCaps * caps);
static void gst_audio_test_src_src_fixate (GstPad * pad, GstCaps * caps);
static const GstQueryType *gst_audiotestsrc_get_query_types (GstPad * pad);
static gboolean gst_audiotestsrc_src_query (GstPad * pad, GstQuery * query);
static const GstQueryType *gst_audio_test_src_get_query_types (GstPad * pad);
static gboolean gst_audio_test_src_src_query (GstPad * pad, GstQuery * query);
static void gst_audiotestsrc_change_wave (GstAudioTestSrc * src);
static void gst_audio_test_src_change_wave (GstAudioTestSrc * src);
static void gst_audiotestsrc_get_times (GstBaseSrc * basesrc,
static void gst_audio_test_src_get_times (GstBaseSrc * basesrc,
GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
static GstFlowReturn gst_audiotestsrc_create (GstBaseSrc * basesrc,
static GstFlowReturn gst_audio_test_src_create (GstBaseSrc * basesrc,
guint64 offset, guint length, GstBuffer ** buffer);
static gboolean gst_audiotestsrc_start (GstBaseSrc * basesrc);
static gboolean gst_audio_test_src_start (GstBaseSrc * basesrc);
static void
gst_audiotestsrc_base_init (gpointer g_class)
gst_audio_test_src_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_audiotestsrc_src_template));
gst_element_class_set_details (element_class, &gst_audiotestsrc_details);
gst_static_pad_template_get (&gst_audio_test_src_src_template));
gst_element_class_set_details (element_class, &gst_audio_test_src_details);
}
static void
gst_audiotestsrc_class_init (GstAudioTestSrcClass * klass)
gst_audio_test_src_class_init (GstAudioTestSrcClass * klass)
{
GObjectClass *gobject_class;
GstBaseSrcClass *gstbasesrc_class;
@ -151,15 +152,15 @@ gst_audiotestsrc_class_init (GstAudioTestSrcClass * klass)
gobject_class = (GObjectClass *) klass;
gstbasesrc_class = (GstBaseSrcClass *) klass;
gobject_class->set_property = gst_audiotestsrc_set_property;
gobject_class->get_property = gst_audiotestsrc_get_property;
gobject_class->set_property = gst_audio_test_src_set_property;
gobject_class->get_property = gst_audio_test_src_get_property;
g_object_class_install_property (gobject_class, PROP_SAMPLES_PER_BUFFER,
g_param_spec_int ("samplesperbuffer", "Samples per buffer",
"Number of samples in each outgoing buffer",
1, G_MAXINT, 1024, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_WAVE, g_param_spec_enum ("wave", "Waveform", "Oscillator waveform", GST_TYPE_AUDIOTESTSRC_WAVE, /* enum type */
GST_AUDIOTESTSRC_WAVE_SINE, /* default value */
g_object_class_install_property (gobject_class, PROP_WAVE, g_param_spec_enum ("wave", "Waveform", "Oscillator waveform", GST_TYPE_AUDIO_TEST_SRC_WAVE, /* enum type */
GST_AUDIO_TEST_SRC_WAVE_SINE, /* default value */
G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE));
g_object_class_install_property (gobject_class, PROP_FREQ,
g_param_spec_double ("freq", "Frequency", "Frequency of test signal",
@ -176,20 +177,21 @@ gst_audiotestsrc_class_init (GstAudioTestSrcClass * klass)
"An offset added to timestamps set on buffers (in ns)", G_MININT64,
G_MAXINT64, 0, G_PARAM_READWRITE));
gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_audiotestsrc_setcaps);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_audiotestsrc_start);
gstbasesrc_class->get_times = GST_DEBUG_FUNCPTR (gst_audiotestsrc_get_times);
gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_audiotestsrc_create);
gstbasesrc_class->set_caps = GST_DEBUG_FUNCPTR (gst_audio_test_src_setcaps);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_audio_test_src_start);
gstbasesrc_class->get_times =
GST_DEBUG_FUNCPTR (gst_audio_test_src_get_times);
gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_audio_test_src_create);
}
static void
gst_audiotestsrc_init (GstAudioTestSrc * src, GstAudioTestSrcClass * g_class)
gst_audio_test_src_init (GstAudioTestSrc * src, GstAudioTestSrcClass * g_class)
{
GstPad *pad = GST_BASE_SRC_PAD (src);
gst_pad_set_fixatecaps_function (pad, gst_audiotestsrc_src_fixate);
gst_pad_set_query_function (pad, gst_audiotestsrc_src_query);
gst_pad_set_query_type_function (pad, gst_audiotestsrc_get_query_types);
gst_pad_set_fixatecaps_function (pad, gst_audio_test_src_src_fixate);
gst_pad_set_query_function (pad, gst_audio_test_src_src_query);
gst_pad_set_query_type_function (pad, gst_audio_test_src_get_query_types);
src->samplerate = 44100;
src->volume = 1.0;
@ -201,12 +203,12 @@ gst_audiotestsrc_init (GstAudioTestSrc * src, GstAudioTestSrcClass * g_class)
src->offset = G_GINT64_CONSTANT (0);
src->timestamp_offset = G_GINT64_CONSTANT (0);
src->wave = GST_AUDIOTESTSRC_WAVE_SINE;
gst_audiotestsrc_change_wave (src);
src->wave = GST_AUDIO_TEST_SRC_WAVE_SINE;
gst_audio_test_src_change_wave (src);
}
static void
gst_audiotestsrc_src_fixate (GstPad * pad, GstCaps * caps)
gst_audio_test_src_src_fixate (GstPad * pad, GstCaps * caps)
{
GstStructure *structure;
@ -216,13 +218,13 @@ gst_audiotestsrc_src_fixate (GstPad * pad, GstCaps * caps)
}
static gboolean
gst_audiotestsrc_setcaps (GstBaseSrc * basesrc, GstCaps * caps)
gst_audio_test_src_setcaps (GstBaseSrc * basesrc, GstCaps * caps)
{
GstAudioTestSrc *audiotestsrc;
const GstStructure *structure;
gboolean ret;
audiotestsrc = GST_AUDIOTESTSRC (basesrc);
audiotestsrc = GST_AUDIO_TEST_SRC (basesrc);
structure = gst_caps_get_structure (caps, 0);
ret = gst_structure_get_int (structure, "rate", &audiotestsrc->samplerate);
@ -231,7 +233,7 @@ gst_audiotestsrc_setcaps (GstBaseSrc * basesrc, GstCaps * caps)
}
static const GstQueryType *
gst_audiotestsrc_get_query_types (GstPad * pad)
gst_audio_test_src_get_query_types (GstPad * pad)
{
static const GstQueryType query_types[] = {
GST_QUERY_POSITION,
@ -242,12 +244,12 @@ gst_audiotestsrc_get_query_types (GstPad * pad)
}
static gboolean
gst_audiotestsrc_src_query (GstPad * pad, GstQuery * query)
gst_audio_test_src_src_query (GstPad * pad, GstQuery * query)
{
gboolean res = FALSE;
GstAudioTestSrc *src;
src = GST_AUDIOTESTSRC (GST_PAD_PARENT (pad));
src = GST_AUDIO_TEST_SRC (GST_PAD_PARENT (pad));
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:
@ -295,7 +297,7 @@ gst_audiotestsrc_src_query (GstPad * pad, GstQuery * query)
}
static void
gst_audiotestsrc_create_sine (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_sine (GstAudioTestSrc * src, gint16 * samples)
{
gint i;
gdouble step, amp;
@ -313,7 +315,7 @@ gst_audiotestsrc_create_sine (GstAudioTestSrc * src, gint16 * samples)
}
static void
gst_audiotestsrc_create_square (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_square (GstAudioTestSrc * src, gint16 * samples)
{
gint i;
gdouble step, amp;
@ -331,7 +333,7 @@ gst_audiotestsrc_create_square (GstAudioTestSrc * src, gint16 * samples)
}
static void
gst_audiotestsrc_create_saw (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_saw (GstAudioTestSrc * src, gint16 * samples)
{
gint i;
gdouble step, amp;
@ -353,7 +355,7 @@ gst_audiotestsrc_create_saw (GstAudioTestSrc * src, gint16 * samples)
}
static void
gst_audiotestsrc_create_triangle (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_triangle (GstAudioTestSrc * src, gint16 * samples)
{
gint i;
gdouble step, amp;
@ -377,13 +379,13 @@ gst_audiotestsrc_create_triangle (GstAudioTestSrc * src, gint16 * samples)
}
static void
gst_audiotestsrc_create_silence (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_silence (GstAudioTestSrc * src, gint16 * samples)
{
memset (samples, 0, src->samples_per_buffer * sizeof (gint16));
}
static void
gst_audiotestsrc_create_white_noise (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_white_noise (GstAudioTestSrc * src, gint16 * samples)
{
gint i;
gdouble amp;
@ -401,7 +403,7 @@ gst_audiotestsrc_create_white_noise (GstAudioTestSrc * src, gint16 * samples)
* Many thanks Phil!
*/
static void
gst_audiotestsrc_init_pink_noise (GstAudioTestSrc * src)
gst_audio_test_src_init_pink_noise (GstAudioTestSrc * src)
{
gint i;
gint num_rows = 12; /* arbitrary: 1 .. PINK_MAX_RANDOM_ROWS */
@ -421,7 +423,7 @@ gst_audiotestsrc_init_pink_noise (GstAudioTestSrc * src)
/* Generate Pink noise values between -1.0 and +1.0 */
static gfloat
gst_audiotestsrc_generate_pink_noise_value (GstPinkNoise * pink)
gst_audio_test_src_generate_pink_noise_value (GstPinkNoise * pink)
{
glong new_random;
glong sum;
@ -461,7 +463,7 @@ gst_audiotestsrc_generate_pink_noise_value (GstPinkNoise * pink)
}
static void
gst_audiotestsrc_create_pink_noise (GstAudioTestSrc * src, gint16 * samples)
gst_audio_test_src_create_pink_noise (GstAudioTestSrc * src, gint16 * samples)
{
gint i;
gdouble amp;
@ -470,36 +472,36 @@ gst_audiotestsrc_create_pink_noise (GstAudioTestSrc * src, gint16 * samples)
for (i = 0; i < src->samples_per_buffer; i++) {
samples[i] =
(gint16) (gst_audiotestsrc_generate_pink_noise_value (&src->pink) *
(gint16) (gst_audio_test_src_generate_pink_noise_value (&src->pink) *
amp);
}
}
static void
gst_audiotestsrc_change_wave (GstAudioTestSrc * src)
gst_audio_test_src_change_wave (GstAudioTestSrc * src)
{
switch (src->wave) {
case GST_AUDIOTESTSRC_WAVE_SINE:
src->process = gst_audiotestsrc_create_sine;
case GST_AUDIO_TEST_SRC_WAVE_SINE:
src->process = gst_audio_test_src_create_sine;
break;
case GST_AUDIOTESTSRC_WAVE_SQUARE:
src->process = gst_audiotestsrc_create_square;
case GST_AUDIO_TEST_SRC_WAVE_SQUARE:
src->process = gst_audio_test_src_create_square;
break;
case GST_AUDIOTESTSRC_WAVE_SAW:
src->process = gst_audiotestsrc_create_saw;
case GST_AUDIO_TEST_SRC_WAVE_SAW:
src->process = gst_audio_test_src_create_saw;
break;
case GST_AUDIOTESTSRC_WAVE_TRIANGLE:
src->process = gst_audiotestsrc_create_triangle;
case GST_AUDIO_TEST_SRC_WAVE_TRIANGLE:
src->process = gst_audio_test_src_create_triangle;
break;
case GST_AUDIOTESTSRC_WAVE_SILENCE:
src->process = gst_audiotestsrc_create_silence;
case GST_AUDIO_TEST_SRC_WAVE_SILENCE:
src->process = gst_audio_test_src_create_silence;
break;
case GST_AUDIOTESTSRC_WAVE_WHITE_NOISE:
src->process = gst_audiotestsrc_create_white_noise;
case GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE:
src->process = gst_audio_test_src_create_white_noise;
break;
case GST_AUDIOTESTSRC_WAVE_PINK_NOISE:
gst_audiotestsrc_init_pink_noise (src);
src->process = gst_audiotestsrc_create_pink_noise;
case GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE:
gst_audio_test_src_init_pink_noise (src);
src->process = gst_audio_test_src_create_pink_noise;
break;
default:
GST_ERROR ("invalid wave-form");
@ -508,7 +510,7 @@ gst_audiotestsrc_change_wave (GstAudioTestSrc * src)
}
static void
gst_audiotestsrc_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
gst_audio_test_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
/* for live sources, sync on the timestamp of the buffer */
@ -531,14 +533,14 @@ gst_audiotestsrc_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
}
static GstFlowReturn
gst_audiotestsrc_create (GstBaseSrc * basesrc, guint64 offset,
gst_audio_test_src_create (GstBaseSrc * basesrc, guint64 offset,
guint length, GstBuffer ** buffer)
{
GstAudioTestSrc *src;
GstBuffer *buf;
guint tdiff;
src = GST_AUDIOTESTSRC (basesrc);
src = GST_AUDIO_TEST_SRC (basesrc);
if (!src->tags_pushed) {
GstTagList *taglist;
@ -578,10 +580,10 @@ gst_audiotestsrc_create (GstBaseSrc * basesrc, guint64 offset,
}
static void
gst_audiotestsrc_set_property (GObject * object, guint prop_id,
gst_audio_test_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstAudioTestSrc *src = GST_AUDIOTESTSRC (object);
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (object);
switch (prop_id) {
case PROP_SAMPLES_PER_BUFFER:
@ -589,7 +591,7 @@ gst_audiotestsrc_set_property (GObject * object, guint prop_id,
break;
case PROP_WAVE:
src->wave = g_value_get_enum (value);
gst_audiotestsrc_change_wave (src);
gst_audio_test_src_change_wave (src);
break;
case PROP_FREQ:
src->freq = g_value_get_double (value);
@ -610,10 +612,10 @@ gst_audiotestsrc_set_property (GObject * object, guint prop_id,
}
static void
gst_audiotestsrc_get_property (GObject * object, guint prop_id,
gst_audio_test_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstAudioTestSrc *src = GST_AUDIOTESTSRC (object);
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (object);
switch (prop_id) {
case PROP_SAMPLES_PER_BUFFER:
@ -641,9 +643,9 @@ gst_audiotestsrc_get_property (GObject * object, guint prop_id,
}
static gboolean
gst_audiotestsrc_start (GstBaseSrc * basesrc)
gst_audio_test_src_start (GstBaseSrc * basesrc)
{
GstAudioTestSrc *src = GST_AUDIOTESTSRC (basesrc);
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (basesrc);
src->timestamp = G_GINT64_CONSTANT (0);
src->offset = G_GINT64_CONSTANT (0);
@ -655,7 +657,7 @@ static gboolean
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "audiotestsrc",
GST_RANK_NONE, GST_TYPE_AUDIOTESTSRC);
GST_RANK_NONE, GST_TYPE_AUDIO_TEST_SRC);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -21,8 +21,8 @@
*/
#ifndef __GST_AUDIOTESTSRC_H__
#define __GST_AUDIOTESTSRC_H__
#ifndef __GST_AUDIO_TEST_SRC_H__
#define __GST_AUDIO_TEST_SRC_H__
#include <gst/gst.h>
@ -31,25 +31,25 @@
G_BEGIN_DECLS
#define GST_TYPE_AUDIOTESTSRC \
(gst_audiotestsrc_get_type())
#define GST_AUDIOTESTSRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIOTESTSRC,GstAudioTestSrc))
#define GST_AUDIOTESTSRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIOTESTSRC,GstAudioTestSrcClass))
#define GST_IS_AUDIOTESTSRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIOTESTSRC))
#define GST_IS_AUDIOTESTSRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIOTESTSRC))
#define GST_TYPE_AUDIO_TEST_SRC \
(gst_audio_test_src_get_type())
#define GST_AUDIO_TEST_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_TEST_SRC,GstAudioTestSrc))
#define GST_AUDIO_TEST_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_TEST_SRC,GstAudioTestSrcClass))
#define GST_IS_AUDIO_TEST_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_TEST_SRC))
#define GST_IS_AUDIO_TEST_SRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_TEST_SRC))
typedef enum {
GST_AUDIOTESTSRC_WAVE_SINE,
GST_AUDIOTESTSRC_WAVE_SQUARE,
GST_AUDIOTESTSRC_WAVE_SAW,
GST_AUDIOTESTSRC_WAVE_TRIANGLE,
GST_AUDIOTESTSRC_WAVE_SILENCE,
GST_AUDIOTESTSRC_WAVE_WHITE_NOISE,
GST_AUDIOTESTSRC_WAVE_PINK_NOISE,
GST_AUDIO_TEST_SRC_WAVE_SINE,
GST_AUDIO_TEST_SRC_WAVE_SQUARE,
GST_AUDIO_TEST_SRC_WAVE_SAW,
GST_AUDIO_TEST_SRC_WAVE_TRIANGLE,
GST_AUDIO_TEST_SRC_WAVE_SILENCE,
GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE,
GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE,
} GstAudioTestSrcWaves;
#define PINK_MAX_RANDOM_ROWS (30)
@ -102,9 +102,9 @@ struct _GstAudioTestSrcClass {
GstBaseSrcClass parent_class;
};
GType gst_audiotestsrc_get_type(void);
gboolean gst_audiotestsrc_factory_init (GstElementFactory *factory);
GType gst_audio_test_src_get_type(void);
gboolean gst_audio_test_src_factory_init (GstElementFactory *factory);
G_END_DECLS
#endif /* __GST_AUDIOTESTSRC_H__ */
#endif /* __GST_AUDIO_TEST_SRC_H__ */

View file

@ -29,8 +29,8 @@
#include "gstsubparse.h"
GST_DEBUG_CATEGORY_STATIC (subparse_debug);
#define GST_CAT_DEFAULT subparse_debug
GST_DEBUG_CATEGORY_STATIC (sub_parse_debug);
#define GST_CAT_DEFAULT sub_parse_debug
static GstStaticPadTemplate sink_templ = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
@ -44,60 +44,60 @@ static GstStaticPadTemplate src_templ = GST_STATIC_PAD_TEMPLATE ("src",
GST_STATIC_CAPS ("text/plain; text/x-pango-markup")
);
static void gst_subparse_base_init (GstSubparseClass * klass);
static void gst_subparse_class_init (GstSubparseClass * klass);
static void gst_subparse_init (GstSubparse * subparse);
static void gst_sub_parse_base_init (GstSubParseClass * klass);
static void gst_sub_parse_class_init (GstSubParseClass * klass);
static void gst_sub_parse_init (GstSubParse * subparse);
#if 0
static const GstFormat *gst_subparse_formats (GstPad * pad);
static const GstEventMask *gst_subparse_src_eventmask (GstPad * pad);
static const GstFormat *gst_sub_parse_formats (GstPad * pad);
static const GstEventMask *gst_sub_parse_src_eventmask (GstPad * pad);
#endif
static gboolean gst_subparse_src_event (GstPad * pad, GstEvent * event);
static gboolean gst_sub_parse_src_event (GstPad * pad, GstEvent * event);
static GstStateChangeReturn gst_subparse_change_state (GstElement * element,
static GstStateChangeReturn gst_sub_parse_change_state (GstElement * element,
GstStateChange transition);
#if 0
static void gst_subparse_loop (GstPad * sinkpad);
static void gst_sub_parse_loop (GstPad * sinkpad);
#endif
static GstFlowReturn gst_subparse_chain (GstPad * sinkpad, GstBuffer * buf);
static GstFlowReturn gst_sub_parse_chain (GstPad * sinkpad, GstBuffer * buf);
#if 0
static GstCaps *gst_subparse_type_find (GstBuffer * buf, gpointer private);
static GstCaps *gst_sub_parse_type_find (GstBuffer * buf, gpointer private);
#endif
static GstElementClass *parent_class = NULL;
GType
gst_subparse_get_type (void)
gst_sub_parse_get_type (void)
{
static GType subparse_type = 0;
static GType sub_parse_type = 0;
if (!subparse_type) {
static const GTypeInfo subparse_info = {
sizeof (GstSubparseClass),
(GBaseInitFunc) gst_subparse_base_init,
if (!sub_parse_type) {
static const GTypeInfo sub_parse_info = {
sizeof (GstSubParseClass),
(GBaseInitFunc) gst_sub_parse_base_init,
NULL,
(GClassInitFunc) gst_subparse_class_init,
(GClassInitFunc) gst_sub_parse_class_init,
NULL,
NULL,
sizeof (GstSubparse),
sizeof (GstSubParse),
0,
(GInstanceInitFunc) gst_subparse_init,
(GInstanceInitFunc) gst_sub_parse_init,
};
subparse_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstSubparse", &subparse_info, 0);
sub_parse_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstSubParse", &sub_parse_info, 0);
}
return subparse_type;
return sub_parse_type;
}
static void
gst_subparse_base_init (GstSubparseClass * klass)
gst_sub_parse_base_init (GstSubParseClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
static GstElementDetails subparse_details = {
static GstElementDetails sub_parse_details = {
"Subtitle parsers",
"Codec/Parser/Subtitle",
"Parses subtitle (.sub) files into text streams",
@ -109,28 +109,28 @@ gst_subparse_base_init (GstSubparseClass * klass)
gst_static_pad_template_get (&sink_templ));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_templ));
gst_element_class_set_details (element_class, &subparse_details);
gst_element_class_set_details (element_class, &sub_parse_details);
}
static void
gst_subparse_class_init (GstSubparseClass * klass)
gst_sub_parse_class_init (GstSubParseClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
element_class->change_state = gst_subparse_change_state;
element_class->change_state = gst_sub_parse_change_state;
}
static void
gst_subparse_init (GstSubparse * subparse)
gst_sub_parse_init (GstSubParse * subparse)
{
subparse->sinkpad = gst_pad_new_from_static_template (&sink_templ, "sink");
gst_pad_set_chain_function (subparse->sinkpad, gst_subparse_chain);
gst_pad_set_chain_function (subparse->sinkpad, gst_sub_parse_chain);
gst_element_add_pad (GST_ELEMENT (subparse), subparse->sinkpad);
subparse->srcpad = gst_pad_new_from_static_template (&src_templ, "src");
gst_pad_set_event_function (subparse->srcpad, gst_subparse_src_event);
gst_pad_set_event_function (subparse->srcpad, gst_sub_parse_src_event);
gst_element_add_pad (GST_ELEMENT (subparse), subparse->srcpad);
subparse->textbuf = g_string_new (NULL);
@ -143,7 +143,7 @@ gst_subparse_init (GstSubparse * subparse)
#if 0
static const GstFormat *
gst_subparse_formats (GstPad * pad)
gst_sub_parse_formats (GstPad * pad)
{
static const GstFormat formats[] = {
GST_FORMAT_TIME,
@ -154,7 +154,7 @@ gst_subparse_formats (GstPad * pad)
}
static const GstEventMask *
gst_subparse_src_eventmask (GstPad * pad)
gst_sub_parse_src_eventmask (GstPad * pad)
{
static const GstEventMask masks[] = {
{GST_EVENT_SEEK, GST_SEEK_METHOD_SET},
@ -166,9 +166,9 @@ gst_subparse_src_eventmask (GstPad * pad)
#endif
static gboolean
gst_subparse_src_event (GstPad * pad, GstEvent * event)
gst_sub_parse_src_event (GstPad * pad, GstEvent * event)
{
GstSubparse *self = GST_SUBPARSE (gst_pad_get_parent (pad));
GstSubParse *self = GST_SUBPARSE (gst_pad_get_parent (pad));
GstFormat format;
GstSeekType type;
@ -198,7 +198,7 @@ gst_subparse_src_event (GstPad * pad, GstEvent * event)
}
static gchar *
convert_encoding (GstSubparse * self, const gchar * str, gsize len)
convert_encoding (GstSubParse * self, const gchar * str, gsize len)
{
gsize bytes_read, bytes_written;
gchar *rv;
@ -235,7 +235,7 @@ convert_encoding (GstSubparse * self, const gchar * str, gsize len)
}
static gchar *
get_next_line (GstSubparse * self)
get_next_line (GstSubParse * self)
{
char *line = NULL;
const char *line_end;
@ -449,7 +449,7 @@ parser_state_dispose (ParserState * state)
*/
static GstSubParseFormat
gst_subparse_data_format_autodetect (gchar * match_str)
gst_sub_parse_data_format_autodetect (gchar * match_str)
{
static gboolean need_init_regexps = TRUE;
static regex_t mdvd_rx;
@ -490,7 +490,7 @@ gst_subparse_data_format_autodetect (gchar * match_str)
}
static GstCaps *
gst_subparse_format_autodetect (GstSubparse * self)
gst_sub_parse_format_autodetect (GstSubParse * self)
{
gchar *data;
GstSubParseFormat format;
@ -501,7 +501,7 @@ gst_subparse_format_autodetect (GstSubparse * self)
}
data = g_strndup (self->textbuf->str, 35);
format = gst_subparse_data_format_autodetect (data);
format = gst_sub_parse_data_format_autodetect (data);
g_free (data);
self->parser_type = format;
@ -527,7 +527,7 @@ gst_subparse_format_autodetect (GstSubparse * self)
}
static void
feed_textbuf (GstSubparse * self, GstBuffer * buf)
feed_textbuf (GstSubParse * self, GstBuffer * buf)
{
if (GST_BUFFER_OFFSET (buf) != self->offset) {
/* flush the parser state */
@ -544,7 +544,7 @@ feed_textbuf (GstSubparse * self, GstBuffer * buf)
}
static GstFlowReturn
handle_buffer (GstSubparse * self, GstBuffer * buf)
handle_buffer (GstSubParse * self, GstBuffer * buf)
{
GstCaps *caps = NULL;
gchar *line, *subtitle;
@ -553,7 +553,7 @@ handle_buffer (GstSubparse * self, GstBuffer * buf)
/* make sure we know the format */
if (G_UNLIKELY (self->parser_type == GST_SUB_PARSE_FORMAT_UNKNOWN)) {
if (!(caps = gst_subparse_format_autodetect (self))) {
if (!(caps = gst_sub_parse_format_autodetect (self))) {
return GST_FLOW_UNEXPECTED;
}
}
@ -590,13 +590,13 @@ handle_buffer (GstSubparse * self, GstBuffer * buf)
#if 0
static void
gst_subparse_loop (GstPad * sinkpad)
gst_sub_parse_loop (GstPad * sinkpad)
{
GstFlowReturn ret = GST_FLOW_OK;
GstSubparse *self;
GstSubParse *self;
GstBuffer *buf;
GST_DEBUG ("gst_subparse_loop");
GST_DEBUG ("gst_sub_parse_loop");
self = GST_SUBPARSE (GST_OBJECT_PARENT (sinkpad));
GST_STREAM_LOCK (sinkpad);
@ -614,12 +614,12 @@ gst_subparse_loop (GstPad * sinkpad)
#endif
static GstFlowReturn
gst_subparse_chain (GstPad * sinkpad, GstBuffer * buf)
gst_sub_parse_chain (GstPad * sinkpad, GstBuffer * buf)
{
GstFlowReturn ret;
GstSubparse *self;
GstSubParse *self;
GST_DEBUG ("gst_subparse_chain");
GST_DEBUG ("gst_sub_parse_chain");
self = GST_SUBPARSE (GST_OBJECT_PARENT (sinkpad));
ret = handle_buffer (self, buf);
@ -628,9 +628,9 @@ gst_subparse_chain (GstPad * sinkpad, GstBuffer * buf)
}
static GstStateChangeReturn
gst_subparse_change_state (GstElement * element, GstStateChange transition)
gst_sub_parse_change_state (GstElement * element, GstStateChange transition)
{
GstSubparse *self = GST_SUBPARSE (element);
GstSubParse *self = GST_SUBPARSE (element);
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
@ -651,25 +651,25 @@ gst_subparse_change_state (GstElement * element, GstStateChange transition)
#if 0
/* typefinding stuff */
static GstTypeDefinition subparse_definition = {
static GstTypeDefinition sub_parse_definition = {
"subparse/x-text",
"text/plain",
".sub",
gst_subparse_type_find,
gst_sub_parse_type_find,
};
static GstCaps *
gst_subparse_type_find (GstBuffer * buf, gpointer private)
gst_sub_parse_type_find (GstBuffer * buf, gpointer private)
{
GstSubParseFormat format;
format = gst_subparse_data_format_autodetect (buf);
format = gst_sub_parse_data_format_autodetect (buf);
switch (format) {
case GST_SUB_PARSE_FORMAT_MDVDSUB:
GST_DEBUG (GST_CAT_PLUGIN_INFO, "MicroDVD format detected");
return gst_caps_new ("subparse_type_find", "text/plain", NULL);
return gst_caps_new ("sub_parse_type_find", "text/plain", NULL);
case GST_SUB_PARSE_FORMAT_SUBRIP:
GST_DEBUG (GST_CAT_PLUGIN_INFO, "SubRip format detected");
return gst_caps_new ("subparse_type_find", "text/plain", NULL);
return gst_caps_new ("sub_parse_type_find", "text/plain", NULL);
case GST_SUB_PARSE_FORMAT_UNKNOWN:
GST_DEBUG (GST_CAT_PLUGIN_INFO, "no subtitle format detected");
break;
@ -682,7 +682,7 @@ gst_subparse_type_find (GstBuffer * buf, gpointer private)
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (subparse_debug, "subparse", 0, ".sub parser");
GST_DEBUG_CATEGORY_INIT (sub_parse_debug, "subparse", 0, ".sub parser");
return gst_element_register (plugin, "subparse",
GST_RANK_PRIMARY, GST_TYPE_SUBPARSE);

View file

@ -26,18 +26,18 @@
G_BEGIN_DECLS
#define GST_TYPE_SUBPARSE \
(gst_subparse_get_type ())
(gst_sub_parse_get_type ())
#define GST_SUBPARSE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SUBPARSE, GstSubparse))
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SUBPARSE, GstSubParse))
#define GST_SUBPARSE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SUBPARSE, GstSubparse))
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SUBPARSE, GstSubParse))
#define GST_IS_SUBPARSE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SUBPARSE))
#define GST_IS_SUBPARSE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SUBPARSE))
typedef struct _GstSubparse GstSubparse;
typedef struct _GstSubparseClass GstSubparseClass;
typedef struct _GstSubParse GstSubParse;
typedef struct _GstSubParseClass GstSubParseClass;
/* format enum */
typedef enum
@ -57,7 +57,7 @@ typedef struct {
typedef gchar* (*Parser) (ParserState *state, const gchar *line);
struct _GstSubparse {
struct _GstSubParse {
GstElement element;
GstPad *sinkpad,*srcpad;
@ -75,11 +75,11 @@ struct _GstSubparse {
guint64 next_offset;
};
struct _GstSubparseClass {
struct _GstSubParseClass {
GstElementClass parent_class;
};
GType gst_subparse_get_type (void);
GType gst_sub_parse_get_type (void);
G_END_DECLS

View file

@ -23,24 +23,24 @@
#include <gst/gst.h>
GST_DEBUG_CATEGORY (videorate_debug);
#define GST_CAT_DEFAULT videorate_debug
GST_DEBUG_CATEGORY (video_rate_debug);
#define GST_CAT_DEFAULT video_rate_debug
#define GST_TYPE_VIDEORATE \
(gst_videorate_get_type())
#define GST_VIDEORATE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEORATE,GstVideorate))
#define GST_VIDEORATE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEORATE,GstVideorate))
#define GST_IS_VIDEORATE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEORATE))
#define GST_IS_VIDEORATE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEORATE))
#define GST_TYPE_VIDEO_RATE \
(gst_video_rate_get_type())
#define GST_VIDEO_RATE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_RATE,GstVideoRate))
#define GST_VIDEO_RATE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_RATE,GstVideoRate))
#define GST_IS_VIDEO_RATE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_RATE))
#define GST_IS_VIDEO_RATE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_RATE))
typedef struct _GstVideorate GstVideorate;
typedef struct _GstVideorateClass GstVideorateClass;
typedef struct _GstVideoRate GstVideoRate;
typedef struct _GstVideoRateClass GstVideoRateClass;
struct _GstVideorate
struct _GstVideoRate
{
GstElement element;
@ -64,19 +64,19 @@ struct _GstVideorate
gdouble new_pref;
};
struct _GstVideorateClass
struct _GstVideoRateClass
{
GstElementClass parent_class;
};
/* elementfactory information */
static GstElementDetails videorate_details =
static GstElementDetails video_rate_details =
GST_ELEMENT_DETAILS ("Video rate adjuster",
"Filter/Effect/Video",
"Drops/duplicates/adjusts timestamps on video frames to make a perfect stream",
"Wim Taymans <wim@fluendo.com>");
/* GstVideorate signals and args */
/* GstVideoRate signals and args */
enum
{
/* FILL ME */
@ -98,85 +98,85 @@ enum
/* FILL ME */
};
static GstStaticPadTemplate gst_videorate_src_template =
static GstStaticPadTemplate gst_video_rate_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb")
);
static GstStaticPadTemplate gst_videorate_sink_template =
static GstStaticPadTemplate gst_video_rate_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-raw-yuv; video/x-raw-rgb")
);
static void gst_videorate_base_init (gpointer g_class);
static void gst_videorate_class_init (GstVideorateClass * klass);
static void gst_videorate_init (GstVideorate * videorate);
static gboolean gst_videorate_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_videorate_chain (GstPad * pad, GstBuffer * buffer);
static void gst_video_rate_base_init (gpointer g_class);
static void gst_video_rate_class_init (GstVideoRateClass * klass);
static void gst_video_rate_init (GstVideoRate * videorate);
static gboolean gst_video_rate_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_video_rate_chain (GstPad * pad, GstBuffer * buffer);
static void gst_videorate_set_property (GObject * object,
static void gst_video_rate_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_videorate_get_property (GObject * object,
static void gst_video_rate_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GstStateChangeReturn gst_videorate_change_state (GstElement * element,
static GstStateChangeReturn gst_video_rate_change_state (GstElement * element,
GstStateChange transition);
static GstElementClass *parent_class = NULL;
/*static guint gst_videorate_signals[LAST_SIGNAL] = { 0 }; */
/*static guint gst_video_rate_signals[LAST_SIGNAL] = { 0 }; */
static GType
gst_videorate_get_type (void)
gst_video_rate_get_type (void)
{
static GType videorate_type = 0;
static GType video_rate_type = 0;
if (!videorate_type) {
static const GTypeInfo videorate_info = {
sizeof (GstVideorateClass),
gst_videorate_base_init,
if (!video_rate_type) {
static const GTypeInfo video_rate_info = {
sizeof (GstVideoRateClass),
gst_video_rate_base_init,
NULL,
(GClassInitFunc) gst_videorate_class_init,
(GClassInitFunc) gst_video_rate_class_init,
NULL,
NULL,
sizeof (GstVideorate),
sizeof (GstVideoRate),
0,
(GInstanceInitFunc) gst_videorate_init,
(GInstanceInitFunc) gst_video_rate_init,
};
videorate_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstVideorate", &videorate_info, 0);
video_rate_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstVideoRate", &video_rate_info, 0);
}
return videorate_type;
return video_rate_type;
}
static void
gst_videorate_base_init (gpointer g_class)
gst_video_rate_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &videorate_details);
gst_element_class_set_details (element_class, &video_rate_details);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_videorate_sink_template));
gst_static_pad_template_get (&gst_video_rate_sink_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_videorate_src_template));
gst_static_pad_template_get (&gst_video_rate_src_template));
}
static void
gst_videorate_class_init (GstVideorateClass * klass)
gst_video_rate_class_init (GstVideoRateClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
parent_class = g_type_class_peek_parent (klass);
object_class->set_property = gst_videorate_set_property;
object_class->get_property = gst_videorate_get_property;
object_class->set_property = gst_video_rate_set_property;
object_class->get_property = gst_video_rate_get_property;
g_object_class_install_property (object_class, ARG_IN,
g_param_spec_uint64 ("in", "In",
@ -199,12 +199,12 @@ gst_videorate_class_init (GstVideorateClass * klass)
"Value indicating how much to prefer new frames",
0.0, 1.0, DEFAULT_NEW_PREF, G_PARAM_READWRITE));
element_class->change_state = gst_videorate_change_state;
element_class->change_state = gst_video_rate_change_state;
}
/* return the caps that can be used on out_pad given in_caps on in_pad */
static gboolean
gst_videorate_transformcaps (GstPad * in_pad, GstCaps * in_caps,
gst_video_rate_transformcaps (GstPad * in_pad, GstCaps * in_caps,
GstPad * out_pad, GstCaps ** out_caps)
{
GstCaps *intersect;
@ -229,13 +229,13 @@ gst_videorate_transformcaps (GstPad * in_pad, GstCaps * in_caps,
}
static GstCaps *
gst_videorate_getcaps (GstPad * pad)
gst_video_rate_getcaps (GstPad * pad)
{
GstVideorate *videorate;
GstVideoRate *videorate;
GstPad *otherpad;
GstCaps *caps;
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
videorate = GST_VIDEO_RATE (GST_PAD_PARENT (pad));
otherpad = (pad == videorate->srcpad) ? videorate->sinkpad :
videorate->srcpad;
@ -245,7 +245,7 @@ gst_videorate_getcaps (GstPad * pad)
if (caps) {
GstCaps *transform;
gst_videorate_transformcaps (otherpad, caps, pad, &transform);
gst_video_rate_transformcaps (otherpad, caps, pad, &transform);
gst_caps_unref (caps);
caps = transform;
} else {
@ -257,15 +257,15 @@ gst_videorate_getcaps (GstPad * pad)
}
static gboolean
gst_videorate_setcaps (GstPad * pad, GstCaps * caps)
gst_video_rate_setcaps (GstPad * pad, GstCaps * caps)
{
GstVideorate *videorate;
GstVideoRate *videorate;
GstStructure *structure;
gboolean ret = TRUE;
GstPad *otherpad, *opeer;
gint rate_numerator, rate_denominator;
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
videorate = GST_VIDEO_RATE (GST_PAD_PARENT (pad));
structure = gst_caps_get_structure (caps, 0);
if (!gst_structure_get_fraction (structure, "framerate",
@ -297,7 +297,7 @@ gst_videorate_setcaps (GstPad * pad, GstCaps * caps)
ret = FALSE;
/* see how we can transform the input caps */
if (!gst_videorate_transformcaps (pad, caps, otherpad, &transform))
if (!gst_video_rate_transformcaps (pad, caps, otherpad, &transform))
goto done;
/* see what the peer can do */
@ -342,7 +342,7 @@ done:
}
static void
gst_videorate_blank_data (GstVideorate * videorate)
gst_video_rate_blank_data (GstVideoRate * videorate)
{
GST_DEBUG ("resetting data");
if (videorate->prevbuf)
@ -367,34 +367,34 @@ gst_videorate_blank_data (GstVideorate * videorate)
}
static void
gst_videorate_init (GstVideorate * videorate)
gst_video_rate_init (GstVideoRate * videorate)
{
GST_DEBUG ("gst_videorate_init");
GST_DEBUG ("gst_video_rate_init");
videorate->sinkpad =
gst_pad_new_from_static_template (&gst_videorate_sink_template, "sink");
gst_pad_new_from_static_template (&gst_video_rate_sink_template, "sink");
gst_element_add_pad (GST_ELEMENT (videorate), videorate->sinkpad);
gst_pad_set_event_function (videorate->sinkpad, gst_videorate_event);
gst_pad_set_chain_function (videorate->sinkpad, gst_videorate_chain);
gst_pad_set_getcaps_function (videorate->sinkpad, gst_videorate_getcaps);
gst_pad_set_setcaps_function (videorate->sinkpad, gst_videorate_setcaps);
gst_pad_set_event_function (videorate->sinkpad, gst_video_rate_event);
gst_pad_set_chain_function (videorate->sinkpad, gst_video_rate_chain);
gst_pad_set_getcaps_function (videorate->sinkpad, gst_video_rate_getcaps);
gst_pad_set_setcaps_function (videorate->sinkpad, gst_video_rate_setcaps);
videorate->srcpad =
gst_pad_new_from_static_template (&gst_videorate_src_template, "src");
gst_pad_new_from_static_template (&gst_video_rate_src_template, "src");
gst_element_add_pad (GST_ELEMENT (videorate), videorate->srcpad);
gst_pad_set_getcaps_function (videorate->srcpad, gst_videorate_getcaps);
gst_pad_set_setcaps_function (videorate->srcpad, gst_videorate_setcaps);
gst_pad_set_getcaps_function (videorate->srcpad, gst_video_rate_getcaps);
gst_pad_set_setcaps_function (videorate->srcpad, gst_video_rate_setcaps);
gst_videorate_blank_data (videorate);
gst_video_rate_blank_data (videorate);
videorate->silent = DEFAULT_SILENT;
videorate->new_pref = DEFAULT_NEW_PREF;
}
static GstFlowReturn
gst_videorate_event (GstPad * pad, GstEvent * event)
gst_video_rate_event (GstPad * pad, GstEvent * event)
{
GstVideorate *videorate;
GstVideoRate *videorate;
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
videorate = GST_VIDEO_RATE (GST_PAD_PARENT (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NEWSEGMENT:
@ -428,7 +428,7 @@ gst_videorate_event (GstPad * pad, GstEvent * event)
}
case GST_EVENT_FLUSH_STOP:
{
gst_videorate_blank_data (videorate);
gst_video_rate_blank_data (videorate);
}
default:
break;
@ -438,12 +438,12 @@ gst_videorate_event (GstPad * pad, GstEvent * event)
}
static GstFlowReturn
gst_videorate_chain (GstPad * pad, GstBuffer * buffer)
gst_video_rate_chain (GstPad * pad, GstBuffer * buffer)
{
GstVideorate *videorate;
GstVideoRate *videorate;
GstFlowReturn res = GST_FLOW_OK;
videorate = GST_VIDEORATE (GST_PAD_PARENT (pad));
videorate = GST_VIDEO_RATE (GST_PAD_PARENT (pad));
if (videorate->from_rate_numerator == 0 ||
videorate->from_rate_denominator == 0 ||
@ -566,10 +566,10 @@ done:
}
static void
gst_videorate_set_property (GObject * object,
gst_video_rate_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
GstVideorate *videorate = GST_VIDEORATE (object);
GstVideoRate *videorate = GST_VIDEO_RATE (object);
switch (prop_id) {
case ARG_SILENT:
@ -585,10 +585,10 @@ gst_videorate_set_property (GObject * object,
}
static void
gst_videorate_get_property (GObject * object,
gst_video_rate_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
GstVideorate *videorate = GST_VIDEORATE (object);
GstVideoRate *videorate = GST_VIDEO_RATE (object);
switch (prop_id) {
case ARG_IN:
@ -616,12 +616,12 @@ gst_videorate_get_property (GObject * object,
}
static GstStateChangeReturn
gst_videorate_change_state (GstElement * element, GstStateChange transition)
gst_video_rate_change_state (GstElement * element, GstStateChange transition)
{
GstStateChangeReturn ret;
GstVideorate *videorate;
GstVideoRate *videorate;
videorate = GST_VIDEORATE (element);
videorate = GST_VIDEO_RATE (element);
switch (transition) {
default:
@ -632,7 +632,7 @@ gst_videorate_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_videorate_blank_data (videorate);
gst_video_rate_blank_data (videorate);
break;
default:
break;
@ -644,11 +644,11 @@ gst_videorate_change_state (GstElement * element, GstStateChange transition)
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (videorate_debug, "videorate", 0,
"Videorate stream fixer");
GST_DEBUG_CATEGORY_INIT (video_rate_debug, "videorate", 0,
"VideoRate stream fixer");
return gst_element_register (plugin, "videorate", GST_RANK_NONE,
GST_TYPE_VIDEORATE);
GST_TYPE_VIDEO_RATE);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -32,10 +32,10 @@
/* debug variable definition */
GST_DEBUG_CATEGORY (videoscale_debug);
GST_DEBUG_CATEGORY (video_scale_debug);
/* elementfactory information */
static GstElementDetails videoscale_details =
static GstElementDetails video_scale_details =
GST_ELEMENT_DETAILS ("Video scaler",
"Filter/Effect/Video",
"Resizes video",
@ -48,7 +48,7 @@ enum
/* FILL ME */
};
static GstStaticCaps gst_videoscale_format_caps[] = {
static GstStaticCaps gst_video_scale_format_caps[] = {
GST_STATIC_CAPS (GST_VIDEO_CAPS_RGBx),
GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB),
GST_STATIC_CAPS (GST_VIDEO_CAPS_BGRx),
@ -68,43 +68,43 @@ static GstStaticCaps gst_videoscale_format_caps[] = {
enum
{
GST_VIDEOSCALE_RGBx = 0,
GST_VIDEOSCALE_xRGB,
GST_VIDEOSCALE_BGRx,
GST_VIDEOSCALE_xBGR,
GST_VIDEOSCALE_RGB,
GST_VIDEOSCALE_BGR,
GST_VIDEOSCALE_AYUV,
GST_VIDEOSCALE_YUY2,
GST_VIDEOSCALE_YVYU,
GST_VIDEOSCALE_UYVY,
GST_VIDEOSCALE_Y,
GST_VIDEOSCALE_I420,
GST_VIDEOSCALE_YV12,
GST_VIDEOSCALE_RGB565,
GST_VIDEOSCALE_RGB555
GST_VIDEO_SCALE_RGBx = 0,
GST_VIDEO_SCALE_xRGB,
GST_VIDEO_SCALE_BGRx,
GST_VIDEO_SCALE_xBGR,
GST_VIDEO_SCALE_RGB,
GST_VIDEO_SCALE_BGR,
GST_VIDEO_SCALE_AYUV,
GST_VIDEO_SCALE_YUY2,
GST_VIDEO_SCALE_YVYU,
GST_VIDEO_SCALE_UYVY,
GST_VIDEO_SCALE_Y,
GST_VIDEO_SCALE_I420,
GST_VIDEO_SCALE_YV12,
GST_VIDEO_SCALE_RGB565,
GST_VIDEO_SCALE_RGB555
};
#define GST_TYPE_VIDEOSCALE_METHOD (gst_videoscale_method_get_type())
#define GST_TYPE_VIDEO_SCALE_METHOD (gst_video_scale_method_get_type())
static GType
gst_videoscale_method_get_type (void)
gst_video_scale_method_get_type (void)
{
static GType videoscale_method_type = 0;
static GEnumValue videoscale_methods[] = {
{GST_VIDEOSCALE_NEAREST, "Nearest Neighbour", "nearest-neighbour"},
{GST_VIDEOSCALE_BILINEAR, "Bilinear", "bilinear"},
static GType video_scale_method_type = 0;
static GEnumValue video_scale_methods[] = {
{GST_VIDEO_SCALE_NEAREST, "Nearest Neighbour", "nearest-neighbour"},
{GST_VIDEO_SCALE_BILINEAR, "Bilinear", "bilinear"},
{0, NULL, NULL},
};
if (!videoscale_method_type) {
videoscale_method_type =
g_enum_register_static ("GstVideoscaleMethod", videoscale_methods);
if (!video_scale_method_type) {
video_scale_method_type =
g_enum_register_static ("GstVideoScaleMethod", video_scale_methods);
}
return videoscale_method_type;
return video_scale_method_type;
}
static GstCaps *
gst_videoscale_get_capslist (void)
gst_video_scale_get_capslist (void)
{
static GstCaps *caps;
@ -112,96 +112,96 @@ gst_videoscale_get_capslist (void)
int i;
caps = gst_caps_new_empty ();
for (i = 0; i < G_N_ELEMENTS (gst_videoscale_format_caps); i++)
for (i = 0; i < G_N_ELEMENTS (gst_video_scale_format_caps); i++)
gst_caps_append (caps,
gst_caps_make_writable
(gst_static_caps_get (&gst_videoscale_format_caps[i])));
(gst_static_caps_get (&gst_video_scale_format_caps[i])));
}
return caps;
}
static GstPadTemplate *
gst_videoscale_src_template_factory (void)
gst_video_scale_src_template_factory (void)
{
return gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
gst_caps_ref (gst_videoscale_get_capslist ()));
gst_caps_ref (gst_video_scale_get_capslist ()));
}
static GstPadTemplate *
gst_videoscale_sink_template_factory (void)
gst_video_scale_sink_template_factory (void)
{
return gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
gst_caps_ref (gst_videoscale_get_capslist ()));
gst_caps_ref (gst_video_scale_get_capslist ()));
}
static void gst_videoscale_base_init (gpointer g_class);
static void gst_videoscale_class_init (GstVideoscaleClass * klass);
static void gst_videoscale_init (GstVideoscale * videoscale);
static gboolean gst_videoscale_handle_src_event (GstPad * pad,
static void gst_video_scale_base_init (gpointer g_class);
static void gst_video_scale_class_init (GstVideoScaleClass * klass);
static void gst_video_scale_init (GstVideoScale * videoscale);
static gboolean gst_video_scale_handle_src_event (GstPad * pad,
GstEvent * event);
/* base transform vmethods */
static GstCaps *gst_videoscale_transform_caps (GstBaseTransform * trans,
static GstCaps *gst_video_scale_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps);
static gboolean gst_videoscale_set_caps (GstBaseTransform * trans,
static gboolean gst_video_scale_set_caps (GstBaseTransform * trans,
GstCaps * in, GstCaps * out);
static gboolean gst_videoscale_get_unit_size (GstBaseTransform * trans,
static gboolean gst_video_scale_get_unit_size (GstBaseTransform * trans,
GstCaps * caps, guint * size);
static GstFlowReturn gst_videoscale_transform (GstBaseTransform * trans,
static GstFlowReturn gst_video_scale_transform (GstBaseTransform * trans,
GstBuffer * in, GstBuffer * out);
static void gst_videoscale_fixate_caps (GstBaseTransform * base,
static void gst_video_scale_fixate_caps (GstBaseTransform * base,
GstPadDirection direction, GstCaps * caps, GstCaps * othercaps);
static void gst_videoscale_set_property (GObject * object, guint prop_id,
static void gst_video_scale_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_videoscale_get_property (GObject * object, guint prop_id,
static void gst_video_scale_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstElementClass *parent_class = NULL;
GType
gst_videoscale_get_type (void)
gst_video_scale_get_type (void)
{
static GType videoscale_type = 0;
static GType video_scale_type = 0;
if (!videoscale_type) {
static const GTypeInfo videoscale_info = {
sizeof (GstVideoscaleClass),
gst_videoscale_base_init,
if (!video_scale_type) {
static const GTypeInfo video_scale_info = {
sizeof (GstVideoScaleClass),
gst_video_scale_base_init,
NULL,
(GClassInitFunc) gst_videoscale_class_init,
(GClassInitFunc) gst_video_scale_class_init,
NULL,
NULL,
sizeof (GstVideoscale),
sizeof (GstVideoScale),
0,
(GInstanceInitFunc) gst_videoscale_init,
(GInstanceInitFunc) gst_video_scale_init,
};
videoscale_type =
g_type_register_static (GST_TYPE_BASE_TRANSFORM, "GstVideoscale",
&videoscale_info, 0);
video_scale_type =
g_type_register_static (GST_TYPE_BASE_TRANSFORM, "GstVideoScale",
&video_scale_info, 0);
}
return videoscale_type;
return video_scale_type;
}
static void
gst_videoscale_base_init (gpointer g_class)
gst_video_scale_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &videoscale_details);
gst_element_class_set_details (element_class, &video_scale_details);
gst_element_class_add_pad_template (element_class,
gst_videoscale_sink_template_factory ());
gst_video_scale_sink_template_factory ());
gst_element_class_add_pad_template (element_class,
gst_videoscale_src_template_factory ());
gst_video_scale_src_template_factory ());
}
static void
gst_videoscale_class_init (GstVideoscaleClass * klass)
gst_video_scale_class_init (GstVideoScaleClass * klass)
{
GObjectClass *gobject_class;
GstBaseTransformClass *trans_class;
@ -209,19 +209,20 @@ gst_videoscale_class_init (GstVideoscaleClass * klass)
gobject_class = (GObjectClass *) klass;
trans_class = (GstBaseTransformClass *) klass;
gobject_class->set_property = gst_videoscale_set_property;
gobject_class->get_property = gst_videoscale_get_property;
gobject_class->set_property = gst_video_scale_set_property;
gobject_class->get_property = gst_video_scale_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_METHOD,
g_param_spec_enum ("method", "method", "method",
GST_TYPE_VIDEOSCALE_METHOD, 0, G_PARAM_READWRITE));
GST_TYPE_VIDEO_SCALE_METHOD, 0, G_PARAM_READWRITE));
trans_class->transform_caps =
GST_DEBUG_FUNCPTR (gst_videoscale_transform_caps);
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_videoscale_set_caps);
trans_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_videoscale_get_unit_size);
trans_class->transform = GST_DEBUG_FUNCPTR (gst_videoscale_transform);
trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_videoscale_fixate_caps);
GST_DEBUG_FUNCPTR (gst_video_scale_transform_caps);
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_video_scale_set_caps);
trans_class->get_unit_size =
GST_DEBUG_FUNCPTR (gst_video_scale_get_unit_size);
trans_class->transform = GST_DEBUG_FUNCPTR (gst_video_scale_transform);
trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_video_scale_fixate_caps);
trans_class->passthrough_on_same_caps = TRUE;
@ -229,23 +230,23 @@ gst_videoscale_class_init (GstVideoscaleClass * klass)
}
static void
gst_videoscale_init (GstVideoscale * videoscale)
gst_video_scale_init (GstVideoScale * videoscale)
{
GstBaseTransform *trans = GST_BASE_TRANSFORM (videoscale);
gst_pad_set_event_function (trans->srcpad, gst_videoscale_handle_src_event);
gst_pad_set_event_function (trans->srcpad, gst_video_scale_handle_src_event);
videoscale->tmp_buf = NULL;
videoscale->method = GST_VIDEOSCALE_NEAREST;
/*videoscale->method = GST_VIDEOSCALE_BILINEAR; */
videoscale->method = GST_VIDEO_SCALE_NEAREST;
/*videoscale->method = GST_VIDEO_SCALE_BILINEAR; */
}
static void
gst_videoscale_set_property (GObject * object, guint prop_id,
gst_video_scale_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstVideoscale *src = GST_VIDEOSCALE (object);
GstVideoScale *src = GST_VIDEO_SCALE (object);
switch (prop_id) {
case PROP_METHOD:
@ -258,10 +259,10 @@ gst_videoscale_set_property (GObject * object, guint prop_id,
}
static void
gst_videoscale_get_property (GObject * object, guint prop_id, GValue * value,
gst_video_scale_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstVideoscale *src = GST_VIDEOSCALE (object);
GstVideoScale *src = GST_VIDEO_SCALE (object);
switch (prop_id) {
case PROP_METHOD:
@ -274,14 +275,14 @@ gst_videoscale_get_property (GObject * object, guint prop_id, GValue * value,
}
static GstCaps *
gst_videoscale_transform_caps (GstBaseTransform * trans,
gst_video_scale_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps)
{
GstVideoscale *videoscale;
GstVideoScale *videoscale;
GstCaps *ret;
int i;
videoscale = GST_VIDEOSCALE (trans);
videoscale = GST_VIDEO_SCALE (trans);
ret = gst_caps_copy (caps);
@ -299,13 +300,13 @@ gst_videoscale_transform_caps (GstBaseTransform * trans,
}
static int
gst_videoscale_get_format (GstCaps * caps)
gst_video_scale_get_format (GstCaps * caps)
{
int i;
GstCaps *icaps, *scaps;
for (i = 0; i < G_N_ELEMENTS (gst_videoscale_format_caps); i++) {
scaps = gst_static_caps_get (&gst_videoscale_format_caps[i]);
for (i = 0; i < G_N_ELEMENTS (gst_video_scale_format_caps); i++) {
scaps = gst_static_caps_get (&gst_video_scale_format_caps[i]);
icaps = gst_caps_intersect (caps, scaps);
if (!gst_caps_is_empty (icaps)) {
gst_caps_unref (icaps);
@ -319,7 +320,7 @@ gst_videoscale_get_format (GstCaps * caps)
/* calculate the size of a buffer */
static gboolean
gst_videoscale_prepare_size (gint format,
gst_video_scale_prepare_size (gint format,
VSImage * img, gint width, gint height, guint * size)
{
gboolean res = TRUE;
@ -328,31 +329,31 @@ gst_videoscale_prepare_size (gint format,
img->height = height;
switch (format) {
case GST_VIDEOSCALE_RGBx:
case GST_VIDEOSCALE_xRGB:
case GST_VIDEOSCALE_BGRx:
case GST_VIDEOSCALE_xBGR:
case GST_VIDEOSCALE_AYUV:
case GST_VIDEO_SCALE_RGBx:
case GST_VIDEO_SCALE_xRGB:
case GST_VIDEO_SCALE_BGRx:
case GST_VIDEO_SCALE_xBGR:
case GST_VIDEO_SCALE_AYUV:
img->stride = img->width * 4;
*size = img->stride * img->height;
break;
case GST_VIDEOSCALE_RGB:
case GST_VIDEOSCALE_BGR:
case GST_VIDEO_SCALE_RGB:
case GST_VIDEO_SCALE_BGR:
img->stride = GST_ROUND_UP_4 (img->width * 3);
*size = img->stride * img->height;
break;
case GST_VIDEOSCALE_YUY2:
case GST_VIDEOSCALE_YVYU:
case GST_VIDEOSCALE_UYVY:
case GST_VIDEO_SCALE_YUY2:
case GST_VIDEO_SCALE_YVYU:
case GST_VIDEO_SCALE_UYVY:
img->stride = GST_ROUND_UP_4 (img->width * 2);
*size = img->stride * img->height;
break;
case GST_VIDEOSCALE_Y:
case GST_VIDEO_SCALE_Y:
img->stride = GST_ROUND_UP_4 (img->width);
*size = img->stride * img->height;
break;
case GST_VIDEOSCALE_I420:
case GST_VIDEOSCALE_YV12:
case GST_VIDEO_SCALE_I420:
case GST_VIDEO_SCALE_YV12:
{
gulong img_u_stride, img_u_height;
@ -365,11 +366,11 @@ gst_videoscale_prepare_size (gint format,
2 * img_u_stride * img_u_height;
break;
}
case GST_VIDEOSCALE_RGB565:
case GST_VIDEO_SCALE_RGB565:
img->stride = GST_ROUND_UP_4 (img->width * 2);
*size = img->stride * img->height;
break;
case GST_VIDEOSCALE_RGB555:
case GST_VIDEO_SCALE_RGB555:
img->stride = GST_ROUND_UP_4 (img->width * 2);
*size = img->stride * img->height;
break;
@ -393,18 +394,18 @@ parse_caps (GstCaps * caps, gint * format, gint * width, gint * height)
ret &= gst_structure_get_int (structure, "height", height);
if (format)
*format = gst_videoscale_get_format (caps);
*format = gst_video_scale_get_format (caps);
return ret;
}
static gboolean
gst_videoscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
gst_video_scale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
{
GstVideoscale *videoscale;
GstVideoScale *videoscale;
gboolean ret;
videoscale = GST_VIDEOSCALE (trans);
videoscale = GST_VIDEO_SCALE (trans);
ret = parse_caps (in, &videoscale->format, &videoscale->from_width,
&videoscale->from_height);
@ -412,11 +413,11 @@ gst_videoscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
if (!ret)
goto done;
ret = gst_videoscale_prepare_size (videoscale->format,
ret = gst_video_scale_prepare_size (videoscale->format,
&videoscale->src, videoscale->from_width, videoscale->from_height,
&videoscale->src_size);
ret &= gst_videoscale_prepare_size (videoscale->format,
ret &= gst_video_scale_prepare_size (videoscale->format,
&videoscale->dest, videoscale->to_width, videoscale->to_height,
&videoscale->dest_size);
@ -438,28 +439,28 @@ done:
}
static gboolean
gst_videoscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
gst_video_scale_get_unit_size (GstBaseTransform * trans, GstCaps * caps,
guint * size)
{
GstVideoscale *videoscale;
GstVideoScale *videoscale;
gint format, width, height;
VSImage img;
g_return_val_if_fail (size, FALSE);
videoscale = GST_VIDEOSCALE (trans);
videoscale = GST_VIDEO_SCALE (trans);
if (!parse_caps (caps, &format, &width, &height))
return FALSE;
if (!gst_videoscale_prepare_size (format, &img, width, height, size))
if (!gst_video_scale_prepare_size (format, &img, width, height, size))
return FALSE;
return TRUE;
}
static void
gst_videoscale_fixate_caps (GstBaseTransform * base, GstPadDirection direction,
gst_video_scale_fixate_caps (GstBaseTransform * base, GstPadDirection direction,
GstCaps * caps, GstCaps * othercaps)
{
GstStructure *ins, *outs;
@ -554,7 +555,7 @@ gst_videoscale_fixate_caps (GstBaseTransform * base, GstPadDirection direction,
}
static gboolean
gst_videoscale_prepare_image (gint format, GstBuffer * buf,
gst_video_scale_prepare_image (gint format, GstBuffer * buf,
VSImage * img, VSImage * img_u, VSImage * img_v)
{
gboolean res = TRUE;
@ -562,8 +563,8 @@ gst_videoscale_prepare_image (gint format, GstBuffer * buf,
img->pixels = GST_BUFFER_DATA (buf);
switch (format) {
case GST_VIDEOSCALE_I420:
case GST_VIDEOSCALE_YV12:
case GST_VIDEO_SCALE_I420:
case GST_VIDEO_SCALE_YV12:
img_u->pixels = img->pixels + GST_ROUND_UP_2 (img->height) * img->stride;
img_u->height = GST_ROUND_UP_2 (img->height) / 2;
img_u->width = GST_ROUND_UP_2 (img->width) / 2;
@ -578,10 +579,10 @@ gst_videoscale_prepare_image (gint format, GstBuffer * buf,
}
static GstFlowReturn
gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in,
gst_video_scale_transform (GstBaseTransform * trans, GstBuffer * in,
GstBuffer * out)
{
GstVideoscale *videoscale;
GstVideoScale *videoscale;
GstFlowReturn ret = GST_FLOW_OK;
VSImage *dest;
VSImage *src;
@ -590,92 +591,92 @@ gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in,
VSImage src_u;
VSImage src_v;
videoscale = GST_VIDEOSCALE (trans);
videoscale = GST_VIDEO_SCALE (trans);
gst_buffer_stamp (out, in);
src = &videoscale->src;
dest = &videoscale->dest;
gst_videoscale_prepare_image (videoscale->format, in, src, &src_u, &src_v);
gst_videoscale_prepare_image (videoscale->format, out, dest, &dest_u,
gst_video_scale_prepare_image (videoscale->format, in, src, &src_u, &src_v);
gst_video_scale_prepare_image (videoscale->format, out, dest, &dest_u,
&dest_v);
switch (videoscale->method) {
case GST_VIDEOSCALE_NEAREST:
case GST_VIDEO_SCALE_NEAREST:
switch (videoscale->format) {
case GST_VIDEOSCALE_RGBx:
case GST_VIDEOSCALE_xRGB:
case GST_VIDEOSCALE_BGRx:
case GST_VIDEOSCALE_xBGR:
case GST_VIDEOSCALE_AYUV:
case GST_VIDEO_SCALE_RGBx:
case GST_VIDEO_SCALE_xRGB:
case GST_VIDEO_SCALE_BGRx:
case GST_VIDEO_SCALE_xBGR:
case GST_VIDEO_SCALE_AYUV:
vs_image_scale_nearest_RGBA (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_RGB:
case GST_VIDEOSCALE_BGR:
case GST_VIDEO_SCALE_RGB:
case GST_VIDEO_SCALE_BGR:
vs_image_scale_nearest_RGB (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_YUY2:
case GST_VIDEOSCALE_YVYU:
case GST_VIDEO_SCALE_YUY2:
case GST_VIDEO_SCALE_YVYU:
vs_image_scale_nearest_YUYV (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_UYVY:
case GST_VIDEO_SCALE_UYVY:
vs_image_scale_nearest_UYVY (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_Y:
case GST_VIDEO_SCALE_Y:
vs_image_scale_nearest_Y (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_I420:
case GST_VIDEOSCALE_YV12:
case GST_VIDEO_SCALE_I420:
case GST_VIDEO_SCALE_YV12:
vs_image_scale_nearest_Y (dest, src, videoscale->tmp_buf);
vs_image_scale_nearest_Y (&dest_u, &src_u, videoscale->tmp_buf);
vs_image_scale_nearest_Y (&dest_v, &src_v, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_RGB565:
case GST_VIDEO_SCALE_RGB565:
vs_image_scale_nearest_RGB565 (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_RGB555:
case GST_VIDEO_SCALE_RGB555:
vs_image_scale_nearest_RGB555 (dest, src, videoscale->tmp_buf);
break;
default:
g_warning ("don't know how to scale");
}
break;
case GST_VIDEOSCALE_BILINEAR:
case GST_VIDEO_SCALE_BILINEAR:
switch (videoscale->format) {
case GST_VIDEOSCALE_RGBx:
case GST_VIDEOSCALE_xRGB:
case GST_VIDEOSCALE_BGRx:
case GST_VIDEOSCALE_xBGR:
case GST_VIDEOSCALE_AYUV:
case GST_VIDEO_SCALE_RGBx:
case GST_VIDEO_SCALE_xRGB:
case GST_VIDEO_SCALE_BGRx:
case GST_VIDEO_SCALE_xBGR:
case GST_VIDEO_SCALE_AYUV:
vs_image_scale_linear_RGBA (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_RGB:
case GST_VIDEOSCALE_BGR:
case GST_VIDEO_SCALE_RGB:
case GST_VIDEO_SCALE_BGR:
vs_image_scale_linear_RGB (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_YUY2:
case GST_VIDEOSCALE_YVYU:
case GST_VIDEO_SCALE_YUY2:
case GST_VIDEO_SCALE_YVYU:
vs_image_scale_linear_YUYV (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_UYVY:
case GST_VIDEO_SCALE_UYVY:
vs_image_scale_linear_UYVY (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_Y:
case GST_VIDEO_SCALE_Y:
vs_image_scale_linear_Y (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_I420:
case GST_VIDEOSCALE_YV12:
case GST_VIDEO_SCALE_I420:
case GST_VIDEO_SCALE_YV12:
vs_image_scale_linear_Y (dest, src, videoscale->tmp_buf);
//memset (dest_u.pixels, 128, dest_u.stride * dest_u.height);
//memset (dest_v.pixels, 128, dest_v.stride * dest_v.height);
vs_image_scale_linear_Y (&dest_u, &src_u, videoscale->tmp_buf);
vs_image_scale_linear_Y (&dest_v, &src_v, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_RGB565:
case GST_VIDEO_SCALE_RGB565:
vs_image_scale_linear_RGB565 (dest, src, videoscale->tmp_buf);
break;
case GST_VIDEOSCALE_RGB555:
case GST_VIDEO_SCALE_RGB555:
vs_image_scale_linear_RGB555 (dest, src, videoscale->tmp_buf);
break;
default:
@ -694,14 +695,14 @@ gst_videoscale_transform (GstBaseTransform * trans, GstBuffer * in,
}
static gboolean
gst_videoscale_handle_src_event (GstPad * pad, GstEvent * event)
gst_video_scale_handle_src_event (GstPad * pad, GstEvent * event)
{
GstVideoscale *videoscale;
GstVideoScale *videoscale;
gboolean ret;
double a;
GstStructure *structure;
videoscale = GST_VIDEOSCALE (gst_pad_get_parent (pad));
videoscale = GST_VIDEO_SCALE (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (videoscale, "handling %s event",
GST_EVENT_TYPE_NAME (event));
@ -736,10 +737,10 @@ static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "videoscale", GST_RANK_NONE,
GST_TYPE_VIDEOSCALE))
GST_TYPE_VIDEO_SCALE))
return FALSE;
GST_DEBUG_CATEGORY_INIT (videoscale_debug, "videoscale", 0,
GST_DEBUG_CATEGORY_INIT (video_scale_debug, "videoscale", 0,
"videoscale element");
return TRUE;

View file

@ -18,8 +18,8 @@
*/
#ifndef __GST_VIDEOSCALE_H__
#define __GST_VIDEOSCALE_H__
#ifndef __GST_VIDEO_SCALE_H__
#define __GST_VIDEO_SCALE_H__
#include <gst/gst.h>
@ -30,33 +30,33 @@
G_BEGIN_DECLS
GST_DEBUG_CATEGORY_EXTERN (videoscale_debug);
#define GST_CAT_DEFAULT videoscale_debug
GST_DEBUG_CATEGORY_EXTERN (video_scale_debug);
#define GST_CAT_DEFAULT video_scale_debug
#define GST_TYPE_VIDEOSCALE \
(gst_videoscale_get_type())
#define GST_VIDEOSCALE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEOSCALE,GstVideoscale))
#define GST_VIDEOSCALE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEOSCALE,GstVideoscale))
#define GST_IS_VIDEOSCALE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEOSCALE))
#define GST_IS_VIDEOSCALE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEOSCALE))
#define GST_TYPE_VIDEO_SCALE \
(gst_video_scale_get_type())
#define GST_VIDEO_SCALE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_SCALE,GstVideoScale))
#define GST_VIDEO_SCALE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_SCALE,GstVideoScale))
#define GST_IS_VIDEO_SCALE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_SCALE))
#define GST_IS_VIDEO_SCALE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_SCALE))
typedef enum {
GST_VIDEOSCALE_NEAREST,
GST_VIDEOSCALE_BILINEAR,
GST_VIDEO_SCALE_NEAREST,
GST_VIDEO_SCALE_BILINEAR,
} GstVideoScaleMethod;
typedef struct _GstVideoscale GstVideoscale;
typedef struct _GstVideoscaleClass GstVideoscaleClass;
typedef struct _GstVideoScale GstVideoScale;
typedef struct _GstVideoScaleClass GstVideoScaleClass;
struct _GstVideoscale {
struct _GstVideoScale {
GstBaseTransform element;
GstVideoScaleMethod method;
@ -76,15 +76,15 @@ struct _GstVideoscale {
guint8 *tmp_buf;
};
struct _GstVideoscaleClass {
struct _GstVideoScaleClass {
GstBaseTransformClass parent_class;
};
GType gst_videoscale_get_type(void);
GType gst_video_scale_get_type(void);
G_END_DECLS
#endif /* __GST_VIDEOSCALE_H__ */
#endif /* __GST_VIDEO_SCALE_H__ */

View file

@ -43,11 +43,11 @@
#define USE_PEER_BUFFERALLOC
GST_DEBUG_CATEGORY (videotestsrc_debug);
#define GST_CAT_DEFAULT videotestsrc_debug
GST_DEBUG_CATEGORY (video_test_src_debug);
#define GST_CAT_DEFAULT video_test_src_debug
static GstElementDetails videotestsrc_details =
static GstElementDetails video_test_src_details =
GST_ELEMENT_DETAILS ("Video test source",
"Source/Video",
"Creates a test video stream",
@ -64,62 +64,62 @@ enum
};
GST_BOILERPLATE (GstVideoTestSrc, gst_videotestsrc, GstPushSrc,
GST_BOILERPLATE (GstVideoTestSrc, gst_video_test_src, GstPushSrc,
GST_TYPE_PUSH_SRC);
static void gst_videotestsrc_set_pattern (GstVideoTestSrc * videotestsrc,
static void gst_video_test_src_set_pattern (GstVideoTestSrc * videotestsrc,
int pattern_type);
static void gst_videotestsrc_set_property (GObject * object, guint prop_id,
static void gst_video_test_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_videotestsrc_get_property (GObject * object, guint prop_id,
static void gst_video_test_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstCaps *gst_videotestsrc_getcaps (GstBaseSrc * bsrc);
static gboolean gst_videotestsrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
static void gst_videotestsrc_src_fixate (GstPad * pad, GstCaps * caps);
static GstCaps *gst_video_test_src_getcaps (GstBaseSrc * bsrc);
static gboolean gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps);
static void gst_video_test_src_src_fixate (GstPad * pad, GstCaps * caps);
static gboolean gst_videotestsrc_event (GstBaseSrc * bsrc, GstEvent * event);
static gboolean gst_video_test_src_event (GstBaseSrc * bsrc, GstEvent * event);
static void gst_videotestsrc_get_times (GstBaseSrc * basesrc,
static void gst_video_test_src_get_times (GstBaseSrc * basesrc,
GstBuffer * buffer, GstClockTime * start, GstClockTime * end);
static GstFlowReturn gst_videotestsrc_create (GstPushSrc * psrc,
static GstFlowReturn gst_video_test_src_create (GstPushSrc * psrc,
GstBuffer ** buffer);
#define GST_TYPE_VIDEOTESTSRC_PATTERN (gst_videotestsrc_pattern_get_type ())
#define GST_TYPE_VIDEO_TEST_SRC_PATTERN (gst_video_test_src_pattern_get_type ())
static GType
gst_videotestsrc_pattern_get_type (void)
gst_video_test_src_pattern_get_type (void)
{
static GType videotestsrc_pattern_type = 0;
static GType video_test_src_pattern_type = 0;
static GEnumValue pattern_types[] = {
{GST_VIDEOTESTSRC_SMPTE, "SMPTE 100% color bars", "smpte"},
{GST_VIDEOTESTSRC_SNOW, "Random (television snow)", "snow"},
{GST_VIDEOTESTSRC_BLACK, "100% Black", "black"},
{GST_VIDEO_TEST_SRC_SMPTE, "SMPTE 100% color bars", "smpte"},
{GST_VIDEO_TEST_SRC_SNOW, "Random (television snow)", "snow"},
{GST_VIDEO_TEST_SRC_BLACK, "100% Black", "black"},
{0, NULL, NULL},
};
if (!videotestsrc_pattern_type) {
videotestsrc_pattern_type =
if (!video_test_src_pattern_type) {
video_test_src_pattern_type =
g_enum_register_static ("GstVideoTestSrcPattern", pattern_types);
}
return videotestsrc_pattern_type;
return video_test_src_pattern_type;
}
static void
gst_videotestsrc_base_init (gpointer g_class)
gst_video_test_src_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details (element_class, &videotestsrc_details);
gst_element_class_set_details (element_class, &video_test_src_details);
gst_element_class_add_pad_template (element_class,
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
gst_videotestsrc_getcaps (NULL)));
gst_video_test_src_getcaps (NULL)));
}
static void
gst_videotestsrc_class_init (GstVideoTestSrcClass * klass)
gst_video_test_src_class_init (GstVideoTestSrcClass * klass)
{
GObjectClass *gobject_class;
GstBaseSrcClass *gstbasesrc_class;
@ -129,13 +129,13 @@ gst_videotestsrc_class_init (GstVideoTestSrcClass * klass)
gstbasesrc_class = (GstBaseSrcClass *) klass;
gstpushsrc_class = (GstPushSrcClass *) klass;
gobject_class->set_property = gst_videotestsrc_set_property;
gobject_class->get_property = gst_videotestsrc_get_property;
gobject_class->set_property = gst_video_test_src_set_property;
gobject_class->get_property = gst_video_test_src_get_property;
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_PATTERN,
g_param_spec_enum ("pattern", "Pattern",
"Type of test pattern to generate", GST_TYPE_VIDEOTESTSRC_PATTERN, 1,
G_PARAM_READWRITE));
"Type of test pattern to generate", GST_TYPE_VIDEO_TEST_SRC_PATTERN,
1, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass),
PROP_TIMESTAMP_OFFSET, g_param_spec_int64 ("timestamp-offset",
"Timestamp offset",
@ -145,22 +145,22 @@ gst_videotestsrc_class_init (GstVideoTestSrcClass * klass)
g_param_spec_boolean ("is-live", "Is Live",
"Whether to act as a live source", FALSE, G_PARAM_READWRITE));
gstbasesrc_class->get_caps = gst_videotestsrc_getcaps;
gstbasesrc_class->set_caps = gst_videotestsrc_setcaps;
gstbasesrc_class->event = gst_videotestsrc_event;
gstbasesrc_class->get_caps = gst_video_test_src_getcaps;
gstbasesrc_class->set_caps = gst_video_test_src_setcaps;
gstbasesrc_class->event = gst_video_test_src_event;
gstbasesrc_class->get_times = gst_videotestsrc_get_times;
gstpushsrc_class->create = gst_videotestsrc_create;
gstbasesrc_class->get_times = gst_video_test_src_get_times;
gstpushsrc_class->create = gst_video_test_src_create;
}
static void
gst_videotestsrc_init (GstVideoTestSrc * src, GstVideoTestSrcClass * g_class)
gst_video_test_src_init (GstVideoTestSrc * src, GstVideoTestSrcClass * g_class)
{
GstPad *pad = GST_BASE_SRC_PAD (src);
gst_pad_set_fixatecaps_function (pad, gst_videotestsrc_src_fixate);
gst_pad_set_fixatecaps_function (pad, gst_video_test_src_src_fixate);
gst_videotestsrc_set_pattern (src, GST_VIDEOTESTSRC_SMPTE);
gst_video_test_src_set_pattern (src, GST_VIDEO_TEST_SRC_SMPTE);
src->segment_start_frame = -1;
src->segment_end_frame = -1;
@ -170,7 +170,7 @@ gst_videotestsrc_init (GstVideoTestSrc * src, GstVideoTestSrcClass * g_class)
}
static void
gst_videotestsrc_src_fixate (GstPad * pad, GstCaps * caps)
gst_video_test_src_src_fixate (GstPad * pad, GstCaps * caps)
{
GstStructure *structure;
@ -182,21 +182,22 @@ gst_videotestsrc_src_fixate (GstPad * pad, GstCaps * caps)
}
static void
gst_videotestsrc_set_pattern (GstVideoTestSrc * videotestsrc, int pattern_type)
gst_video_test_src_set_pattern (GstVideoTestSrc * videotestsrc,
int pattern_type)
{
videotestsrc->pattern_type = pattern_type;
GST_DEBUG_OBJECT (videotestsrc, "setting pattern to %d", pattern_type);
switch (pattern_type) {
case GST_VIDEOTESTSRC_SMPTE:
videotestsrc->make_image = gst_videotestsrc_smpte;
case GST_VIDEO_TEST_SRC_SMPTE:
videotestsrc->make_image = gst_video_test_src_smpte;
break;
case GST_VIDEOTESTSRC_SNOW:
videotestsrc->make_image = gst_videotestsrc_snow;
case GST_VIDEO_TEST_SRC_SNOW:
videotestsrc->make_image = gst_video_test_src_snow;
break;
case GST_VIDEOTESTSRC_BLACK:
videotestsrc->make_image = gst_videotestsrc_black;
case GST_VIDEO_TEST_SRC_BLACK:
videotestsrc->make_image = gst_video_test_src_black;
break;
default:
g_assert_not_reached ();
@ -204,14 +205,14 @@ gst_videotestsrc_set_pattern (GstVideoTestSrc * videotestsrc, int pattern_type)
}
static void
gst_videotestsrc_set_property (GObject * object, guint prop_id,
gst_video_test_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstVideoTestSrc *src = GST_VIDEOTESTSRC (object);
GstVideoTestSrc *src = GST_VIDEO_TEST_SRC (object);
switch (prop_id) {
case PROP_PATTERN:
gst_videotestsrc_set_pattern (src, g_value_get_enum (value));
gst_video_test_src_set_pattern (src, g_value_get_enum (value));
break;
case PROP_TIMESTAMP_OFFSET:
src->timestamp_offset = g_value_get_int64 (value);
@ -225,10 +226,10 @@ gst_videotestsrc_set_property (GObject * object, guint prop_id,
}
static void
gst_videotestsrc_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
gst_video_test_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstVideoTestSrc *src = GST_VIDEOTESTSRC (object);
GstVideoTestSrc *src = GST_VIDEO_TEST_SRC (object);
switch (prop_id) {
case PROP_PATTERN:
@ -248,7 +249,7 @@ gst_videotestsrc_get_property (GObject * object, guint prop_id, GValue * value,
/* threadsafe because this gets called as the plugin is loaded */
static GstCaps *
gst_videotestsrc_getcaps (GstBaseSrc * unused)
gst_video_test_src_getcaps (GstBaseSrc * unused)
{
static GstCaps *capslist = NULL;
@ -274,7 +275,7 @@ gst_videotestsrc_getcaps (GstBaseSrc * unused)
}
static gboolean
gst_videotestsrc_parse_caps (const GstCaps * caps,
gst_video_test_src_parse_caps (const GstCaps * caps,
gint * width, gint * height, gint * rate_numerator, gint * rate_denominator,
struct fourcc_list_struct **fourcc)
{
@ -310,16 +311,16 @@ gst_videotestsrc_parse_caps (const GstCaps * caps,
}
static gboolean
gst_videotestsrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
gst_video_test_src_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
{
gboolean res;
gint width, height, rate_denominator, rate_numerator;
struct fourcc_list_struct *fourcc;
GstVideoTestSrc *videotestsrc;
videotestsrc = GST_VIDEOTESTSRC (bsrc);
videotestsrc = GST_VIDEO_TEST_SRC (bsrc);
res = gst_videotestsrc_parse_caps (caps, &width, &height,
res = gst_video_test_src_parse_caps (caps, &width, &height,
&rate_numerator, &rate_denominator, &fourcc);
if (res) {
/* looks ok here */
@ -338,13 +339,13 @@ gst_videotestsrc_setcaps (GstBaseSrc * bsrc, GstCaps * caps)
}
static gboolean
gst_videotestsrc_event (GstBaseSrc * bsrc, GstEvent * event)
gst_video_test_src_event (GstBaseSrc * bsrc, GstEvent * event)
{
gboolean res = TRUE;
GstVideoTestSrc *videotestsrc;
gint64 new_n_frames;
videotestsrc = GST_VIDEOTESTSRC (bsrc);
videotestsrc = GST_VIDEO_TEST_SRC (bsrc);
new_n_frames = videotestsrc->n_frames;
switch (GST_EVENT_TYPE (event)) {
@ -393,7 +394,7 @@ gst_videotestsrc_event (GstBaseSrc * bsrc, GstEvent * event)
}
static void
gst_videotestsrc_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
gst_video_test_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
GstClockTime * start, GstClockTime * end)
{
/* for live sources, sync on the timestamp of the buffer */
@ -416,19 +417,19 @@ gst_videotestsrc_get_times (GstBaseSrc * basesrc, GstBuffer * buffer,
}
static GstFlowReturn
gst_videotestsrc_create (GstPushSrc * psrc, GstBuffer ** buffer)
gst_video_test_src_create (GstPushSrc * psrc, GstBuffer ** buffer)
{
GstVideoTestSrc *src;
gulong newsize;
GstBuffer *outbuf;
GstFlowReturn res;
src = GST_VIDEOTESTSRC (psrc);
src = GST_VIDEO_TEST_SRC (psrc);
if (src->fourcc == NULL)
goto not_negotiated;
newsize = gst_videotestsrc_get_size (src, src->width, src->height);
newsize = gst_video_test_src_get_size (src, src->width, src->height);
g_return_val_if_fail (newsize > 0, GST_FLOW_ERROR);
@ -487,11 +488,11 @@ plugin_init (GstPlugin * plugin)
{
oil_init ();
GST_DEBUG_CATEGORY_INIT (videotestsrc_debug, "videotestsrc", 0,
GST_DEBUG_CATEGORY_INIT (video_test_src_debug, "videotestsrc", 0,
"Video Test Source");
return gst_element_register (plugin, "videotestsrc", GST_RANK_NONE,
GST_TYPE_VIDEOTESTSRC);
GST_TYPE_VIDEO_TEST_SRC);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -18,29 +18,29 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_VIDEOTESTSRC_H__
#define __GST_VIDEOTESTSRC_H__
#ifndef __GST_VIDEO_TEST_SRC_H__
#define __GST_VIDEO_TEST_SRC_H__
#include <gst/gst.h>
#include <gst/base/gstpushsrc.h>
G_BEGIN_DECLS
#define GST_TYPE_VIDEOTESTSRC \
(gst_videotestsrc_get_type())
#define GST_VIDEOTESTSRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEOTESTSRC,GstVideoTestSrc))
#define GST_VIDEOTESTSRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEOTESTSRC,GstVideoTestSrc))
#define GST_IS_VIDEOTESTSRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEOTESTSRC))
#define GST_IS_VIDEOTESTSRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEOTESTSRC))
#define GST_TYPE_VIDEO_TEST_SRC \
(gst_video_test_src_get_type())
#define GST_VIDEO_TEST_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrc))
#define GST_VIDEO_TEST_SRC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VIDEO_TEST_SRC,GstVideoTestSrc))
#define GST_IS_VIDEO_TEST_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEO_TEST_SRC))
#define GST_IS_VIDEO_TEST_SRC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VIDEO_TEST_SRC))
typedef enum {
GST_VIDEOTESTSRC_SMPTE,
GST_VIDEOTESTSRC_SNOW,
GST_VIDEOTESTSRC_BLACK,
GST_VIDEO_TEST_SRC_SMPTE,
GST_VIDEO_TEST_SRC_SNOW,
GST_VIDEO_TEST_SRC_BLACK,
} GstVideoTestSrcPattern;
typedef struct _GstVideoTestSrc GstVideoTestSrc;
@ -77,8 +77,8 @@ struct _GstVideoTestSrcClass {
GstPushSrcClass parent_class;
};
GType gst_videotestsrc_get_type (void);
GType gst_video_test_src_get_type (void);
G_END_DECLS
#endif /* __GST_VIDEOTESTSRC_H__ */
#endif /* __GST_VIDEO_TEST_SRC_H__ */

View file

@ -495,7 +495,7 @@ paint_get_structure (struct fourcc_list_struct * format)
/* returns the size in bytes for one video frame of the given dimensions
* given the fourcc in GstVideoTestSrc */
int
gst_videotestsrc_get_size (GstVideoTestSrc * v, int w, int h)
gst_video_test_src_get_size (GstVideoTestSrc * v, int w, int h)
{
paintinfo pi = { 0 };
paintinfo *p = &pi;
@ -513,7 +513,8 @@ gst_videotestsrc_get_size (GstVideoTestSrc * v, int w, int h)
}
void
gst_videotestsrc_smpte (GstVideoTestSrc * v, unsigned char *dest, int w, int h)
gst_video_test_src_smpte (GstVideoTestSrc * v, unsigned char *dest, int w,
int h)
{
int i;
int y1, y2;
@ -622,7 +623,7 @@ gst_videotestsrc_smpte (GstVideoTestSrc * v, unsigned char *dest, int w, int h)
}
void
gst_videotestsrc_snow (GstVideoTestSrc * v, unsigned char *dest, int w, int h)
gst_video_test_src_snow (GstVideoTestSrc * v, unsigned char *dest, int w, int h)
{
int i;
int j;
@ -656,7 +657,8 @@ gst_videotestsrc_snow (GstVideoTestSrc * v, unsigned char *dest, int w, int h)
}
void
gst_videotestsrc_black (GstVideoTestSrc * v, unsigned char *dest, int w, int h)
gst_video_test_src_black (GstVideoTestSrc * v, unsigned char *dest, int w,
int h)
{
int i;
paintinfo pi;

View file

@ -17,8 +17,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __VIDEOTESTSRC_H__
#define __VIDEOTESTSRC_H__
#ifndef __VIDEO_TEST_SRC_H__
#define __VIDEO_TEST_SRC_H__
#include "_stdint.h"
@ -66,12 +66,12 @@ struct fourcc_list_struct *
paintinfo_find_by_structure (const GstStructure *structure);
GstStructure *
paint_get_structure (struct fourcc_list_struct *format);
int gst_videotestsrc_get_size (GstVideoTestSrc * v, int w, int h);
void gst_videotestsrc_smpte (GstVideoTestSrc * v,
int gst_video_test_src_get_size (GstVideoTestSrc * v, int w, int h);
void gst_video_test_src_smpte (GstVideoTestSrc * v,
unsigned char *dest, int w, int h);
void gst_videotestsrc_snow (GstVideoTestSrc * v,
void gst_video_test_src_snow (GstVideoTestSrc * v,
unsigned char *dest, int w, int h);
void gst_videotestsrc_black (GstVideoTestSrc * v,
void gst_video_test_src_black (GstVideoTestSrc * v,
unsigned char *dest, int w, int h);
extern struct fourcc_list_struct fourcc_list[];