summaryrefslogtreecommitdiff
path: root/sys/oss
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2005-08-23 13:59:22 +0000
committerAndy Wingo <wingo@pobox.com>2005-08-23 13:59:22 +0000
commit02a32faa481dfc259dad9e40b75a88f1d917d224 (patch)
tree58803589a2f5b6b63face22a5f026f7970a97893 /sys/oss
parentb976e88c29914b3d35b3e02612b22741998934d8 (diff)
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...
Diffstat (limited to 'sys/oss')
-rw-r--r--sys/oss/gstosssrc.c22
-rw-r--r--sys/oss/gstosssrc.h3
2 files changed, 19 insertions, 6 deletions
diff --git a/sys/oss/gstosssrc.c b/sys/oss/gstosssrc.c
index 2c413657..c40df24a 100644
--- a/sys/oss/gstosssrc.c
+++ b/sys/oss/gstosssrc.c
@@ -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;
}
diff --git a/sys/oss/gstosssrc.h b/sys/oss/gstosssrc.h
index 23f7c389..a3b5ba6f 100644
--- a/sys/oss/gstosssrc.h
+++ b/sys/oss/gstosssrc.h
@@ -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 {