Commit 26a69ef7 authored by Wim Taymans's avatar Wim Taymans

Code Cleanups

Original commit message from CVS:
Code Cleanups
Added use cases for the source elements.
parent a075cbda
There are a number of different ways of coding a GstSrc. I'll try to
outline them and how the function here:
1a) Simple push-function based with single output
This is the style that all the existing sources use. There is a single
output pad, and a _push function that's global to the whole element. The
_push function simple constructs buffer and pushes them out the pad.
Chained:
Typically this will be the/an entry into the Bin. The Bin's iterate
function simply calls the Src's _push function. When the _push function
pushes a buffer out it's pad, the chain function of the peer pad is
called, presumably causing a push out the other side of that element, and
eventually data gets to the other end. The stack unrolls, and the
iteration ends for that Src.
Cothreaded:
Again, the source would generally be an entry into the Bin. A loopfunc
will be constructed around it, which will simply loop calling the Src's
_push function as in the non-cothreaded case. When the _push function
pushes a buffer, it finds a pushfunc attached to the pad, drops the buffer
in the pen, and calls the pushfunc provided by the Bin. This causes a
switch to the next element, then the next, to the end, at which point a
buffer pull will travel back down the chain. The _push function gets
context and finishes, at which point the loopfunc wrapper simply calls it
again in the next iteration.
1b) Simple push-function based with multiple output
Chained:
Similar to the single output variant, except several chains are spawned
off, one per push, hanging off whichever pad the buffer is pushed off of.
The stack will grow and unwind as many times as buffers are pushed out.
Cothreaded:
Also similar to the single output variant. When the pull winds its way
back from the first push, execution returns to the Src's _push function,
which simply goes off and pushes out another buffer, causing another
series of context switches. Eventually the loopfunc wrapper starts over,
round and round we go.
2) Pull-function based with single output
Similar to a regular filter with a chain function associated with each
pad, this kind of source doesn't provide a src-wide push function, but
does provide pullfuncs for its pad. A pullfunc puts a buffer in the pen
and exits.
Chained:
As usual, is likely to be an entry into a Bin. The Bin iterate code must
explicitely pull a buffer and pass it on to the peer.
Cothreaded:
---- ok, I'll finish this tomorrow when my brain's working again.... ----
......@@ -33,7 +33,6 @@ extern "C" {
GstElementDetails gst_asyncdisksrc_details;
#define GST_TYPE_ASYNCDISKSRC \
(gst_asyncdisksrc_get_type())
#define GST_ASYNCDISKSRC(obj) \
......
......@@ -40,15 +40,17 @@ GstElementDetails gst_audiosink_details = {
"(C) 1999",
};
static void gst_audiosink_class_init (GstAudioSinkClass *klass);
static void gst_audiosink_init (GstAudioSink *audiosink);
static gboolean gst_audiosink_open_audio(GstAudioSink *sink);
static void gst_audiosink_close_audio(GstAudioSink *sink);
static GstElementStateReturn gst_audiosink_change_state(GstElement *element);
static gboolean gst_audiosink_open_audio (GstAudioSink *sink);
static void gst_audiosink_close_audio (GstAudioSink *sink);
static GstElementStateReturn gst_audiosink_change_state (GstElement *element);
static void gst_audiosink_set_arg(GtkObject *object,GtkArg *arg,guint id);
static void gst_audiosink_get_arg(GtkObject *object,GtkArg *arg,guint id);
static void gst_audiosink_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_audiosink_get_arg (GtkObject *object, GtkArg *arg, guint id);
void gst_audiosink_chain(GstPad *pad,GstBuffer *buf);
static void gst_audiosink_chain (GstPad *pad,GstBuffer *buf);
/* AudioSink signals and args */
enum {
......@@ -67,7 +69,7 @@ enum {
#define GST_TYPE_AUDIOSINK_FORMATS (gst_audiosink_formats_get_type())
GtkType
static GtkType
gst_audiosink_formats_get_type(void) {
static GtkType audiosink_formats_type = 0;
static GtkEnumValue audiosink_formats[] = {
......@@ -83,7 +85,7 @@ gst_audiosink_formats_get_type(void) {
#define GST_TYPE_AUDIOSINK_CHANNELS (gst_audiosink_channels_get_type())
GtkType
static GtkType
gst_audiosink_channels_get_type(void) {
static GtkType audiosink_channels_type = 0;
static GtkEnumValue audiosink_channels[] = {
......@@ -97,9 +99,6 @@ gst_audiosink_channels_get_type(void) {
return audiosink_channels_type;
}
static void gst_audiosink_class_init(GstAudioSinkClass *klass);
static void gst_audiosink_init(GstAudioSink *audiosink);
static GstSinkClass *parent_class = NULL;
static guint gst_audiosink_signals[LAST_SIGNAL] = { 0 };
......@@ -107,7 +106,8 @@ static guint gst_audiosink_signals[LAST_SIGNAL] = { 0 };
static guint16 gst_audiosink_type_audio = 0;
GtkType
gst_audiosink_get_type(void) {
gst_audiosink_get_type (void)
{
static GtkType audiosink_type = 0;
if (!audiosink_type) {
......@@ -121,17 +121,18 @@ gst_audiosink_get_type(void) {
(GtkArgGetFunc)NULL,
(GtkClassInitFunc)NULL,
};
audiosink_type = gtk_type_unique(GST_TYPE_SINK,&audiosink_info);
audiosink_type = gtk_type_unique (GST_TYPE_SINK, &audiosink_info);
}
if (!gst_audiosink_type_audio)
gst_audiosink_type_audio = gst_type_find_by_mime("audio/raw");
gst_audiosink_type_audio = gst_type_find_by_mime ("audio/raw");
return audiosink_type;
}
static void
gst_audiosink_class_init(GstAudioSinkClass *klass) {
gst_audiosink_class_init (GstAudioSinkClass *klass)
{
GtkObjectClass *gtkobject_class;
GstElementClass *gstelement_class;
......@@ -140,13 +141,13 @@ gst_audiosink_class_init(GstAudioSinkClass *klass) {
parent_class = gtk_type_class(GST_TYPE_FILTER);
gtk_object_add_arg_type("GstAudioSink::mute", GTK_TYPE_BOOL,
gtk_object_add_arg_type ("GstAudioSink::mute", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_MUTE);
gtk_object_add_arg_type("GstAudioSink::format", GST_TYPE_AUDIOSINK_FORMATS,
gtk_object_add_arg_type ("GstAudioSink::format", GST_TYPE_AUDIOSINK_FORMATS,
GTK_ARG_READWRITE, ARG_FORMAT);
gtk_object_add_arg_type("GstAudioSink::channels", GST_TYPE_AUDIOSINK_CHANNELS,
gtk_object_add_arg_type ("GstAudioSink::channels", GST_TYPE_AUDIOSINK_CHANNELS,
GTK_ARG_READWRITE, ARG_CHANNELS);
gtk_object_add_arg_type("GstAudioSink::frequency", GTK_TYPE_INT,
gtk_object_add_arg_type ("GstAudioSink::frequency", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FREQUENCY);
gtkobject_class->set_arg = gst_audiosink_set_arg;
......@@ -156,174 +157,184 @@ gst_audiosink_class_init(GstAudioSinkClass *klass) {
gtk_signal_new("handoff",GTK_RUN_LAST,gtkobject_class->type,
GTK_SIGNAL_OFFSET(GstAudioSinkClass,handoff),
gtk_marshal_NONE__NONE,GTK_TYPE_NONE,0);
gtk_object_class_add_signals(gtkobject_class,gst_audiosink_signals,
LAST_SIGNAL);
gstelement_class->change_state = gst_audiosink_change_state;
}
static void gst_audiosink_init(GstAudioSink *audiosink) {
audiosink->sinkpad = gst_pad_new("sink",GST_PAD_SINK);
gst_element_add_pad(GST_ELEMENT(audiosink),audiosink->sinkpad);
gst_pad_set_type_id(audiosink->sinkpad,gst_audiosink_type_audio);
static void
gst_audiosink_init (GstAudioSink *audiosink)
{
audiosink->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
gst_element_add_pad (GST_ELEMENT (audiosink), audiosink->sinkpad);
gst_pad_set_type_id (audiosink->sinkpad, gst_audiosink_type_audio);
gst_pad_set_chain_function(audiosink->sinkpad,gst_audiosink_chain);
gst_pad_set_chain_function (audiosink->sinkpad, gst_audiosink_chain);
audiosink->fd = -1;
audiosink->clock = gst_clock_get_system();
gst_clock_register(audiosink->clock, GST_OBJECT(audiosink));
//audiosink->clocktime = 0LL;
gst_clock_register (audiosink->clock, GST_OBJECT (audiosink));
GST_FLAG_SET(audiosink, GST_ELEMENT_THREAD_SUGGESTED);
GST_FLAG_SET (audiosink, GST_ELEMENT_THREAD_SUGGESTED);
}
void gst_audiosink_sync_parms(GstAudioSink *audiosink) {
static void
gst_audiosink_sync_parms (GstAudioSink *audiosink)
{
audio_buf_info ospace;
int frag;
g_return_if_fail(audiosink != NULL);
g_return_if_fail(GST_IS_AUDIOSINK(audiosink));
g_return_if_fail (audiosink != NULL);
g_return_if_fail (GST_IS_AUDIOSINK (audiosink));
if (audiosink->fd == -1) return;
ioctl(audiosink->fd,SNDCTL_DSP_RESET,0);
ioctl (audiosink->fd,SNDCTL_DSP_RESET, 0);
ioctl(audiosink->fd,SNDCTL_DSP_SETFMT,&audiosink->format);
ioctl(audiosink->fd,SNDCTL_DSP_CHANNELS,&audiosink->channels);
ioctl(audiosink->fd,SNDCTL_DSP_SPEED,&audiosink->frequency);
ioctl(audiosink->fd,SNDCTL_DSP_GETBLKSIZE, &frag);
ioctl (audiosink->fd, SNDCTL_DSP_SETFMT, &audiosink->format);
ioctl (audiosink->fd, SNDCTL_DSP_CHANNELS, &audiosink->channels);
ioctl (audiosink->fd, SNDCTL_DSP_SPEED, &audiosink->frequency);
ioctl (audiosink->fd, SNDCTL_DSP_GETBLKSIZE, &frag);
ioctl(audiosink->fd,SNDCTL_DSP_GETOSPACE,&ospace);
ioctl (audiosink->fd, SNDCTL_DSP_GETOSPACE, &ospace);
g_print("audiosink: setting sound card to %dKHz %d bit %s (%d bytes buffer, %d fragment)\n",
audiosink->frequency,audiosink->format,
(audiosink->channels == 2) ? "stereo" : "mono",ospace.bytes, frag);
}
audiosink->frequency, audiosink->format,
(audiosink->channels == 2) ? "stereo" : "mono", ospace.bytes, frag);
GstElement *gst_audiosink_new(gchar *name) {
GstElement *audiosink = GST_ELEMENT(gtk_type_new(GST_TYPE_AUDIOSINK));
gst_element_set_name(GST_ELEMENT(audiosink),name);
return audiosink;
}
void gst_audiosink_chain(GstPad *pad,GstBuffer *buf) {
static void
gst_audiosink_chain (GstPad *pad, GstBuffer *buf)
{
GstAudioSink *audiosink;
MetaAudioRaw *meta;
gboolean in_flush;
audio_buf_info ospace;
g_return_if_fail(pad != NULL);
g_return_if_fail(GST_IS_PAD(pad));
g_return_if_fail(buf != NULL);
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (buf != NULL);
/* this has to be an audio buffer */
// g_return_if_fail(((GstMeta *)buf->meta)->type !=
//gst_audiosink_type_audio);
audiosink = GST_AUDIOSINK(pad->parent);
audiosink = GST_AUDIOSINK (pad->parent);
// g_return_if_fail(GST_FLAG_IS_SET(audiosink,GST_STATE_RUNNING));
if ((in_flush = GST_BUFFER_FLAG_IS_SET(buf, GST_BUFFER_FLUSH))) {
DEBUG("audiosink: flush\n");
ioctl(audiosink->fd,SNDCTL_DSP_RESET,0);
if ((in_flush = GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLUSH))) {
DEBUG ("audiosink: flush\n");
ioctl (audiosink->fd, SNDCTL_DSP_RESET, 0);
}
meta = (MetaAudioRaw *)gst_buffer_get_first_meta(buf);
meta = (MetaAudioRaw *)gst_buffer_get_first_meta (buf);
if (meta != NULL) {
if ((meta->format != audiosink->format) ||
(meta->channels != audiosink->channels) ||
(meta->frequency != audiosink->frequency)) {
audiosink->format = meta->format;
audiosink->channels = meta->channels;
(meta->frequency != audiosink->frequency))
{
audiosink->format = meta->format;
audiosink->channels = meta->channels;
audiosink->frequency = meta->frequency;
gst_audiosink_sync_parms(audiosink);
gst_audiosink_sync_parms (audiosink);
g_print("audiosink: sound device set to format %d, %d channels, %dHz\n",
audiosink->format,audiosink->channels,audiosink->frequency);
audiosink->format, audiosink->channels, audiosink->frequency);
}
}
gtk_signal_emit(GTK_OBJECT(audiosink),gst_audiosink_signals[SIGNAL_HANDOFF],
gtk_signal_emit (GTK_OBJECT (audiosink), gst_audiosink_signals[SIGNAL_HANDOFF],
audiosink);
if (GST_BUFFER_DATA(buf) != NULL) {
gst_trace_add_entry(NULL,0,buf,"audiosink: writing to soundcard");
if (GST_BUFFER_DATA (buf) != NULL) {
gst_trace_add_entry(NULL, 0, buf, "audiosink: writing to soundcard");
//g_print("audiosink: writing to soundcard\n");
if (audiosink->fd > 2) {
if (!audiosink->mute) {
gst_clock_wait(audiosink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(audiosink));
ioctl(audiosink->fd,SNDCTL_DSP_GETOSPACE,&ospace);
DEBUG("audiosink: (%d bytes buffer) %d %p %d\n", ospace.bytes, audiosink->fd, GST_BUFFER_DATA(buf), GST_BUFFER_SIZE(buf));
write(audiosink->fd,GST_BUFFER_DATA(buf),GST_BUFFER_SIZE(buf));
gst_clock_wait (audiosink->clock, GST_BUFFER_TIMESTAMP (buf), GST_OBJECT (audiosink));
ioctl (audiosink->fd, SNDCTL_DSP_GETOSPACE, &ospace);
DEBUG ("audiosink: (%d bytes buffer) %d %p %d\n", ospace.bytes,
audiosink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
write (audiosink->fd, GST_BUFFER_DATA (buf), GST_BUFFER_SIZE (buf));
//write(STDOUT_FILENO,GST_BUFFER_DATA(buf),GST_BUFFER_SIZE(buf));
}
}
}
gst_buffer_unref(buf);
gst_buffer_unref (buf);
}
static void gst_audiosink_set_arg(GtkObject *object,GtkArg *arg,guint id) {
static void
gst_audiosink_set_arg (GtkObject *object, GtkArg *arg, guint id)
{
GstAudioSink *audiosink;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail(GST_IS_AUDIOSINK(object));
audiosink = GST_AUDIOSINK(object);
g_return_if_fail (GST_IS_AUDIOSINK (object));
audiosink = GST_AUDIOSINK (object);
switch(id) {
case ARG_MUTE:
audiosink->mute = GTK_VALUE_BOOL(*arg);
audiosink->mute = GTK_VALUE_BOOL (*arg);
break;
case ARG_FORMAT:
audiosink->format = GTK_VALUE_ENUM(*arg);
gst_audiosink_sync_parms(audiosink);
audiosink->format = GTK_VALUE_ENUM (*arg);
gst_audiosink_sync_parms (audiosink);
break;
case ARG_CHANNELS:
audiosink->channels = GTK_VALUE_ENUM(*arg);
gst_audiosink_sync_parms(audiosink);
audiosink->channels = GTK_VALUE_ENUM (*arg);
gst_audiosink_sync_parms (audiosink);
break;
case ARG_FREQUENCY:
audiosink->frequency = GTK_VALUE_INT(*arg);
gst_audiosink_sync_parms(audiosink);
audiosink->frequency = GTK_VALUE_INT (*arg);
gst_audiosink_sync_parms (audiosink);
break;
default:
break;
}
}
static void gst_audiosink_get_arg(GtkObject *object,GtkArg *arg,guint id) {
static void
gst_audiosink_get_arg (GtkObject *object, GtkArg *arg, guint id)
{
GstAudioSink *audiosink;
/* it's not null if we got it, but it might not be ours */
g_return_if_fail(GST_IS_AUDIOSINK(object));
audiosink = GST_AUDIOSINK(object);
g_return_if_fail (GST_IS_AUDIOSINK (object));
audiosink = GST_AUDIOSINK (object);
switch(id) {
case ARG_MUTE:
GTK_VALUE_BOOL(*arg) = audiosink->mute;
GTK_VALUE_BOOL (*arg) = audiosink->mute;
break;
case ARG_FORMAT:
GTK_VALUE_ENUM(*arg) = audiosink->format;
GTK_VALUE_ENUM (*arg) = audiosink->format;
break;
case ARG_CHANNELS:
GTK_VALUE_ENUM(*arg) = audiosink->channels;
GTK_VALUE_ENUM (*arg) = audiosink->channels;
break;
case ARG_FREQUENCY:
GTK_VALUE_INT(*arg) = audiosink->frequency;
GTK_VALUE_INT (*arg) = audiosink->frequency;
break;
default:
break;
}
}
static gboolean gst_audiosink_open_audio(GstAudioSink *sink) {
g_return_val_if_fail(sink->fd == -1, FALSE);
static gboolean
gst_audiosink_open_audio (GstAudioSink *sink)
{
g_return_val_if_fail (sink->fd == -1, FALSE);
g_print("audiosink: attempting to open sound device\n");
g_print ("audiosink: attempting to open sound device\n");
/* first try to open the sound card */
sink->fd = open("/dev/dsp",O_WRONLY);
sink->fd = open("/dev/dsp", O_WRONLY);
/* if we have it, set the default parameters and go have fun */
if (sink->fd > 0) {
......@@ -331,59 +342,69 @@ static gboolean gst_audiosink_open_audio(GstAudioSink *sink) {
sink->format = AFMT_S16_LE;
sink->channels = 2; /* stereo */
sink->frequency = 44100;
gst_audiosink_sync_parms(sink);
ioctl(sink->fd,SNDCTL_DSP_GETCAPS,&sink->caps);
gst_audiosink_sync_parms (sink);
ioctl(sink->fd, SNDCTL_DSP_GETCAPS, &sink->caps);
g_print("audiosink: Capabilities\n");
if (sink->caps & DSP_CAP_DUPLEX) g_print("audiosink: Full duplex\n");
if (sink->caps & DSP_CAP_REALTIME) g_print("audiosink: Realtime\n");
if (sink->caps & DSP_CAP_BATCH) g_print("audiosink: Batch\n");
if (sink->caps & DSP_CAP_COPROC) g_print("audiosink: Has coprocessor\n");
if (sink->caps & DSP_CAP_TRIGGER) g_print("audiosink: Trigger\n");
if (sink->caps & DSP_CAP_MMAP) g_print("audiosink: Direct access\n");
g_print("audiosink: opened audio with fd=%d\n", sink->fd);
GST_FLAG_SET(sink,GST_AUDIOSINK_OPEN);
GST_FLAG_SET (sink, GST_AUDIOSINK_OPEN);
return TRUE;
}
return FALSE;
}
static void gst_audiosink_close_audio(GstAudioSink *sink) {
static void
gst_audiosink_close_audio (GstAudioSink *sink)
{
if (sink->fd < 0) return;
close(sink->fd);
sink->fd = -1;
GST_FLAG_UNSET(sink,GST_AUDIOSINK_OPEN);
GST_FLAG_UNSET (sink, GST_AUDIOSINK_OPEN);
g_print("audiosink: closed sound device\n");
}
static GstElementStateReturn gst_audiosink_change_state(GstElement *element) {
g_return_val_if_fail(GST_IS_AUDIOSINK(element), FALSE);
static GstElementStateReturn
gst_audiosink_change_state (GstElement *element)
{
g_return_val_if_fail (GST_IS_AUDIOSINK (element), FALSE);
/* if going down into NULL state, close the file if it's open */
if (GST_STATE_PENDING(element) == GST_STATE_NULL) {
if (GST_FLAG_IS_SET(element,GST_AUDIOSINK_OPEN))
gst_audiosink_close_audio(GST_AUDIOSINK(element));
if (GST_STATE_PENDING (element) == GST_STATE_NULL) {
if (GST_FLAG_IS_SET (element, GST_AUDIOSINK_OPEN))
gst_audiosink_close_audio (GST_AUDIOSINK (element));
/* otherwise (READY or higher) we need to open the sound card */
} else {
if (!GST_FLAG_IS_SET(element,GST_AUDIOSINK_OPEN)) {
if (!gst_audiosink_open_audio(GST_AUDIOSINK(element)))
if (!GST_FLAG_IS_SET (element, GST_AUDIOSINK_OPEN)) {
if (!gst_audiosink_open_audio (GST_AUDIOSINK (element)))
return GST_STATE_FAILURE;
}
}
if (GST_ELEMENT_CLASS(parent_class)->change_state)
return GST_ELEMENT_CLASS(parent_class)->change_state(element);
if (GST_ELEMENT_CLASS (parent_class)->change_state)
return GST_ELEMENT_CLASS (parent_class)->change_state (element);
return GST_STATE_SUCCESS;
}
gboolean gst_audiosink_factory_init(GstElementFactory *factory) {
gboolean
gst_audiosink_factory_init (GstElementFactory *factory)
{
if (!gst_audiosink_type_audio)
gst_audiosink_type_audio = gst_type_find_by_mime("audio/raw");
gst_audiosink_type_audio = gst_type_find_by_mime ("audio/raw");
gst_type_add_sink(gst_audiosink_type_audio, factory);
gst_type_add_sink (gst_audiosink_type_audio, factory);
return TRUE;
}
......
......@@ -53,23 +53,25 @@ enum {
};
static void gst_audiosrc_class_init(GstAudioSrcClass *klass);
static void gst_audiosrc_init(GstAudioSrc *audiosrc);
static void gst_audiosrc_set_arg(GtkObject *object,GtkArg *arg,guint id);
static void gst_audiosrc_get_arg(GtkObject *object,GtkArg *arg,guint id);
static GstElementStateReturn gst_audiosrc_change_state(GstElement *element);
static void gst_audiosrc_class_init (GstAudioSrcClass *klass);
static void gst_audiosrc_init (GstAudioSrc *audiosrc);
static void gst_audiosrc_close_audio(GstAudioSrc *src);
static gboolean gst_audiosrc_open_audio(GstAudioSrc *src);
void gst_audiosrc_sync_parms(GstAudioSrc *audiosrc);
static void gst_audiosrc_set_arg (GtkObject *object, GtkArg *arg, guint id);
static void gst_audiosrc_get_arg (GtkObject *object, GtkArg *arg, guint id);
static GstElementStateReturn gst_audiosrc_change_state (GstElement *element);
void gst_audiosrc_push(GstSrc *src);
static void gst_audiosrc_close_audio (GstAudioSrc *src);
static gboolean gst_audiosrc_open_audio (GstAudioSrc *src);
static void gst_audiosrc_sync_parms (GstAudioSrc *audiosrc);
static void gst_audiosrc_push (GstSrc *src);
static GstSrcClass *parent_class = NULL;
//static guint gst_audiosrc_signals[LAST_SIGNAL] = { 0 };
GtkType
gst_audiosrc_get_type(void) {
gst_audiosrc_get_type (void)
{
static GtkType audiosrc_type = 0;
if (!audiosrc_type) {
......@@ -83,13 +85,14 @@ gst_audiosrc_get_type(void) {
(GtkArgGetFunc)gst_audiosrc_get_arg,
(GtkClassInitFunc)NULL,
};
audiosrc_type = gtk_type_unique(GST_TYPE_SRC,&audiosrc_info);
audiosrc_type = gtk_type_unique (GST_TYPE_SRC, &audiosrc_info);
}
return audiosrc_type;
}
static void
gst_audiosrc_class_init(GstAudioSrcClass *klass) {
gst_audiosrc_class_init (GstAudioSrcClass *klass)
{
GtkObjectClass *gtkobject_class;
GstElementClass *gstelement_class;
GstSrcClass *gstsrc_class;
......@@ -98,18 +101,18 @@ gst_audiosrc_class_init(GstAudioSrcClass *klass) {
gstelement_class = (GstElementClass*)klass;
gstsrc_class = (GstSrcClass*)klass;
parent_class = gtk_type_class(GST_TYPE_SRC);
parent_class = gtk_type_class (GST_TYPE_SRC);
gtk_object_add_arg_type("GstAudioSrc::bytes_per_read", GTK_TYPE_ULONG,
GTK_ARG_READWRITE, ARG_BYTESPERREAD);
gtk_object_add_arg_type("GstAudioSrc::curoffset", GTK_TYPE_ULONG,
GTK_ARG_READABLE, ARG_CUROFFSET);
gtk_object_add_arg_type("GstAudioSrc::format", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FORMAT);
gtk_object_add_arg_type("GstAudioSrc::channels", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_CHANNELS);
gtk_object_add_arg_type("GstAudioSrc::frequency", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FREQUENCY);
gtk_object_add_arg_type ("GstAudioSrc::bytes_per_read", GTK_TYPE_ULONG,
GTK_ARG_READWRITE, ARG_BYTESPERREAD);
gtk_object_add_arg_type ("GstAudioSrc::curoffset", GTK_TYPE_ULONG,
GTK_ARG_READABLE, ARG_CUROFFSET);
gtk_object_add_arg_type ("GstAudioSrc::format", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FORMAT);
gtk_object_add_arg_type ("GstAudioSrc::channels", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_CHANNELS);
gtk_object_add_arg_type ("GstAudioSrc::frequency", GTK_TYPE_INT,
GTK_ARG_READWRITE, ARG_FREQUENCY);
gtkobject_class->set_arg = gst_audiosrc_set_arg;