summaryrefslogtreecommitdiff
path: root/sys/oss
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2011-08-19 14:01:45 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2011-08-19 14:01:45 +0200
commit77ad0a13631d19d16fcf31b12529005a2a52f425 (patch)
treeff6120146398dd145931ea2bcb8fe80e34f11b8a /sys/oss
parent90f5b31b4b55865d79613f11f64987acacaece41 (diff)
downloadgstreamer-plugins-good-77ad0a13631d19d16fcf31b12529005a2a52f425.tar.gz
port more elements to new audio caps and API
Diffstat (limited to 'sys/oss')
-rw-r--r--sys/oss/gstosshelper.c37
-rw-r--r--sys/oss/gstosssink.c16
-rw-r--r--sys/oss/gstosssrc.c15
3 files changed, 17 insertions, 51 deletions
diff --git a/sys/oss/gstosshelper.c b/sys/oss/gstosshelper.c
index 6d7e6bd3e..639ee9d8f 100644
--- a/sys/oss/gstosshelper.c
+++ b/sys/oss/gstosshelper.c
@@ -169,53 +169,34 @@ static GstStructure *
gst_oss_helper_get_format_structure (unsigned int format_bit)
{
GstStructure *structure;
- int endianness;
- gboolean sign;
- int width;
+ const gchar *format;
switch (format_bit) {
case AFMT_U8:
- endianness = 0;
- sign = FALSE;
- width = 8;
+ format = "U8";
break;
case AFMT_S16_LE:
- endianness = G_LITTLE_ENDIAN;
- sign = TRUE;
- width = 16;
+ format = "S16_LE";
break;
case AFMT_S16_BE:
- endianness = G_BIG_ENDIAN;
- sign = TRUE;
- width = 16;
+ format = "S16_BE";
break;
case AFMT_S8:
- endianness = 0;
- sign = TRUE;
- width = 8;
+ format = "S8";
break;
case AFMT_U16_LE:
- endianness = G_LITTLE_ENDIAN;
- sign = FALSE;
- width = 16;
+ format = "U16_LE";
break;
case AFMT_U16_BE:
- endianness = G_BIG_ENDIAN;
- sign = FALSE;
- width = 16;
+ format = "U16_BE";
break;
default:
g_assert_not_reached ();
return NULL;
}
- structure = gst_structure_new ("audio/x-raw-int",
- "width", G_TYPE_INT, width,
- "depth", G_TYPE_INT, width, "signed", G_TYPE_BOOLEAN, sign, NULL);
-
- if (endianness) {
- gst_structure_set (structure, "endianness", G_TYPE_INT, endianness, NULL);
- }
+ structure = gst_structure_new ("audio/x-raw",
+ "format", G_TYPE_STRING, format, NULL);
return structure;
}
diff --git a/sys/oss/gstosssink.c b/sys/oss/gstosssink.c
index 9f9b13752..6a8046d07 100644
--- a/sys/oss/gstosssink.c
+++ b/sys/oss/gstosssink.c
@@ -110,20 +110,14 @@ enum
PROP_DEVICE,
};
+#define FORMATS "{" GST_AUDIO_NE(S16)","GST_AUDIO_NE(U16)", S8, U8 }"
+
static GstStaticPadTemplate osssink_sink_factory =
- GST_STATIC_PAD_TEMPLATE ("sink",
+GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) { " G_STRINGIFY (G_BYTE_ORDER) " }, "
- "signed = (boolean) { TRUE, FALSE }, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]; "
- "audio/x-raw-int, "
- "signed = (boolean) { TRUE, FALSE }, "
- "width = (int) 8, "
- "depth = (int) 8, "
+ GST_STATIC_CAPS ("audio/x-raw, "
+ "format = (string) " FORMATS ", "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]")
);
diff --git a/sys/oss/gstosssrc.c b/sys/oss/gstosssrc.c
index 33f585d2c..bdadbbc8d 100644
--- a/sys/oss/gstosssrc.c
+++ b/sys/oss/gstosssrc.c
@@ -101,25 +101,16 @@ static guint gst_oss_src_read (GstAudioSrc * asrc, gpointer data, guint length);
static guint gst_oss_src_delay (GstAudioSrc * asrc);
static void gst_oss_src_reset (GstAudioSrc * asrc);
-
+#define FORMATS "{" GST_AUDIO_NE(S16)","GST_AUDIO_NE(U16)", S8, U8 }"
static GstStaticPadTemplate osssrc_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) { " G_STRINGIFY (G_BYTE_ORDER) " }, "
- "signed = (boolean) { TRUE, FALSE }, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]; "
- "audio/x-raw-int, "
- "signed = (boolean) { TRUE, FALSE }, "
- "width = (int) 8, "
- "depth = (int) 8, "
+ GST_STATIC_CAPS ("audio/x-raw, "
+ "format = (string) " FORMATS ", "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]")
);
-
static void
gst_oss_src_dispose (GObject * object)
{