Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/opus_interface.c

Issue 2362703002: Adding audio network adaptor to AudioEncoderOpus. (Closed)
Patch Set: adding a missing deps Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 202
203 int16_t WebRtcOpus_SetComplexity(OpusEncInst* inst, int32_t complexity) { 203 int16_t WebRtcOpus_SetComplexity(OpusEncInst* inst, int32_t complexity) {
204 if (inst) { 204 if (inst) {
205 return opus_encoder_ctl(inst->encoder, OPUS_SET_COMPLEXITY(complexity)); 205 return opus_encoder_ctl(inst->encoder, OPUS_SET_COMPLEXITY(complexity));
206 } else { 206 } else {
207 return -1; 207 return -1;
208 } 208 }
209 } 209 }
210 210
211 int16_t WebRtcOpus_SetForceChannels(OpusEncInst* inst, int32_t num_channels) { 211 int16_t WebRtcOpus_SetForceChannels(OpusEncInst* inst, size_t num_channels) {
212 if (!inst) 212 if (!inst)
213 return -1; 213 return -1;
214 if (num_channels == 0) { 214 if (num_channels == 0) {
215 return opus_encoder_ctl(inst->encoder, 215 return opus_encoder_ctl(inst->encoder,
216 OPUS_SET_FORCE_CHANNELS(OPUS_AUTO)); 216 OPUS_SET_FORCE_CHANNELS(OPUS_AUTO));
217 } else if (num_channels == 1 || num_channels == 2) { 217 } else if (num_channels == 1 || num_channels == 2) {
218 return opus_encoder_ctl(inst->encoder, 218 return opus_encoder_ctl(inst->encoder,
219 OPUS_SET_FORCE_CHANNELS(num_channels)); 219 OPUS_SET_FORCE_CHANNELS(num_channels));
220 } else { 220 } else {
221 return -1; 221 return -1;
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return 0; 469 return 0;
470 } 470 }
471 471
472 for (n = 0; n < channels; n++) { 472 for (n = 0; n < channels; n++) {
473 if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1))) 473 if (frame_data[0][0] & (0x80 >> ((n + 1) * (frames + 1) - 1)))
474 return 1; 474 return 1;
475 } 475 }
476 476
477 return 0; 477 return 0;
478 } 478 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698