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 <string> | 15 #include <string> |
15 | 16 |
16 #include "webrtc/base/platform_file.h" | 17 #include "webrtc/base/platform_file.h" |
17 #include "webrtc/base/scoped_ptr.h" | |
18 #include "webrtc/video_receive_stream.h" | 18 #include "webrtc/video_receive_stream.h" |
19 #include "webrtc/video_send_stream.h" | 19 #include "webrtc/video_send_stream.h" |
20 | 20 |
21 namespace webrtc { | 21 namespace webrtc { |
22 | 22 |
23 // Forward declaration of storage class that is automatically generated from | 23 // Forward declaration of storage class that is automatically generated from |
24 // the protobuf file. | 24 // the protobuf file. |
25 namespace rtclog { | 25 namespace rtclog { |
26 class EventStream; | 26 class EventStream; |
27 } // namespace rtclog | 27 } // namespace rtclog |
28 | 28 |
29 class RtcEventLogImpl; | 29 class RtcEventLogImpl; |
30 | 30 |
31 enum class MediaType; | 31 enum class MediaType; |
32 | 32 |
33 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; | 33 enum PacketDirection { kIncomingPacket = 0, kOutgoingPacket }; |
34 | 34 |
35 class RtcEventLog { | 35 class RtcEventLog { |
36 public: | 36 public: |
37 virtual ~RtcEventLog() {} | 37 virtual ~RtcEventLog() {} |
38 | 38 |
39 static rtc::scoped_ptr<RtcEventLog> Create(); | 39 static std::unique_ptr<RtcEventLog> Create(); |
40 | 40 |
41 // Sets the time that events are stored in the internal event buffer | 41 // Sets the time that events are stored in the internal event buffer |
42 // before the user calls StartLogging. The default is 10 000 000 us = 10 s | 42 // before the user calls StartLogging. The default is 10 000 000 us = 10 s |
43 virtual void SetBufferDuration(int64_t buffer_duration_us) = 0; | 43 virtual void SetBufferDuration(int64_t buffer_duration_us) = 0; |
44 | 44 |
45 // Starts logging for the specified duration to the specified file. | 45 // Starts logging for the specified duration to the specified file. |
46 // The logging will stop automatically after the specified duration. | 46 // The logging will stop automatically after the specified duration. |
47 // If the file already exists it will be overwritten. | 47 // If the file already exists it will be overwritten. |
48 // If the file cannot be opened, the RtcEventLog will not start logging. | 48 // If the file cannot be opened, the RtcEventLog will not start logging. |
49 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; | 49 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 // Reads an RtcEventLog file and returns true when reading was successful. | 87 // Reads an RtcEventLog file and returns true when reading was successful. |
88 // The result is stored in the given EventStream object. | 88 // The result is stored in the given EventStream object. |
89 static bool ParseRtcEventLog(const std::string& file_name, | 89 static bool ParseRtcEventLog(const std::string& file_name, |
90 rtclog::EventStream* result); | 90 rtclog::EventStream* result); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace webrtc | 93 } // namespace webrtc |
94 | 94 |
95 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ | 95 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ |
OLD | NEW |