[gst-cvs] CVS: gstreamer/plugins/oss gstosssink.c,1.19,1.20

Joshua Pritikin jpritikin at users.sourceforge.net
Mon Sep 17 21:22:16 PDT 2001


Update of /cvsroot/gstreamer/gstreamer/plugins/oss
In directory usw-pr-cvs1:/tmp/cvs-serv25016

Modified Files:
	gstosssink.c 
Log Message:
make format & channels properties work


Index: gstosssink.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/oss/gstosssink.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- gstosssink.c	2001/08/27 07:22:10	1.19
+++ gstosssink.c	2001/09/18 04:21:50	1.20
@@ -81,7 +81,7 @@
   GST_CAPS_NEW (
     "osssink_sink",
     "audio/raw",
-      "format",     GST_PROPS_STRING ("int"),
+      "format",     GST_PROPS_STRING ("int"),   // hack
       "law",        GST_PROPS_INT (0),
       "endianness", GST_PROPS_INT (G_BYTE_ORDER),
       "signed",     GST_PROPS_LIST (
@@ -101,26 +101,12 @@
   )
 );
 
-#define GST_TYPE_OSSSINK_FORMATS (gst_osssink_formats_get_type())
-static GType 
-gst_osssink_formats_get_type(void) {
-  static GType osssink_formats_type = 0;
-  static GEnumValue osssink_formats[] = {
-    {8, "8", "8 Bits"},
-    {16, "16", "16 Bits"},
-    {0, NULL, NULL},
-  };
-  if (!osssink_formats_type) {
-    osssink_formats_type = g_enum_register_static("GstAudiosinkFormats", osssink_formats);
-  }
-  return osssink_formats_type;
-}
-
 #define GST_TYPE_OSSSINK_CHANNELS (gst_osssink_channels_get_type())
 static GType 
 gst_osssink_channels_get_type(void) {
   static GType osssink_channels_type = 0;
   static GEnumValue osssink_channels[] = {
+    {0, "0", "None"},
     {1, "1", "Mono"},
     {2, "2", "Stereo"},
     {0, NULL, NULL},
@@ -182,9 +168,12 @@
   g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_MUTE,
     g_param_spec_boolean("mute","mute","mute",
                          TRUE,G_PARAM_READWRITE)); 
+
+  // it would be nice to show format in symbolic form, oh well
   g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FORMAT,
-    g_param_spec_enum("format","format","format",
-                      GST_TYPE_OSSSINK_FORMATS,16,G_PARAM_READWRITE)); 
+    g_param_spec_int ("format","format","format",
+                      0, G_MAXINT, AFMT_S16_LE, G_PARAM_READWRITE)); 
+
   g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CHANNELS,
     g_param_spec_enum("channels","channels","channels",
                       GST_TYPE_OSSSINK_CHANNELS,2,G_PARAM_READWRITE)); 
@@ -421,7 +410,7 @@
       osssink->mute = g_value_get_boolean (value);
       break;
     case ARG_FORMAT:
-      osssink->format = g_value_get_enum (value);
+      osssink->format = g_value_get_int (value);
       gst_osssink_sync_parms (osssink);
       break;
     case ARG_CHANNELS:
@@ -460,7 +449,7 @@
       g_value_set_boolean (value, osssink->mute);
       break;
     case ARG_FORMAT:
-      g_value_set_enum (value, osssink->format);
+      g_value_set_int (value, osssink->format);
       break;
     case ARG_CHANNELS:
       g_value_set_enum (value, osssink->channels);





More information about the Gstreamer-commits mailing list