OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 } | 403 } |
404 } | 404 } |
405 return false; | 405 return false; |
406 } | 406 } |
407 | 407 |
408 private: | 408 private: |
409 static const int kMaxNumPacketSize = 6; | 409 static const int kMaxNumPacketSize = 6; |
410 struct CodecPref { | 410 struct CodecPref { |
411 const char* name; | 411 const char* name; |
412 int clockrate; | 412 int clockrate; |
413 int channels; | 413 size_t channels; |
414 int payload_type; | 414 int payload_type; |
415 bool is_multi_rate; | 415 bool is_multi_rate; |
416 int packet_sizes_ms[kMaxNumPacketSize]; | 416 int packet_sizes_ms[kMaxNumPacketSize]; |
417 }; | 417 }; |
418 // Note: keep the supported packet sizes in ascending order. | 418 // Note: keep the supported packet sizes in ascending order. |
419 static const CodecPref kCodecPrefs[12]; | 419 static const CodecPref kCodecPrefs[12]; |
420 | 420 |
421 static int SelectPacketSize(const CodecPref& codec_pref, int ptime_ms) { | 421 static int SelectPacketSize(const CodecPref& codec_pref, int ptime_ms) { |
422 int selected_packet_size_ms = codec_pref.packet_sizes_ms[0]; | 422 int selected_packet_size_ms = codec_pref.packet_sizes_ms[0]; |
423 for (int packet_size_ms : codec_pref.packet_sizes_ms) { | 423 for (int packet_size_ms : codec_pref.packet_sizes_ms) { |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 renderer_->SetSink(nullptr); | 1148 renderer_->SetSink(nullptr); |
1149 renderer_ = nullptr; | 1149 renderer_ = nullptr; |
1150 } | 1150 } |
1151 } | 1151 } |
1152 | 1152 |
1153 // AudioRenderer::Sink implementation. | 1153 // AudioRenderer::Sink implementation. |
1154 // This method is called on the audio thread. | 1154 // This method is called on the audio thread. |
1155 void OnData(const void* audio_data, | 1155 void OnData(const void* audio_data, |
1156 int bits_per_sample, | 1156 int bits_per_sample, |
1157 int sample_rate, | 1157 int sample_rate, |
1158 int number_of_channels, | 1158 size_t number_of_channels, |
1159 size_t number_of_frames) override { | 1159 size_t number_of_frames) override { |
1160 RTC_DCHECK(!worker_thread_checker_.CalledOnValidThread()); | 1160 RTC_DCHECK(!worker_thread_checker_.CalledOnValidThread()); |
1161 RTC_DCHECK(audio_capture_thread_checker_.CalledOnValidThread()); | 1161 RTC_DCHECK(audio_capture_thread_checker_.CalledOnValidThread()); |
1162 RTC_DCHECK(voe_audio_transport_); | 1162 RTC_DCHECK(voe_audio_transport_); |
1163 voe_audio_transport_->OnData(config_.voe_channel_id, | 1163 voe_audio_transport_->OnData(config_.voe_channel_id, |
1164 audio_data, | 1164 audio_data, |
1165 bits_per_sample, | 1165 bits_per_sample, |
1166 sample_rate, | 1166 sample_rate, |
1167 number_of_channels, | 1167 number_of_channels, |
1168 number_of_frames); | 1168 number_of_frames); |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 } | 2500 } |
2501 } else { | 2501 } else { |
2502 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2502 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
2503 engine()->voe()->base()->StopPlayout(channel); | 2503 engine()->voe()->base()->StopPlayout(channel); |
2504 } | 2504 } |
2505 return true; | 2505 return true; |
2506 } | 2506 } |
2507 } // namespace cricket | 2507 } // namespace cricket |
2508 | 2508 |
2509 #endif // HAVE_WEBRTC_VOICE | 2509 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |