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_VIDEO_RTC_EVENT_LOG_H_ | |
12 #define WEBRTC_VIDEO_RTC_EVENT_LOG_H_ | |
13 | |
14 #include <string> | |
15 | |
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/17 12:14:29
I guess these should be in alphabetical order as w
terelius
2015/07/17 15:17:40
Done.
| |
20 | |
21 namespace webrtc { | |
22 | |
23 // Forward declaration of storage class that is automatically generated from | |
24 // the protobuf file. | |
25 class RelEventStream; | |
26 | |
27 class RtcEventLogImpl; | |
28 | |
29 class RtcEventLog { | |
30 public: | |
31 // The types of debug events that are currently supported for logging. | |
32 enum class DebugEvent { kLogStart, kLogEnd, kAudioPlayout }; | |
33 | |
34 virtual ~RtcEventLog() {} | |
35 | |
36 static rtc::scoped_ptr<RtcEventLog> Create(); | |
37 | |
38 // Starts logging for the specified duration to the specified file. | |
39 // The logging will stop automatically after the specified duration. | |
40 // If the file already exists it will be overwritten. | |
41 // If the file cannot be opened, the RtcEventLog will not start logging. | |
42 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; | |
43 | |
44 // Logs configuration information for webrtc::VideoReceiveStream | |
45 virtual void LogVideoReceiveStreamConfig( | |
46 const webrtc::VideoReceiveStream::Config& config) = 0; | |
47 | |
48 // Logs configuration information for webrtc::VideoSendStream | |
49 virtual void LogVideoSendStreamConfig( | |
50 const webrtc::VideoSendStream::Config& config) = 0; | |
51 | |
52 // Logs the header of an incoming or outgoing RTP packet. | |
53 virtual void LogRtpHeader(bool incoming, | |
54 MediaType media_type, | |
55 const uint8_t* header, | |
56 size_t header_length, | |
57 size_t total_length) = 0; | |
58 | |
59 // Logs an incoming or outgoing RTCP packet. | |
60 virtual void LogRtcpPacket(bool incoming, | |
61 MediaType media_type, | |
62 const uint8_t* packet, | |
63 size_t length) = 0; | |
64 | |
65 // Logs a debug event, with optional message. | |
66 virtual void LogDebugEvent(DebugEvent event_type, | |
67 const std::string& event_message) = 0; | |
68 virtual void LogDebugEvent(DebugEvent event_type) = 0; | |
69 | |
70 // Reads an RtcEventLog file and returns true when reading was successful. | |
71 // The result is stored in the given RelEventStream object. | |
72 static bool ParseRtcEventLog(const std::string& file_name, | |
73 RelEventStream* result); | |
74 }; | |
75 | |
76 } // namespace webrtc | |
77 | |
78 #endif // WEBRTC_VIDEO_RTC_EVENT_LOG_H_ | |
OLD | NEW |