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_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 <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "webrtc/base/platform_file.h" | |
| 16 #include "webrtc/base/scoped_ptr.h" | 17 #include "webrtc/base/scoped_ptr.h" |
| 17 #include "webrtc/video_receive_stream.h" | 18 #include "webrtc/video_receive_stream.h" |
| 18 #include "webrtc/video_send_stream.h" | 19 #include "webrtc/video_send_stream.h" |
| 19 | 20 |
| 20 namespace webrtc { | 21 namespace webrtc { |
| 21 | 22 |
| 22 // Forward declaration of storage class that is automatically generated from | 23 // Forward declaration of storage class that is automatically generated from |
| 23 // the protobuf file. | 24 // the protobuf file. |
| 24 namespace rtclog { | 25 namespace rtclog { |
| 25 class EventStream; | 26 class EventStream; |
| 26 } // namespace rtclog | 27 } // namespace rtclog |
| 27 | 28 |
| 28 class RtcEventLogImpl; | 29 class RtcEventLogImpl; |
| 29 | 30 |
| 30 enum class MediaType; | 31 enum class MediaType; |
| 31 | 32 |
| 32 class RtcEventLog { | 33 class RtcEventLog { |
| 33 public: | 34 public: |
| 34 virtual ~RtcEventLog() {} | 35 virtual ~RtcEventLog() {} |
| 35 | 36 |
| 36 static rtc::scoped_ptr<RtcEventLog> Create(); | 37 static rtc::scoped_ptr<RtcEventLog> Create(); |
| 37 | 38 |
| 38 // Starts logging for the specified duration to the specified file. | 39 // Starts logging for the specified duration to the specified file. |
| 39 // The logging will stop automatically after the specified duration. | 40 // The logging will stop automatically after the specified duration. |
| 40 // If the file already exists it will be overwritten. | 41 // If the file already exists it will be overwritten. |
| 41 // If the file cannot be opened, the RtcEventLog will not start logging. | 42 // 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 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; |
| 43 | 44 |
| 45 // Starts logging until either the 10 minute timer runs out or the StopLogging | |
| 46 // function is called. The RtcEventLog takes ownership of the supplied | |
| 47 // rtc::PlatformFile. | |
| 48 virtual bool StartLogging(rtc::PlatformFile& log_file) = 0; | |
|
the sun
2015/10/14 13:36:16
Are we lacking a unit test for this function?
the sun
2015/10/14 13:36:16
Send this in by value instead. Non-const reference
ivoc
2015/10/15 15:36:14
There is indeed no unit test for this one, however
ivoc
2015/10/15 15:36:14
Done.
the sun
2015/10/15 16:15:14
sgtm
| |
| 49 | |
| 44 virtual void StopLogging() = 0; | 50 virtual void StopLogging() = 0; |
| 45 | 51 |
| 46 // Logs configuration information for webrtc::VideoReceiveStream | 52 // Logs configuration information for webrtc::VideoReceiveStream |
| 47 virtual void LogVideoReceiveStreamConfig( | 53 virtual void LogVideoReceiveStreamConfig( |
| 48 const webrtc::VideoReceiveStream::Config& config) = 0; | 54 const webrtc::VideoReceiveStream::Config& config) = 0; |
| 49 | 55 |
| 50 // Logs configuration information for webrtc::VideoSendStream | 56 // Logs configuration information for webrtc::VideoSendStream |
| 51 virtual void LogVideoSendStreamConfig( | 57 virtual void LogVideoSendStreamConfig( |
| 52 const webrtc::VideoSendStream::Config& config) = 0; | 58 const webrtc::VideoSendStream::Config& config) = 0; |
| 53 | 59 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 69 | 75 |
| 70 // Reads an RtcEventLog file and returns true when reading was successful. | 76 // Reads an RtcEventLog file and returns true when reading was successful. |
| 71 // The result is stored in the given EventStream object. | 77 // The result is stored in the given EventStream object. |
| 72 static bool ParseRtcEventLog(const std::string& file_name, | 78 static bool ParseRtcEventLog(const std::string& file_name, |
| 73 rtclog::EventStream* result); | 79 rtclog::EventStream* result); |
| 74 }; | 80 }; |
| 75 | 81 |
| 76 } // namespace webrtc | 82 } // namespace webrtc |
| 77 | 83 |
| 78 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ | 84 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ |
| OLD | NEW |