OLD | NEW |
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 |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <stdlib.h> | 12 #include <stdlib.h> |
13 #include <string.h> | 13 #include <string.h> |
14 #ifndef _WIN32 | 14 #ifndef _WIN32 |
15 #include <unistd.h> | 15 #include <unistd.h> |
16 #endif | 16 #endif |
17 | 17 |
18 #include <vector> | 18 #include <vector> |
19 | 19 |
20 #include "gflags/gflags.h" | 20 #include "gflags/gflags.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 #include "webrtc/base/scoped_ptr.h" | 22 #include "webrtc/base/scoped_ptr.h" |
23 #include "webrtc/engine_configurations.h" | 23 #include "webrtc/engine_configurations.h" |
24 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 24 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
25 #include "webrtc/test/channel_transport/include/channel_transport.h" | 25 #include "webrtc/test/channel_transport/include/channel_transport.h" |
26 #include "webrtc/test/testsupport/fileutils.h" | 26 #include "webrtc/test/testsupport/fileutils.h" |
27 #include "webrtc/test/testsupport/trace_to_stderr.h" | 27 #include "webrtc/test/testsupport/trace_to_stderr.h" |
| 28 #include "webrtc/video/rtc_event_log.h" |
28 #include "webrtc/voice_engine/include/voe_audio_processing.h" | 29 #include "webrtc/voice_engine/include/voe_audio_processing.h" |
29 #include "webrtc/voice_engine/include/voe_base.h" | 30 #include "webrtc/voice_engine/include/voe_base.h" |
30 #include "webrtc/voice_engine/include/voe_codec.h" | 31 #include "webrtc/voice_engine/include/voe_codec.h" |
31 #include "webrtc/voice_engine/include/voe_dtmf.h" | 32 #include "webrtc/voice_engine/include/voe_dtmf.h" |
32 #include "webrtc/voice_engine/include/voe_errors.h" | 33 #include "webrtc/voice_engine/include/voe_errors.h" |
33 #include "webrtc/voice_engine/include/voe_external_media.h" | 34 #include "webrtc/voice_engine/include/voe_external_media.h" |
34 #include "webrtc/voice_engine/include/voe_file.h" | 35 #include "webrtc/voice_engine/include/voe_file.h" |
35 #include "webrtc/voice_engine/include/voe_hardware.h" | 36 #include "webrtc/voice_engine/include/voe_hardware.h" |
36 #include "webrtc/voice_engine/include/voe_neteq_stats.h" | 37 #include "webrtc/voice_engine/include/voe_neteq_stats.h" |
37 #include "webrtc/voice_engine/include/voe_network.h" | 38 #include "webrtc/voice_engine/include/voe_network.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 printf("%i. Play a previously recorded PCM file as microphone \n", | 445 printf("%i. Play a previously recorded PCM file as microphone \n", |
445 option_index++); | 446 option_index++); |
446 printf("%i. Add an additional file-playing channel \n", option_index++); | 447 printf("%i. Add an additional file-playing channel \n", option_index++); |
447 printf("%i. Remove a file-playing channel \n", option_index++); | 448 printf("%i. Remove a file-playing channel \n", option_index++); |
448 printf("%i. Toggle Opus stereo (Opus must be selected again to apply " | 449 printf("%i. Toggle Opus stereo (Opus must be selected again to apply " |
449 "the setting) \n", option_index++); | 450 "the setting) \n", option_index++); |
450 printf("%i. Set Opus maximum playback rate \n", option_index++); | 451 printf("%i. Set Opus maximum playback rate \n", option_index++); |
451 printf("%i. Toggle Opus DTX \n", option_index++); | 452 printf("%i. Toggle Opus DTX \n", option_index++); |
452 printf("%i. Set bit rate (only take effect on codecs that allow the " | 453 printf("%i. Set bit rate (only take effect on codecs that allow the " |
453 "change) \n", option_index++); | 454 "change) \n", option_index++); |
454 printf("%i. Toggle debug recording \n", option_index++); | 455 printf("%i. Toggle AECdump recording \n", option_index++); |
| 456 printf("%i. Record RtcEventLog file of 30 seconds \n", option_index++); |
455 | 457 |
456 printf("Select action or %i to stop the call: ", option_index); | 458 printf("Select action or %i to stop the call: ", option_index); |
457 int option_selection; | 459 int option_selection; |
458 ASSERT_EQ(1, scanf("%i", &option_selection)); | 460 ASSERT_EQ(1, scanf("%i", &option_selection)); |
459 | 461 |
460 option_index = num_codecs; | 462 option_index = num_codecs; |
461 if (option_selection < option_index) { | 463 if (option_selection < option_index) { |
462 res = codec->GetCodec(option_selection, cinst); | 464 res = codec->GetCodec(option_selection, cinst); |
463 VALIDATE; | 465 VALIDATE; |
464 if (strcmp(cinst.plname, "red") == 0) { | 466 if (strcmp(cinst.plname, "red") == 0) { |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 } else if (option_selection == option_index++) { | 793 } else if (option_selection == option_index++) { |
792 const char* kDebugFileName = "audio.aecdump"; | 794 const char* kDebugFileName = "audio.aecdump"; |
793 if (debug_recording_started) { | 795 if (debug_recording_started) { |
794 apm->StopDebugRecording(); | 796 apm->StopDebugRecording(); |
795 printf("Debug recording named %s stopped\n", kDebugFileName); | 797 printf("Debug recording named %s stopped\n", kDebugFileName); |
796 } else { | 798 } else { |
797 apm->StartDebugRecording(kDebugFileName); | 799 apm->StartDebugRecording(kDebugFileName); |
798 printf("Debug recording named %s started\n", kDebugFileName); | 800 printf("Debug recording named %s started\n", kDebugFileName); |
799 } | 801 } |
800 debug_recording_started = !debug_recording_started; | 802 debug_recording_started = !debug_recording_started; |
| 803 } else if (option_selection == option_index++) { |
| 804 const char* kDebugFileName = "eventlog.rel"; |
| 805 codec->GetEventLog()->StartLogging(kDebugFileName, 30000); |
801 } else { | 806 } else { |
802 break; | 807 break; |
803 } | 808 } |
804 } | 809 } |
805 | 810 |
806 if (debug_recording_started) { | 811 if (debug_recording_started) { |
807 apm->StopDebugRecording(); | 812 apm->StopDebugRecording(); |
808 } | 813 } |
809 | 814 |
810 if (send) { | 815 if (send) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 | 860 |
856 printf("Delete channels \n"); | 861 printf("Delete channels \n"); |
857 res = base1->DeleteChannel(chan); | 862 res = base1->DeleteChannel(chan); |
858 VALIDATE; | 863 VALIDATE; |
859 | 864 |
860 for (int i = 0; i < kMaxNumChannels; ++i) { | 865 for (int i = 0; i < kMaxNumChannels; ++i) { |
861 res = base1->DeleteChannel(channels[i]); | 866 res = base1->DeleteChannel(channels[i]); |
862 VALIDATE; | 867 VALIDATE; |
863 } | 868 } |
864 } | 869 } |
OLD | NEW |