Commit 02a32faa authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

sys/oss/gstosssrc.*: Easy to implement a mixer, eh...

Original commit message from CVS:
2005-08-23  Andy Wingo  <wingo@pobox.com>

* sys/oss/gstosssrc.c:
* sys/oss/gstosssrc.h: Easy to implement a mixer, eh...
parent b976e88c
2005-08-23 Andy Wingo <wingo@pobox.com>
 
* sys/oss/gstosssrc.c:
* sys/oss/gstosssrc.h: Easy to implement a mixer, eh...
* sys/oss/gstossmixerelement.h:
* sys/oss/gstossmixerelement.c: Added mixer element like
alsamixer.
......
......@@ -47,13 +47,10 @@ enum
PROP_DEVICE_NAME,
};
GST_BOILERPLATE (GstOssSrc, gst_oss_src, GstAudioSrc, GST_TYPE_AUDIO_SRC);
GST_BOILERPLATE_WITH_INTERFACE (GstOssSrc, gst_oss_src, GstAudioSrc,
GST_TYPE_AUDIO_SRC, GstMixer, GST_TYPE_MIXER, gst_oss_src_mixer);
/*
GST_BOILERPLATE_WITH_INTERFACE (GstOssSrc, gst_oss_src, GstAudioSrc, GST_TYPE_AUDIO_SRC,
GstMixer, GST_TYPE_MIXER, gst_oss_src_mixer);
GST_IMPLEMENT_OSS_MIXER_METHODS (GstOssSrc, gst_oss_src_mixer);
*/
static void gst_oss_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
......@@ -309,13 +306,26 @@ gst_oss_src_open (GstAudioSrc * asrc)
return FALSE;
}
if (!oss->mixer)
oss->mixer = gst_ossmixer_new ("/dev/mixer", GST_OSS_MIXER_CAPTURE);
return TRUE;
}
static gboolean
gst_oss_src_close (GstAudioSrc * asrc)
{
close (GST_OSS_SRC (asrc)->fd);
GstOssSrc *oss;
oss = GST_OSS_SRC (asrc);
close (oss->fd);
if (oss->mixer) {
gst_ossmixer_free (oss->mixer);
oss->mixer = NULL;
}
return TRUE;
}
......
......@@ -29,6 +29,7 @@
#include <gst/audio/gstaudiosrc.h>
#include "gstosshelper.h"
#include "gstossmixer.h"
G_BEGIN_DECLS
......@@ -49,6 +50,8 @@ struct _GstOssSrc {
gchar *device;
gchar *device_name;
GstOssMixer *mixer;
};
struct _GstOssSrcClass {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment