OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ | |
12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ | |
13 | |
14 #include <string> | |
15 | |
16 #include "webrtc/base/scoped_ptr.h" | |
17 | |
18 namespace webrtc { | |
19 | |
20 // Forward declaration of storage class that is automatically generated from | |
21 // the protobuf file. | |
22 class ACMDumpEventStream; | |
23 | |
24 class AcmDumpImpl; | |
25 | |
26 class AcmDump { | |
27 public: | |
28 // The types of debug events that are currently supported for logging. | |
29 enum class DebugEvent { kLogStart, kLogEnd, kAudioPlayout }; | |
30 | |
31 virtual ~AcmDump() {} | |
32 | |
33 static rtc::scoped_ptr<AcmDump> Create(); | |
34 | |
35 // Starts logging for the specified duration to the specified file. | |
36 // The logging will stop automatically after the specified duration. | |
37 // If the file already exists it will be overwritten. | |
38 // The function will return false on failure. | |
39 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; | |
40 | |
41 // Logs an incoming or outgoing RTP packet. | |
42 virtual void LogRtpPacket(bool incoming, | |
43 const uint8_t* packet, | |
44 size_t length) = 0; | |
45 | |
46 // Logs a debug event, with optional message. | |
47 virtual void LogDebugEvent(DebugEvent event_type, | |
48 const std::string& event_message) = 0; | |
49 virtual void LogDebugEvent(DebugEvent event_type) = 0; | |
50 | |
51 // Reads an AcmDump file and returns true when reading was successful. | |
52 // The result is stored in the given ACMDumpEventStream object. | |
53 static bool ParseAcmDump(const std::string& file_name, | |
54 ACMDumpEventStream* result); | |
55 }; | |
56 | |
57 } // namespace webrtc | |
58 | |
59 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ | |
OLD | NEW |