Skip to content

Commit 51dbe89

Browse files
authored
Merge pull request signalwire#2157 from signalwire/revertopus
Revert "[core, mod_opus] more elastic jitterbuffer with Opus codec (signalwire#2069)
2 parents 224eb22 + 34f1d97 commit 51dbe89

10 files changed

+3
-760
lines changed

scripts/lua/hangup_jitterbuffer_metrics.lua

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/include/switch_jitterbuffer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ SWITCH_DECLARE(switch_status_t) switch_jb_get_packet(switch_jb_t *jb, switch_rtp
6161
SWITCH_DECLARE(uint32_t) switch_jb_pop_nack(switch_jb_t *jb);
6262
SWITCH_DECLARE(switch_status_t) switch_jb_get_packet_by_seq(switch_jb_t *jb, uint16_t seq, switch_rtp_packet_t *packet, switch_size_t *len);
6363
SWITCH_DECLARE(void) switch_jb_set_session(switch_jb_t *jb, switch_core_session_t *session);
64-
SWITCH_DECLARE(void) switch_jb_set_jitter_estimator(switch_jb_t *jb, double *jitter, uint32_t samples_per_frame, uint32_t samples_per_second);
6564
SWITCH_DECLARE(void) switch_jb_ts_mode(switch_jb_t *jb, uint32_t samples_per_frame, uint32_t samples_per_second);
6665
SWITCH_DECLARE(void) switch_jb_set_flag(switch_jb_t *jb, switch_jb_flag_t flag);
6766
SWITCH_DECLARE(void) switch_jb_clear_flag(switch_jb_t *jb, switch_jb_flag_t flag);

src/include/switch_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2425,7 +2425,6 @@ typedef enum {
24252425
SCC_VIDEO_RESET,
24262426
SCC_AUDIO_PACKET_LOSS,
24272427
SCC_AUDIO_ADJUST_BITRATE,
2428-
SCC_AUDIO_VAD,
24292428
SCC_DEBUG,
24302429
SCC_CODEC_SPECIFIC
24312430
} switch_codec_control_command_t;

src/mod/codecs/mod_opus/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MODNAME=mod_opus
44
if HAVE_OPUS
55

66
mod_LTLIBRARIES = mod_opus.la
7-
mod_opus_la_SOURCES = mod_opus.c opus_parse.c
7+
mod_opus_la_SOURCES = mod_opus.c
88
mod_opus_la_CFLAGS = $(AM_CFLAGS) $(OPUS_CFLAGS)
99
mod_opus_la_LIBADD = $(switch_builddir)/libfreeswitch.la $(OPUS_LIBS)
1010
mod_opus_la_LDFLAGS = -avoid-version -module -no-undefined -shared -lm -lz

src/mod/codecs/mod_opus/mod_opus.2017.vcxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@
130130
</ItemDefinitionGroup>
131131
<ItemGroup>
132132
<ClCompile Include="mod_opus.c" />
133-
<ClCompile Include="opus_parse.c" />
134-
</ItemGroup>
135-
<ItemGroup>
136-
<ClInclude Include="opus_parse.h" />
137133
</ItemGroup>
138134
<ItemGroup>
139135
<ProjectReference Include="..\..\..\..\libs\win32\opus\opus.2017.vcxproj">

src/mod/codecs/mod_opus/mod_opus.c

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333

3434
#include "switch.h"
3535
#include "opus.h"
36-
#include "opus_parse.h"
3736

3837
#define SWITCH_OPUS_MIN_BITRATE 6000
3938
#define SWITCH_OPUS_MAX_BITRATE 510000
@@ -1170,27 +1169,6 @@ static switch_status_t switch_opus_keep_fec_enabled(switch_codec_t *codec)
11701169
}
11711170
}
11721171

1173-
static switch_bool_t switch_opus_vad(struct opus_context *context, void *encoded_data, uint32_t encoded_data_len) {
1174-
const uint8_t *payload = (const uint8_t *) encoded_data;
1175-
opus_packet_info_t opus_packet_info;
1176-
switch_bool_t debug = (globals.debug || context->debug > 1);
1177-
if (!switch_opus_packet_parse(payload, encoded_data_len, &opus_packet_info, debug)) {
1178-
if (debug) {
1179-
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "OPUS PACKET PARSING ERROR len:%d bytes:%02x %02x\n",
1180-
(int)encoded_data_len, payload[0], payload[1]);
1181-
}
1182-
return SWITCH_TRUE;
1183-
}
1184-
if (debug) {
1185-
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "OPUS EXTRACT PAYLOAD VAD len:%d vad_ms:%d bytes:%02x %02x\n",
1186-
(int)encoded_data_len, opus_packet_info.vad_ms, payload[0], payload[1]);
1187-
}
1188-
if (opus_packet_info.vad_ms == 0) {
1189-
return SWITCH_FALSE;
1190-
}
1191-
return SWITCH_TRUE;
1192-
}
1193-
11941172
static switch_status_t switch_opus_control(switch_codec_t *codec,
11951173
switch_codec_control_command_t cmd,
11961174
switch_codec_control_type_t ctype,
@@ -1282,14 +1260,6 @@ static switch_status_t switch_opus_control(switch_codec_t *codec,
12821260
context->old_plpct = plpct;
12831261
}
12841262
break;
1285-
case SCC_AUDIO_VAD:
1286-
{
1287-
void* encoded_data = (void *)cmd_data;
1288-
uint16_t* encoded_data_len = (uint16_t *)cmd_arg;
1289-
switch_bool_t *ret = (switch_bool_t *) *ret_data;
1290-
*ret = switch_opus_vad(context, encoded_data, *encoded_data_len);
1291-
}
1292-
break;
12931263
case SCC_AUDIO_ADJUST_BITRATE:
12941264
{
12951265
const char *cmd = (const char *)cmd_data;

0 commit comments

Comments
 (0)