Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: webrtc/video/video_quality_test.cc

Issue 1376673004: Add a PacketOptions struct to webrtc::Transport. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comment added Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <stdio.h> 10 #include <stdio.h>
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 rtc::CritScope lock(&crit_); 131 rtc::CritScope lock(&crit_);
132 if (first_send_frame_.IsZeroSize() && rtp_timestamp_delta_ == 0) 132 if (first_send_frame_.IsZeroSize() && rtp_timestamp_delta_ == 0)
133 first_send_frame_ = copy; 133 first_send_frame_ = copy;
134 134
135 frames_.push_back(copy); 135 frames_.push_back(copy);
136 } 136 }
137 137
138 input_->IncomingCapturedFrame(video_frame); 138 input_->IncomingCapturedFrame(video_frame);
139 } 139 }
140 140
141 bool SendRtp(const uint8_t* packet, size_t length) override { 141 bool SendRtp(const uint8_t* packet,
142 size_t length,
143 const PacketOptions& options) override {
142 rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create()); 144 rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
143 RTPHeader header; 145 RTPHeader header;
144 parser->Parse(packet, length, &header); 146 parser->Parse(packet, length, &header);
145 147
146 { 148 {
147 rtc::CritScope lock(&crit_); 149 rtc::CritScope lock(&crit_);
148 if (rtp_timestamp_delta_ == 0) { 150 if (rtp_timestamp_delta_ == 0) {
149 rtp_timestamp_delta_ = header.timestamp - first_send_frame_.timestamp(); 151 rtp_timestamp_delta_ = header.timestamp - first_send_frame_.timestamp();
150 first_send_frame_.Reset(); 152 first_send_frame_.Reset();
151 } 153 }
152 uint32_t timestamp = header.timestamp - rtp_timestamp_delta_; 154 uint32_t timestamp = header.timestamp - rtp_timestamp_delta_;
153 send_times_[timestamp] = 155 send_times_[timestamp] =
154 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds(); 156 Clock::GetRealTimeClock()->CurrentNtpInMilliseconds();
155 encoded_frame_sizes_[timestamp] += 157 encoded_frame_sizes_[timestamp] +=
156 length - (header.headerLength + header.paddingLength); 158 length - (header.headerLength + header.paddingLength);
157 } 159 }
158 160
159 return transport_->SendRtp(packet, length); 161 return transport_->SendRtp(packet, length, options);
160 } 162 }
161 163
162 bool SendRtcp(const uint8_t* packet, size_t length) override { 164 bool SendRtcp(const uint8_t* packet, size_t length) override {
163 return transport_->SendRtcp(packet, length); 165 return transport_->SendRtcp(packet, length);
164 } 166 }
165 167
166 void EncodedFrameCallback(const EncodedFrame& frame) override { 168 void EncodedFrameCallback(const EncodedFrame& frame) override {
167 rtc::CritScope lock(&comparison_lock_); 169 rtc::CritScope lock(&comparison_lock_);
168 if (frames_recorded_ < frames_to_process_) 170 if (frames_recorded_ < frames_to_process_)
169 encoded_frame_size_.AddSample(frame.length_); 171 encoded_frame_size_.AddSample(frame.length_);
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 send_stream_->Stop(); 832 send_stream_->Stop();
831 receive_stream->Stop(); 833 receive_stream->Stop();
832 834
833 call->DestroyVideoReceiveStream(receive_stream); 835 call->DestroyVideoReceiveStream(receive_stream);
834 call->DestroyVideoSendStream(send_stream_); 836 call->DestroyVideoSendStream(send_stream_);
835 837
836 transport.StopSending(); 838 transport.StopSending();
837 } 839 }
838 840
839 } // namespace webrtc 841 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/voice_engine/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698