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 <stdio.h> | |
| 15 | |
| 14 #include <string> | 16 #include <string> |
| 15 | 17 |
| 18 #include "webrtc/base/platform_file.h" | |
| 16 #include "webrtc/base/scoped_ptr.h" | 19 #include "webrtc/base/scoped_ptr.h" |
| 17 #include "webrtc/video_receive_stream.h" | 20 #include "webrtc/video_receive_stream.h" |
| 18 #include "webrtc/video_send_stream.h" | 21 #include "webrtc/video_send_stream.h" |
| 19 | 22 |
| 20 namespace webrtc { | 23 namespace webrtc { |
| 21 | 24 |
| 22 // Forward declaration of storage class that is automatically generated from | 25 // Forward declaration of storage class that is automatically generated from |
| 23 // the protobuf file. | 26 // the protobuf file. |
| 24 namespace rtclog { | 27 namespace rtclog { |
| 25 class EventStream; | 28 class EventStream; |
| 26 } // namespace rtclog | 29 } // namespace rtclog |
| 27 | 30 |
| 28 class RtcEventLogImpl; | 31 class RtcEventLogImpl; |
| 29 | 32 |
| 30 enum class MediaType; | 33 enum class MediaType; |
| 31 | 34 |
| 32 class RtcEventLog { | 35 class RtcEventLog { |
| 33 public: | 36 public: |
| 34 virtual ~RtcEventLog() {} | 37 virtual ~RtcEventLog() {} |
| 35 | 38 |
| 36 static rtc::scoped_ptr<RtcEventLog> Create(); | 39 static rtc::scoped_ptr<RtcEventLog> Create(); |
| 37 | 40 |
| 38 // Starts logging for the specified duration to the specified file. | 41 // Starts logging for the specified duration to the specified file. |
| 39 // The logging will stop automatically after the specified duration. | 42 // The logging will stop automatically after the specified duration. |
| 40 // If the file already exists it will be overwritten. | 43 // If the file already exists it will be overwritten. |
| 41 // If the file cannot be opened, the RtcEventLog will not start logging. | 44 // 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; | 45 virtual void StartLogging(const std::string& file_name, int duration_ms) = 0; |
| 43 | 46 |
| 47 // Starts logging until either the 10 minute timer runs out or the StopLogging | |
| 48 // function is called. This function uses an already opened file pointer, and | |
| 49 // will return 0 on success. | |
| 50 virtual int StartLogging(FILE* log_file) = 0; | |
|
the sun
2015/10/14 09:29:09
Can this be removed? Together with the stdio.h inc
ivoc
2015/10/14 12:23:47
Done and Done.
| |
| 51 | |
| 52 // Starts logging until either the 10 minute timer runs out or the StopLogging | |
| 53 // function is called. The RtcEventLog takes ownership of the supplied | |
| 54 // rtc::PlatformFile. | |
| 55 virtual int StartLogging(rtc::PlatformFile& log_file) = 0; | |
|
the sun
2015/10/14 09:29:09
Why doesn't this function return a bool?
ivoc
2015/10/14 12:23:47
I don't remember the reason, but I agree that bool
| |
| 56 | |
| 44 virtual void StopLogging() = 0; | 57 virtual void StopLogging() = 0; |
| 45 | 58 |
| 46 // Logs configuration information for webrtc::VideoReceiveStream | 59 // Logs configuration information for webrtc::VideoReceiveStream |
| 47 virtual void LogVideoReceiveStreamConfig( | 60 virtual void LogVideoReceiveStreamConfig( |
| 48 const webrtc::VideoReceiveStream::Config& config) = 0; | 61 const webrtc::VideoReceiveStream::Config& config) = 0; |
| 49 | 62 |
| 50 // Logs configuration information for webrtc::VideoSendStream | 63 // Logs configuration information for webrtc::VideoSendStream |
| 51 virtual void LogVideoSendStreamConfig( | 64 virtual void LogVideoSendStreamConfig( |
| 52 const webrtc::VideoSendStream::Config& config) = 0; | 65 const webrtc::VideoSendStream::Config& config) = 0; |
| 53 | 66 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 69 | 82 |
| 70 // Reads an RtcEventLog file and returns true when reading was successful. | 83 // Reads an RtcEventLog file and returns true when reading was successful. |
| 71 // The result is stored in the given EventStream object. | 84 // The result is stored in the given EventStream object. |
| 72 static bool ParseRtcEventLog(const std::string& file_name, | 85 static bool ParseRtcEventLog(const std::string& file_name, |
| 73 rtclog::EventStream* result); | 86 rtclog::EventStream* result); |
| 74 }; | 87 }; |
| 75 | 88 |
| 76 } // namespace webrtc | 89 } // namespace webrtc |
| 77 | 90 |
| 78 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ | 91 #endif // WEBRTC_CALL_RTC_EVENT_LOG_H_ |
| OLD | NEW |