| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/extended_reports.h" |
| 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/receiver_report.h" |
| 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h" | 32 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/psfb.h" |
| 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" | 33 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" |
| 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" | 34 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sdes.h" |
| 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" | 35 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/sender_report.h" |
| 36 #include "webrtc/system_wrappers/include/file_wrapper.h" | 36 #include "webrtc/system_wrappers/include/file_wrapper.h" |
| 37 #include "webrtc/system_wrappers/include/logging.h" | 37 #include "webrtc/system_wrappers/include/logging.h" |
| 38 | 38 |
| 39 #ifdef ENABLE_RTC_EVENT_LOG | 39 #ifdef ENABLE_RTC_EVENT_LOG |
| 40 // Files generated at build-time by the protobuf compiler. | 40 #include "webrtc/base/protobuf_utils.h" |
| 41 // *.pb.h files are generated at build-time by the protobuf compiler. |
| 41 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD | 42 #ifdef WEBRTC_ANDROID_PLATFORM_BUILD |
| 42 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" | 43 #include "external/webrtc/webrtc/logging/rtc_event_log/rtc_event_log.pb.h" |
| 43 #else | 44 #else |
| 44 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" | 45 #include "webrtc/logging/rtc_event_log/rtc_event_log.pb.h" |
| 45 #endif | 46 #endif |
| 46 #endif | 47 #endif |
| 47 | 48 |
| 48 namespace webrtc { | 49 namespace webrtc { |
| 49 | 50 |
| 50 #ifdef ENABLE_RTC_EVENT_LOG | 51 #ifdef ENABLE_RTC_EVENT_LOG |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 } | 577 } |
| 577 | 578 |
| 578 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, | 579 bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, |
| 579 rtclog::EventStream* result) { | 580 rtclog::EventStream* result) { |
| 580 char tmp_buffer[1024]; | 581 char tmp_buffer[1024]; |
| 581 int bytes_read = 0; | 582 int bytes_read = 0; |
| 582 std::unique_ptr<FileWrapper> dump_file(FileWrapper::Create()); | 583 std::unique_ptr<FileWrapper> dump_file(FileWrapper::Create()); |
| 583 if (!dump_file->OpenFile(file_name.c_str(), true)) { | 584 if (!dump_file->OpenFile(file_name.c_str(), true)) { |
| 584 return false; | 585 return false; |
| 585 } | 586 } |
| 586 std::string dump_buffer; | 587 ProtoString dump_buffer; |
| 587 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { | 588 while ((bytes_read = dump_file->Read(tmp_buffer, sizeof(tmp_buffer))) > 0) { |
| 588 dump_buffer.append(tmp_buffer, bytes_read); | 589 dump_buffer.append(tmp_buffer, bytes_read); |
| 589 } | 590 } |
| 590 dump_file->CloseFile(); | 591 dump_file->CloseFile(); |
| 591 return result->ParseFromString(dump_buffer); | 592 return result->ParseFromString(dump_buffer); |
| 592 } | 593 } |
| 593 | 594 |
| 594 #endif // ENABLE_RTC_EVENT_LOG | 595 #endif // ENABLE_RTC_EVENT_LOG |
| 595 | 596 |
| 596 bool RtcEventLogNullImpl::StartLogging(rtc::PlatformFile platform_file, | 597 bool RtcEventLogNullImpl::StartLogging(rtc::PlatformFile platform_file, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 609 #else | 610 #else |
| 610 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 611 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
| 611 #endif // ENABLE_RTC_EVENT_LOG | 612 #endif // ENABLE_RTC_EVENT_LOG |
| 612 } | 613 } |
| 613 | 614 |
| 614 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { | 615 std::unique_ptr<RtcEventLog> RtcEventLog::CreateNull() { |
| 615 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); | 616 return std::unique_ptr<RtcEventLog>(new RtcEventLogNullImpl()); |
| 616 } | 617 } |
| 617 | 618 |
| 618 } // namespace webrtc | 619 } // namespace webrtc |
| OLD | NEW |