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_CALL_RTC_EVENT_LOG_H_ | 11 #ifndef WEBRTC_CALL_RTC_EVENT_LOG_H_ |
12 #define WEBRTC_CALL_RTC_EVENT_LOG_H_ | 12 #define WEBRTC_CALL_RTC_EVENT_LOG_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "webrtc/base/logging.h" | |
18 #include "webrtc/base/platform_file.h" | 17 #include "webrtc/base/platform_file.h" |
19 #include "webrtc/video_receive_stream.h" | 18 #include "webrtc/video_receive_stream.h" |
20 #include "webrtc/video_send_stream.h" | 19 #include "webrtc/video_send_stream.h" |
21 | 20 |
22 namespace webrtc { | 21 namespace webrtc { |
23 | 22 |
24 // Forward declaration of storage class that is automatically generated from | 23 // Forward declaration of storage class that is automatically generated from |
25 // the protobuf file. | 24 // the protobuf file. |
26 namespace rtclog { | 25 namespace rtclog { |
27 class EventStream; | 26 class EventStream; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // The result is stored in the given EventStream object. | 102 // The result is stored in the given EventStream object. |
104 // The order of the events in the EventStream is implementation defined. | 103 // The order of the events in the EventStream is implementation defined. |
105 // The current implementation writes a LOG_START event, then the old | 104 // The current implementation writes a LOG_START event, then the old |
106 // configurations, then the remaining events in timestamp order and finally | 105 // configurations, then the remaining events in timestamp order and finally |
107 // a LOG_END event. However, this might change without further notice. | 106 // a LOG_END event. However, this might change without further notice. |
108 // TODO(terelius): Change result type to a vector? | 107 // TODO(terelius): Change result type to a vector? |
109 static bool ParseRtcEventLog(const std::string& file_name, | 108 static bool ParseRtcEventLog(const std::string& file_name, |
110 rtclog::EventStream* result); | 109 rtclog::EventStream* result); |
111 }; | 110 }; |
112 | 111 |
113 // No-op implementation is used if flag is not set, or in tests. | |
114 class RtcEventLogNullImpl final : public RtcEventLog { | |
115 public: | |
116 bool StartLogging(const std::string& file_name, | |
117 int64_t max_size_bytes) override { | |
118 return false; | |
119 } | |
120 bool StartLogging(rtc::PlatformFile platform_file, | |
121 int64_t max_size_bytes) override { | |
122 // The platform_file is open and needs to be closed. | |
123 if (!rtc::ClosePlatformFile(platform_file)) { | |
124 LOG(LS_ERROR) << "Can't close file."; | |
125 } | |
126 return false; | |
127 } | |
128 void StopLogging() override {} | |
129 void LogVideoReceiveStreamConfig( | |
130 const VideoReceiveStream::Config& config) override {} | |
131 void LogVideoSendStreamConfig( | |
132 const VideoSendStream::Config& config) override {} | |
133 void LogRtpHeader(PacketDirection direction, | |
134 MediaType media_type, | |
135 const uint8_t* header, | |
136 size_t packet_length) override {} | |
137 void LogRtcpPacket(PacketDirection direction, | |
138 MediaType media_type, | |
139 const uint8_t* packet, | |
140 size_t length) override {} | |
141 void LogAudioPlayout(uint32_t ssrc) override {} | |
142 void LogBwePacketLossEvent(int32_t bitrate, | |
143 uint8_t fraction_loss, | |
144 int32_t total_packets) override {} | |
145 }; | |
146 | |
147 } // namespace webrtc | 112 } // namespace webrtc |
148 | 113 |
149 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ | 114 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ |
OLD | NEW |