Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ |
| 12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ |
| 13 | 13 |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "webrtc/base/scoped_ptr.h" | 16 #include "webrtc/base/scoped_ptr.h" |
| 17 #include "webrtc/video_receive_stream.h" | |
| 18 #include "webrtc/video_send_stream.h" | |
| 19 #include "webrtc/call.h" // For MediaType definition | |
|
ivoc
2015/07/14 12:13:14
I think it would be a good idea to move these incl
terelius
2015/07/16 12:47:03
Good idea, unfortunately it seems difficult to do.
ivoc
2015/07/17 12:14:28
I think forward declaring MediaType should work at
| |
| 17 | 20 |
| 18 namespace webrtc { | 21 namespace webrtc { |
| 19 | 22 |
| 20 // Forward declaration of storage class that is automatically generated from | 23 // Forward declaration of storage class that is automatically generated from |
| 21 // the protobuf file. | 24 // the protobuf file. |
| 22 class ACMDumpEventStream; | 25 class ACMDumpEventStream; |
| 23 | 26 |
| 24 class AcmDumpImpl; | 27 class AcmDumpImpl; |
| 25 | 28 |
| 26 class AcmDump { | 29 class AcmDump { |
| 27 public: | 30 public: |
| 28 // The types of debug events that are currently supported for logging. | 31 // The types of debug events that are currently supported for logging. |
| 29 enum class DebugEvent { kLogStart, kLogEnd, kAudioPlayout }; | 32 enum class DebugEvent { kLogStart, kLogEnd, kAudioPlayout }; |
| 30 | 33 |
| 31 virtual ~AcmDump() {} | 34 virtual ~AcmDump() {} |
| 32 | 35 |
| 33 static rtc::scoped_ptr<AcmDump> Create(); | 36 static rtc::scoped_ptr<AcmDump> Create(); |
| 34 | 37 |
| 35 // Starts logging for the specified duration to the specified file. | 38 // Starts logging for the specified duration to the specified file. |
| 36 // The logging will stop automatically after the specified duration. | 39 // The logging will stop automatically after the specified duration. |
| 37 // If the file already exists it will be overwritten. | 40 // If the file already exists it will be overwritten. |
| 38 // The function will return false on failure. | 41 // The function will return false on failure. |
| 42 // TODO(terelius): Can't return false because declared as void. Fix | |
| 43 // documentation? | |
|
ivoc
2015/07/14 12:13:14
Sounds like a good idea, I probably forgot to chan
terelius
2015/07/16 12:47:03
Done.
| |
| 39 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; | 44 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; |
| 40 | 45 |
| 41 // Logs an incoming or outgoing RTP packet. | 46 // Logs configuration information for webrtc::VideoReceiveStream |
| 42 virtual void LogRtpPacket(bool incoming, | 47 virtual void LogVideoReceiveStreamConfig( |
| 43 const uint8_t* packet, | 48 const webrtc::VideoReceiveStream::Config& config) = 0; |
| 44 size_t length) = 0; | 49 |
| 50 // Logs configuration information for webrtc::VideoSendStream | |
| 51 virtual void LogVideoSendStreamConfig( | |
| 52 const webrtc::VideoSendStream::Config& config) = 0; | |
| 53 | |
| 54 // Logs the header of an incoming or outgoing RTP packet. | |
| 55 virtual void LogRtpHeader(bool incoming, | |
| 56 MediaType media_type, | |
|
ivoc
2015/07/14 12:13:14
media_type should be a const reference.
stefan-webrtc
2015/07/14 13:28:56
Why would we do that? Seems like MediaType is a ve
ivoc
2015/07/14 13:58:03
Oh, I didn't actually look at the definition of Me
terelius
2015/07/16 12:47:03
I'll keep passing by value unless a change of type
| |
| 57 const uint8_t* header, | |
| 58 size_t header_length, | |
| 59 size_t total_length) = 0; | |
| 60 | |
| 61 // Logs an incoming or outgoing RTCP packet. | |
| 62 virtual void LogRtcpPacket(bool incoming, | |
| 63 MediaType media_type, | |
|
ivoc
2015/07/14 12:13:14
Same here.
terelius
2015/07/16 12:47:02
I'll keep it as-is for the time being.
| |
| 64 const uint8_t* packet, | |
| 65 size_t length) = 0; | |
| 45 | 66 |
| 46 // Logs a debug event, with optional message. | 67 // Logs a debug event, with optional message. |
| 47 virtual void LogDebugEvent(DebugEvent event_type, | 68 virtual void LogDebugEvent(DebugEvent event_type, |
| 48 const std::string& event_message) = 0; | 69 const std::string& event_message) = 0; |
| 49 virtual void LogDebugEvent(DebugEvent event_type) = 0; | 70 virtual void LogDebugEvent(DebugEvent event_type) = 0; |
| 50 | 71 |
| 51 // Reads an AcmDump file and returns true when reading was successful. | 72 // Reads an AcmDump file and returns true when reading was successful. |
| 52 // The result is stored in the given ACMDumpEventStream object. | 73 // The result is stored in the given ACMDumpEventStream object. |
| 53 static bool ParseAcmDump(const std::string& file_name, | 74 static bool ParseAcmDump(const std::string& file_name, |
| 54 ACMDumpEventStream* result); | 75 ACMDumpEventStream* result); |
| 55 }; | 76 }; |
| 56 | 77 |
| 57 } // namespace webrtc | 78 } // namespace webrtc |
| 58 | 79 |
| 59 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ | 80 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_DUMP_H_ |
| OLD | NEW |