summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <arun@arunraghavan.net>2016-05-12 17:56:56 +0530
committerArun Raghavan <arun@arunraghavan.net>2019-11-08 17:39:03 +0530
commit02fa9d5fc6076d38d610c63d20122f816f32193a (patch)
treeb11299ea43834c1a22dc6621014d697a02e6aa68
parent7766f0e8d7fa97a78b0f0c3789eb89e82377ef9b (diff)
rtp: Drop support for non-L16 media
There doesn't seem much value in supporting streaming U8/mulaw/alaw on the network, and it's unlikely these get any testing. Makes more sense to drop these formats and just convert to L16 if we're dealing with source media in that format. Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
-rw-r--r--src/modules/rtp/rtp.c34
-rw-r--r--src/modules/rtp/sdp.c9
2 files changed, 1 insertions, 42 deletions
diff --git a/src/modules/rtp/rtp.c b/src/modules/rtp/rtp.c
index 365c7165..0c286296 100644
--- a/src/modules/rtp/rtp.c
+++ b/src/modules/rtp/rtp.c
@@ -338,10 +338,6 @@ fail:
uint8_t pa_rtp_payload_from_sample_spec(const pa_sample_spec *ss) {
pa_assert(ss);
- if (ss->format == PA_SAMPLE_ULAW && ss->rate == 8000 && ss->channels == 1)
- return 0;
- if (ss->format == PA_SAMPLE_ALAW && ss->rate == 8000 && ss->channels == 1)
- return 8;
if (ss->format == PA_SAMPLE_S16BE && ss->rate == 44100 && ss->channels == 2)
return 10;
if (ss->format == PA_SAMPLE_S16BE && ss->rate == 44100 && ss->channels == 1)
@@ -354,18 +350,6 @@ pa_sample_spec *pa_rtp_sample_spec_from_payload(uint8_t payload, pa_sample_spec
pa_assert(ss);
switch (payload) {
- case 0:
- ss->channels = 1;
- ss->format = PA_SAMPLE_ULAW;
- ss->rate = 8000;
- break;
-
- case 8:
- ss->channels = 1;
- ss->format = PA_SAMPLE_ALAW;
- ss->rate = 8000;
- break;
-
case 10:
ss->channels = 2;
ss->format = PA_SAMPLE_S16BE;
@@ -401,11 +385,7 @@ int pa_rtp_sample_spec_valid(const pa_sample_spec *ss) {
if (!pa_sample_spec_valid(ss))
return 0;
- return
- ss->format == PA_SAMPLE_U8 ||
- ss->format == PA_SAMPLE_ALAW ||
- ss->format == PA_SAMPLE_ULAW ||
- ss->format == PA_SAMPLE_S16BE;
+ return ss->format == PA_SAMPLE_S16BE;
}
void pa_rtp_context_destroy(pa_rtp_context *c) {
@@ -425,12 +405,6 @@ const char* pa_rtp_format_to_string(pa_sample_format_t f) {
switch (f) {
case PA_SAMPLE_S16BE:
return "L16";
- case PA_SAMPLE_U8:
- return "L8";
- case PA_SAMPLE_ALAW:
- return "PCMA";
- case PA_SAMPLE_ULAW:
- return "PCMU";
default:
return NULL;
}
@@ -441,12 +415,6 @@ pa_sample_format_t pa_rtp_string_to_format(const char *s) {
if (pa_streq(s, "L16"))
return PA_SAMPLE_S16BE;
- else if (pa_streq(s, "L8"))
- return PA_SAMPLE_U8;
- else if (pa_streq(s, "PCMA"))
- return PA_SAMPLE_ALAW;
- else if (pa_streq(s, "PCMU"))
- return PA_SAMPLE_ULAW;
else
return PA_SAMPLE_INVALID;
}
diff --git a/src/modules/rtp/sdp.c b/src/modules/rtp/sdp.c
index 14953cf7..6a2e0c96 100644
--- a/src/modules/rtp/sdp.c
+++ b/src/modules/rtp/sdp.c
@@ -89,15 +89,6 @@ static pa_sample_spec *parse_sdp_sample_spec(pa_sample_spec *ss, char *c) {
if (pa_startswith(c, "L16/")) {
ss->format = PA_SAMPLE_S16BE;
c += 4;
- } else if (pa_startswith(c, "L8/")) {
- ss->format = PA_SAMPLE_U8;
- c += 3;
- } else if (pa_startswith(c, "PCMA/")) {
- ss->format = PA_SAMPLE_ALAW;
- c += 5;
- } else if (pa_startswith(c, "PCMU/")) {
- ss->format = PA_SAMPLE_ULAW;
- c += 5;
} else
return NULL;