1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-25 09:34:11 +00:00

- Add 24 and 32 bit sample formats to the oss plugin

- Bump PORTREVISION

PR:		181655
Submitted by:	jbeich@vfemail.net
This commit is contained in:
Thomas Zander 2014-09-11 07:45:08 +00:00
parent 01019a64dc
commit 581492d2c7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=367908
4 changed files with 218 additions and 6 deletions

View File

@ -2,7 +2,7 @@
# $FreeBSD$
# $MCom: ports/multimedia/gstreamer1-plugins-good/Makefile,v 1.4 2013/01/15 21:43:45 kwm Exp $
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= multimedia
COMMENT= Good gstreamer-plugins

View File

@ -1,6 +1,72 @@
--- sys/oss/gstosshelper.c.orig Sun Apr 2 03:23:53 2006
+++ sys/oss/gstosshelper.c Sun Apr 2 03:25:44 2006
@@ -343,13 +344,17 @@ gst_oss_helper_rate_check_rate (GstOssPr
--- sys/oss/gstosshelper.c.orig 2014-01-14 13:03:14.000000000 +0100
+++ sys/oss/gstosshelper.c 2014-09-11 09:10:55.115013111 +0200
@@ -95,9 +95,13 @@
format_mask = AFMT_U8 | AFMT_S8;
if (G_BYTE_ORDER == G_LITTLE_ENDIAN)
- format_mask |= AFMT_S16_LE | AFMT_U16_LE;
+ format_mask |= AFMT_S16_LE | AFMT_U16_LE
+ | AFMT_S24_LE | AFMT_U24_LE
+ | AFMT_S32_LE | AFMT_U32_LE;
else
- format_mask |= AFMT_S16_BE | AFMT_U16_BE;
+ format_mask |= AFMT_S16_BE | AFMT_U16_BE
+ | AFMT_S24_BE | AFMT_U24_BE
+ | AFMT_S32_BE | AFMT_U32_BE;
caps = gst_caps_new_empty ();
@@ -169,6 +173,9 @@
const gchar *format;
switch (format_bit) {
+ case AFMT_S8:
+ format = "S8";
+ break;
case AFMT_U8:
format = "U8";
break;
@@ -178,15 +185,36 @@
case AFMT_S16_BE:
format = "S16BE";
break;
- case AFMT_S8:
- format = "S8";
- break;
case AFMT_U16_LE:
format = "U16LE";
break;
case AFMT_U16_BE:
format = "U16BE";
break;
+ case AFMT_S24_LE:
+ format = "S24LE";
+ break;
+ case AFMT_S24_BE:
+ format = "S24BE";
+ break;
+ case AFMT_U24_LE:
+ format = "U24LE";
+ break;
+ case AFMT_U24_BE:
+ format = "U24BE";
+ break;
+ case AFMT_S32_LE:
+ format = "S32LE";
+ break;
+ case AFMT_S32_BE:
+ format = "S32BE";
+ break;
+ case AFMT_U32_LE:
+ format = "U32LE";
+ break;
+ case AFMT_U32_BE:
+ format = "U32BE";
+ break;
default:
g_assert_not_reached ();
return NULL;
@@ -324,13 +352,17 @@
int format;
int n_channels;
int ret;
@ -16,5 +82,5 @@
+ /* Reset rate to lowest supported rate. */
+ ioctl (probe->fd, SNDCTL_DSP_SPEED, &rst);
ret = ioctl (probe->fd, SNDCTL_DSP_SETFMT, &format);
if (ret < 0)
return -1;
if (ret < 0 || format != probe->format) {
GST_DEBUG ("unsupported format: %d (%d)", probe->format, format);

View File

@ -0,0 +1,73 @@
--- sys/oss/gstosssink.c.orig 2013-09-24 15:05:22.000000000 +0200
+++ sys/oss/gstosssink.c 2014-09-11 09:10:55.116013220 +0200
@@ -106,7 +106,10 @@
PROP_DEVICE,
};
-#define FORMATS "{" GST_AUDIO_NE(S16)","GST_AUDIO_NE(U16)", S8, U8 }"
+#define FORMATS "{" GST_AUDIO_NE(S32)","GST_AUDIO_NE(U32)"," \
+ GST_AUDIO_NE(S24)","GST_AUDIO_NE(U24)"," \
+ GST_AUDIO_NE(S16)","GST_AUDIO_NE(U16)"," \
+ "S8, U8 }"
static GstStaticPadTemplate osssink_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink",
@@ -321,6 +324,9 @@
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW:
{
switch (rfmt) {
+ case GST_AUDIO_FORMAT_S8:
+ result = AFMT_S8;
+ break;
case GST_AUDIO_FORMAT_U8:
result = AFMT_U8;
break;
@@ -330,15 +336,36 @@
case GST_AUDIO_FORMAT_S16BE:
result = AFMT_S16_BE;
break;
- case GST_AUDIO_FORMAT_S8:
- result = AFMT_S8;
- break;
case GST_AUDIO_FORMAT_U16LE:
result = AFMT_U16_LE;
break;
case GST_AUDIO_FORMAT_U16BE:
result = AFMT_U16_BE;
break;
+ case GST_AUDIO_FORMAT_S24LE:
+ result = AFMT_S24_LE;
+ break;
+ case GST_AUDIO_FORMAT_S24BE:
+ result = AFMT_S24_BE;
+ break;
+ case GST_AUDIO_FORMAT_U24LE:
+ result = AFMT_U24_LE;
+ break;
+ case GST_AUDIO_FORMAT_U24BE:
+ result = AFMT_U24_BE;
+ break;
+ case GST_AUDIO_FORMAT_S32LE:
+ result = AFMT_S32_LE;
+ break;
+ case GST_AUDIO_FORMAT_S32BE:
+ result = AFMT_S32_BE;
+ break;
+ case GST_AUDIO_FORMAT_U32LE:
+ result = AFMT_U32_LE;
+ break;
+ case GST_AUDIO_FORMAT_U32BE:
+ result = AFMT_U32_BE;
+ break;
default:
result = 0;
break;
@@ -441,7 +468,7 @@
rate = GST_AUDIO_INFO_RATE (&spec->info);
channels = GST_AUDIO_INFO_CHANNELS (&spec->info);
- if (width != 16 && width != 8)
+ if (width != 32 && width != 24 && width != 16 && width != 8)
goto dodgy_width;
SET_PARAM (oss, SNDCTL_DSP_SETFMT, tmp, "SETFMT");

View File

@ -0,0 +1,73 @@
--- sys/oss/gstosssrc.c.orig 2013-09-24 15:05:22.000000000 +0200
+++ sys/oss/gstosssrc.c 2014-09-11 09:10:55.116013220 +0200
@@ -100,7 +100,10 @@
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 }"
+#define FORMATS "{" GST_AUDIO_NE(S32)","GST_AUDIO_NE(U32)"," \
+ GST_AUDIO_NE(S24)","GST_AUDIO_NE(U24)"," \
+ GST_AUDIO_NE(S16)","GST_AUDIO_NE(U16)"," \
+ "S8, U8 }"
static GstStaticPadTemplate osssrc_src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
@@ -314,6 +317,9 @@
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW:
{
switch (rfmt) {
+ case GST_AUDIO_FORMAT_S8:
+ result = AFMT_S8;
+ break;
case GST_AUDIO_FORMAT_U8:
result = AFMT_U8;
break;
@@ -323,15 +329,36 @@
case GST_AUDIO_FORMAT_S16BE:
result = AFMT_S16_BE;
break;
- case GST_AUDIO_FORMAT_S8:
- result = AFMT_S8;
- break;
case GST_AUDIO_FORMAT_U16LE:
result = AFMT_U16_LE;
break;
case GST_AUDIO_FORMAT_U16BE:
result = AFMT_U16_BE;
break;
+ case GST_AUDIO_FORMAT_S24LE:
+ result = AFMT_S24_LE;
+ break;
+ case GST_AUDIO_FORMAT_S24BE:
+ result = AFMT_S24_BE;
+ break;
+ case GST_AUDIO_FORMAT_U24LE:
+ result = AFMT_U24_LE;
+ break;
+ case GST_AUDIO_FORMAT_U24BE:
+ result = AFMT_U24_BE;
+ break;
+ case GST_AUDIO_FORMAT_S32LE:
+ result = AFMT_S32_LE;
+ break;
+ case GST_AUDIO_FORMAT_S32BE:
+ result = AFMT_S32_BE;
+ break;
+ case GST_AUDIO_FORMAT_U32LE:
+ result = AFMT_U32_LE;
+ break;
+ case GST_AUDIO_FORMAT_U32BE:
+ result = AFMT_U32_BE;
+ break;
default:
result = 0;
break;
@@ -428,7 +455,7 @@
rate = GST_AUDIO_INFO_RATE (&spec->info);
channels = GST_AUDIO_INFO_CHANNELS (&spec->info);
- if (width != 16 && width != 8)
+ if (width != 32 && width != 24 && width != 16 && width != 8)
goto dodgy_width;
tmp = ilog2 (spec->segsize);