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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 if (!debug_event.has_type() || | 56 if (!debug_event.has_type() || |
57 debug_event.type() != rtclog::DebugEvent::AUDIO_PLAYOUT) | 57 debug_event.type() != rtclog::DebugEvent::AUDIO_PLAYOUT) |
58 return nullptr; | 58 return nullptr; |
59 return &debug_event; | 59 return &debug_event; |
60 } | 60 } |
61 | 61 |
62 } // namespace | 62 } // namespace |
63 | 63 |
64 RtcEventLogSource* RtcEventLogSource::Create(const std::string& file_name) { | 64 RtcEventLogSource* RtcEventLogSource::Create(const std::string& file_name) { |
65 RtcEventLogSource* source = new RtcEventLogSource(); | 65 RtcEventLogSource* source = new RtcEventLogSource(); |
66 CHECK(source->OpenFile(file_name)); | 66 RTC_CHECK(source->OpenFile(file_name)); |
67 return source; | 67 return source; |
68 } | 68 } |
69 | 69 |
70 RtcEventLogSource::~RtcEventLogSource() {} | 70 RtcEventLogSource::~RtcEventLogSource() {} |
71 | 71 |
72 bool RtcEventLogSource::RegisterRtpHeaderExtension(RTPExtensionType type, | 72 bool RtcEventLogSource::RegisterRtpHeaderExtension(RTPExtensionType type, |
73 uint8_t id) { | 73 uint8_t id) { |
74 CHECK(parser_.get()); | 74 RTC_CHECK(parser_.get()); |
75 return parser_->RegisterRtpHeaderExtension(type, id); | 75 return parser_->RegisterRtpHeaderExtension(type, id); |
76 } | 76 } |
77 | 77 |
78 Packet* RtcEventLogSource::NextPacket() { | 78 Packet* RtcEventLogSource::NextPacket() { |
79 while (rtp_packet_index_ < event_log_->stream_size()) { | 79 while (rtp_packet_index_ < event_log_->stream_size()) { |
80 const rtclog::Event& event = event_log_->stream(rtp_packet_index_); | 80 const rtclog::Event& event = event_log_->stream(rtp_packet_index_); |
81 const rtclog::RtpPacket* rtp_packet = GetRtpPacket(event); | 81 const rtclog::RtpPacket* rtp_packet = GetRtpPacket(event); |
82 rtp_packet_index_++; | 82 rtp_packet_index_++; |
83 if (rtp_packet) { | 83 if (rtp_packet) { |
84 uint8_t* packet_header = new uint8_t[rtp_packet->header().size()]; | 84 uint8_t* packet_header = new uint8_t[rtp_packet->header().size()]; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 RtcEventLogSource::RtcEventLogSource() | 118 RtcEventLogSource::RtcEventLogSource() |
119 : PacketSource(), parser_(RtpHeaderParser::Create()) {} | 119 : PacketSource(), parser_(RtpHeaderParser::Create()) {} |
120 | 120 |
121 bool RtcEventLogSource::OpenFile(const std::string& file_name) { | 121 bool RtcEventLogSource::OpenFile(const std::string& file_name) { |
122 event_log_.reset(new rtclog::EventStream()); | 122 event_log_.reset(new rtclog::EventStream()); |
123 return RtcEventLog::ParseRtcEventLog(file_name, event_log_.get()); | 123 return RtcEventLog::ParseRtcEventLog(file_name, event_log_.get()); |
124 } | 124 } |
125 | 125 |
126 } // namespace test | 126 } // namespace test |
127 } // namespace webrtc | 127 } // namespace webrtc |
OLD | NEW |