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

Side by Side Diff: talk/media/webrtc/webrtcvoiceengine.cc

Issue 1374253002: Added functions on libjingle API to start and stop the recording of an RtcEventLog. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase and added comment on PeerConnectionFactoryInterface Created 5 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 * 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
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 namespace { 58 namespace {
58 59
59 const int kMaxNumPacketSize = 6; 60 const int kMaxNumPacketSize = 6;
60 struct CodecPref { 61 struct CodecPref {
61 const char* name; 62 const char* name;
62 int clockrate; 63 int clockrate;
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 if (is_dumping_aec_) { 1270 if (is_dumping_aec_) {
1270 // Stop dumping AEC when we are dumping. 1271 // Stop dumping AEC when we are dumping.
1271 if (voe_wrapper_->processing()->StopDebugRecording() != 1272 if (voe_wrapper_->processing()->StopDebugRecording() !=
1272 webrtc::AudioProcessing::kNoError) { 1273 webrtc::AudioProcessing::kNoError) {
1273 LOG_RTCERR0(StopDebugRecording); 1274 LOG_RTCERR0(StopDebugRecording);
1274 } 1275 }
1275 is_dumping_aec_ = false; 1276 is_dumping_aec_ = false;
1276 } 1277 }
1277 } 1278 }
1278 1279
1280 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) {
1281 FILE* event_log_file = rtc::FdopenPlatformFileForWriting(file);
1282 if (!event_log_file) {
1283 LOG(LS_ERROR) << "Could not open RtcEventLog file stream.";
1284 if (!rtc::ClosePlatformFile(file)) {
the sun 2015/10/13 11:00:40 This isn't completely clear to me. I assume Close
ivoc 2015/10/13 13:50:50 Hmm, that is actually a really good point. The str
terelius 2015/10/13 14:29:52 Do we need any other way to pass the file, or can
the sun 2015/10/13 14:29:54 Yes, that seems like the best option. Make sure th
ivoc 2015/10/13 14:55:06 @terelius: Possibly, but I don't know if using a r
1285 LOG(LS_WARNING) << "Could not close file.";
1286 }
1287 return false;
1288 }
1289 if (voe_wrapper_->codec()->GetEventLog()->StartLogging(event_log_file) != 0) {
1290 LOG_RTCERR0(StartLogging);
1291 fclose(event_log_file);
1292 return false;
1293 }
1294 return true;
1295 }
1296
1297 void WebRtcVoiceEngine::StopRtcEventLog() {
1298 voe_wrapper_->codec()->GetEventLog()->StopLogging();
1299 }
1300
1279 int WebRtcVoiceEngine::CreateVoiceChannel(VoEWrapper* voice_engine_wrapper) { 1301 int WebRtcVoiceEngine::CreateVoiceChannel(VoEWrapper* voice_engine_wrapper) {
1280 return voice_engine_wrapper->base()->CreateChannel(voe_config_); 1302 return voice_engine_wrapper->base()->CreateChannel(voe_config_);
1281 } 1303 }
1282 1304
1283 int WebRtcVoiceEngine::CreateMediaVoiceChannel() { 1305 int WebRtcVoiceEngine::CreateMediaVoiceChannel() {
1284 return CreateVoiceChannel(voe_wrapper_.get()); 1306 return CreateVoiceChannel(voe_wrapper_.get());
1285 } 1307 }
1286 1308
1287 class WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer 1309 class WebRtcVoiceMediaChannel::WebRtcVoiceChannelRenderer
1288 : public AudioRenderer::Sink { 1310 : public AudioRenderer::Sink {
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); 3242 LOG(LS_WARNING) << "Unknown codec " << ToString(codec);
3221 return false; 3243 return false;
3222 } 3244 }
3223 } 3245 }
3224 return true; 3246 return true;
3225 } 3247 }
3226 3248
3227 } // namespace cricket 3249 } // namespace cricket
3228 3250
3229 #endif // HAVE_WEBRTC_VOICE 3251 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698