Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEL-5633 Implement new media bug recording flag 'RECORD_STEREO_NO_DOW… #338

Open
wants to merge 3 commits into
base: telnyx/telephony/development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/include/switch_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1975,7 +1975,8 @@ typedef enum {
SMBF_READ_VIDEO_PATCH = (1 << 24),
SMBF_READ_TEXT_STREAM = (1 << 25),
SMBF_FIRST = (1 << 26),
SMBF_PAUSE = (1 << 27)
SMBF_PAUSE = (1 << 27),
SMBF_STEREO_NO_DOWN_MIX = (1 << 28)
} switch_media_bug_flag_enum_t;
typedef uint32_t switch_media_bug_flag_t;

Expand Down
6 changes: 5 additions & 1 deletion src/switch_core_media_bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,13 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
wlen = datalen / 2;
blen = (uint32_t)(bytes / 2);

if (switch_test_flag(bug, SMBF_STEREO)) {
if (switch_test_flag(bug, SMBF_STEREO) || !switch_test_flag(bug, SMBF_STEREO_NO_DOWN_MIX)) {
damirn marked this conversation as resolved.
Show resolved Hide resolved
int16_t *left, *right;
size_t left_len, right_len;
if (!switch_test_flag(bug, SMBF_STEREO_NO_DOWN_MIX)) {
switch_mux_channels(dp, wlen, read_impl.number_of_channels, 1);
switch_mux_channels(fp, rlen, read_impl.number_of_channels, 1);
}
if (switch_test_flag(bug, SMBF_STEREO_SWAP)) {
left = dp; /* write stream */
left_len = wlen;
Expand Down
4 changes: 4 additions & 0 deletions src/switch_ivr_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session_event(switch_core_sess
flags |= SMBF_BRIDGE_REQ;
}

if (recording_var_true(channel, vars, "RECORD_STEREO_NO_DOWN_MIX")) {
flags |= SMBF_STEREO_NO_DOWN_MIX;
}

if (recording_var_true(channel, vars, "RECORD_APPEND")) {
file_flags |= SWITCH_FILE_WRITE_APPEND;
}
Expand Down