OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 for (const AudioCodec& codec : codecs) { | 388 for (const AudioCodec& codec : codecs) { |
389 if (IsCodec(codec, kDtmfCodecName) || IsCodec(codec, kCnCodecName)) { | 389 if (IsCodec(codec, kDtmfCodecName) || IsCodec(codec, kCnCodecName)) { |
390 // Skip telephone-event/CN codec, which will be handled later. | 390 // Skip telephone-event/CN codec, which will be handled later. |
391 continue; | 391 continue; |
392 } | 392 } |
393 | 393 |
394 // We'll use the first codec in the list to actually send audio data. | 394 // We'll use the first codec in the list to actually send audio data. |
395 // Be sure to use the payload type requested by the remote side. | 395 // Be sure to use the payload type requested by the remote side. |
396 // Ignore codecs we don't know about. The negotiation step should prevent | 396 // Ignore codecs we don't know about. The negotiation step should prevent |
397 // this, but double-check to be sure. | 397 // this, but double-check to be sure. |
398 webrtc::CodecInst voe_codec = {0}; | 398 if (!ToCodecInst(codec, out)) { |
399 if (!ToCodecInst(codec, &voe_codec)) { | |
400 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); | 399 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); |
401 continue; | 400 continue; |
402 } | 401 } |
403 *out = voe_codec; | |
404 return &codec; | 402 return &codec; |
405 } | 403 } |
406 return nullptr; | 404 return nullptr; |
407 } | 405 } |
408 | 406 |
409 private: | 407 private: |
410 static const int kMaxNumPacketSize = 6; | 408 static const int kMaxNumPacketSize = 6; |
411 struct CodecPref { | 409 struct CodecPref { |
412 const char* name; | 410 const char* name; |
413 int clockrate; | 411 int clockrate; |
(...skipping 2177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2591 } | 2589 } |
2592 } else { | 2590 } else { |
2593 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2591 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
2594 engine()->voe()->base()->StopPlayout(channel); | 2592 engine()->voe()->base()->StopPlayout(channel); |
2595 } | 2593 } |
2596 return true; | 2594 return true; |
2597 } | 2595 } |
2598 } // namespace cricket | 2596 } // namespace cricket |
2599 | 2597 |
2600 #endif // HAVE_WEBRTC_VOICE | 2598 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |