| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "talk/media/base/constants.h" | 43 #include "talk/media/base/constants.h" |
| 44 #include "talk/media/base/streamparams.h" | 44 #include "talk/media/base/streamparams.h" |
| 45 #include "talk/media/webrtc/webrtcvoe.h" | 45 #include "talk/media/webrtc/webrtcvoe.h" |
| 46 #include "webrtc/base/base64.h" | 46 #include "webrtc/base/base64.h" |
| 47 #include "webrtc/base/byteorder.h" | 47 #include "webrtc/base/byteorder.h" |
| 48 #include "webrtc/base/common.h" | 48 #include "webrtc/base/common.h" |
| 49 #include "webrtc/base/helpers.h" | 49 #include "webrtc/base/helpers.h" |
| 50 #include "webrtc/base/logging.h" | 50 #include "webrtc/base/logging.h" |
| 51 #include "webrtc/base/stringencode.h" | 51 #include "webrtc/base/stringencode.h" |
| 52 #include "webrtc/base/stringutils.h" | 52 #include "webrtc/base/stringutils.h" |
| 53 #include "webrtc/call/rtc_event_log.h" |
| 53 #include "webrtc/common.h" | 54 #include "webrtc/common.h" |
| 54 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 55 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
| 55 | 56 |
| 56 namespace cricket { | 57 namespace cricket { |
| 57 | 58 |
| 58 static const int kMaxNumPacketSize = 6; | 59 static const int kMaxNumPacketSize = 6; |
| 59 struct CodecPref { | 60 struct CodecPref { |
| 60 const char* name; | 61 const char* name; |
| 61 int clockrate; | 62 int clockrate; |
| 62 int channels; | 63 int channels; |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 if (is_dumping_aec_) { | 1330 if (is_dumping_aec_) { |
| 1330 // Stop dumping AEC when we are dumping. | 1331 // Stop dumping AEC when we are dumping. |
| 1331 if (voe_wrapper_->processing()->StopDebugRecording() != | 1332 if (voe_wrapper_->processing()->StopDebugRecording() != |
| 1332 webrtc::AudioProcessing::kNoError) { | 1333 webrtc::AudioProcessing::kNoError) { |
| 1333 LOG_RTCERR0(StopDebugRecording); | 1334 LOG_RTCERR0(StopDebugRecording); |
| 1334 } | 1335 } |
| 1335 is_dumping_aec_ = false; | 1336 is_dumping_aec_ = false; |
| 1336 } | 1337 } |
| 1337 } | 1338 } |
| 1338 | 1339 |
| 1340 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { |
| 1341 FILE* event_log_file = rtc::FdopenPlatformFileForWriting(file); |
| 1342 if (!event_log_file) { |
| 1343 LOG(LS_ERROR) << "Could not open AEC dump file stream."; |
| 1344 if (!rtc::ClosePlatformFile(file)) |
| 1345 LOG(LS_WARNING) << "Could not close file."; |
| 1346 return false; |
| 1347 } |
| 1348 if (voe_wrapper_->codec()->GetEventLog()->StartLogging(event_log_file) != 0) { |
| 1349 LOG_RTCERR0(StartLogging); |
| 1350 fclose(event_log_file); |
| 1351 return false; |
| 1352 } |
| 1353 is_dumping_aec_ = true; |
| 1354 return true; |
| 1355 } |
| 1356 |
| 1357 void WebRtcVoiceEngine::StopRtcEventLog() { |
| 1358 voe_wrapper_->codec()->GetEventLog()->StopLogging(); |
| 1359 } |
| 1360 |
| 1339 int WebRtcVoiceEngine::CreateVoiceChannel(VoEWrapper* voice_engine_wrapper) { | 1361 int WebRtcVoiceEngine::CreateVoiceChannel(VoEWrapper* voice_engine_wrapper) { |
| 1340 return voice_engine_wrapper->base()->CreateChannel(voe_config_); | 1362 return voice_engine_wrapper->base()->CreateChannel(voe_config_); |
| 1341 } | 1363 } |
| 1342 | 1364 |
| 1343 int WebRtcVoiceEngine::CreateMediaVoiceChannel() { | 1365 int WebRtcVoiceEngine::CreateMediaVoiceChannel() { |
| 1344 return CreateVoiceChannel(voe_wrapper_.get()); | 1366 return CreateVoiceChannel(voe_wrapper_.get()); |
| 1345 } | 1367 } |
| 1346 | 1368 |
| 1347 class WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer | 1369 class WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer |
| 1348 : public AudioRenderer::Sink { | 1370 : public AudioRenderer::Sink { |
| (...skipping 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3285 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); | 3307 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); |
| 3286 return false; | 3308 return false; |
| 3287 } | 3309 } |
| 3288 } | 3310 } |
| 3289 return true; | 3311 return true; |
| 3290 } | 3312 } |
| 3291 | 3313 |
| 3292 } // namespace cricket | 3314 } // namespace cricket |
| 3293 | 3315 |
| 3294 #endif // HAVE_WEBRTC_VOICE | 3316 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |