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

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

Issue 1478253002: Add histogram stats for send delay for a sent video stream. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 RTC_DCHECK_GE(config.encoder_settings.payload_type, 0); 216 RTC_DCHECK_GE(config.encoder_settings.payload_type, 0);
217 RTC_DCHECK_LE(config.encoder_settings.payload_type, 127); 217 RTC_DCHECK_LE(config.encoder_settings.payload_type, 127);
218 RTC_CHECK_EQ(0, vie_encoder_->RegisterExternalEncoder( 218 RTC_CHECK_EQ(0, vie_encoder_->RegisterExternalEncoder(
219 config.encoder_settings.encoder, 219 config.encoder_settings.encoder,
220 config.encoder_settings.payload_type, 220 config.encoder_settings.payload_type,
221 config.encoder_settings.internal_source)); 221 config.encoder_settings.internal_source));
222 222
223 RTC_CHECK(ReconfigureVideoEncoder(encoder_config)); 223 RTC_CHECK(ReconfigureVideoEncoder(encoder_config));
224 224
225 vie_channel_->RegisterSendSideDelayObserver(&stats_proxy_); 225 vie_channel_->RegisterSendSideDelayObserver(&stats_proxy_);
226 vie_channel_->RegisterSendPacketObserver(&stats_proxy_);
226 227
227 if (config_.post_encode_callback) 228 if (config_.post_encode_callback)
228 vie_encoder_->RegisterPostEncodeImageCallback(&encoded_frame_proxy_); 229 vie_encoder_->RegisterPostEncodeImageCallback(&encoded_frame_proxy_);
229 230
230 if (config_.suspend_below_min_bitrate) 231 if (config_.suspend_below_min_bitrate)
231 vie_encoder_->SuspendBelowMinBitrate(); 232 vie_encoder_->SuspendBelowMinBitrate();
232 233
233 congestion_controller_->AddEncoder(vie_encoder_.get()); 234 congestion_controller_->AddEncoder(vie_encoder_.get());
234 encoder_feedback_->AddEncoder(ssrcs, vie_encoder_.get()); 235 encoder_feedback_->AddEncoder(ssrcs, vie_encoder_.get());
235 236
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 &jitter, &rtt_ms) == 0) { 531 &jitter, &rtt_ms) == 0) {
531 return rtt_ms; 532 return rtt_ms;
532 } 533 }
533 return -1; 534 return -1;
534 } 535 }
535 536
536 int VideoSendStream::GetPaddingNeededBps() const { 537 int VideoSendStream::GetPaddingNeededBps() const {
537 return vie_encoder_->GetPaddingNeededBps(); 538 return vie_encoder_->GetPaddingNeededBps();
538 } 539 }
539 540
541 void VideoSendStream::OnSentPacket(int packet_id) {
542 stats_proxy_.OnSentPacket(packet_id);
543 }
544
540 bool VideoSendStream::SetSendCodec(VideoCodec video_codec) { 545 bool VideoSendStream::SetSendCodec(VideoCodec video_codec) {
541 static const int kEncoderMinBitrate = 30; 546 static const int kEncoderMinBitrate = 30;
542 if (video_codec.maxBitrate == 0) { 547 if (video_codec.maxBitrate == 0) {
543 // Unset max bitrate -> cap to one bit per pixel. 548 // Unset max bitrate -> cap to one bit per pixel.
544 video_codec.maxBitrate = 549 video_codec.maxBitrate =
545 (video_codec.width * video_codec.height * video_codec.maxFramerate) / 550 (video_codec.width * video_codec.height * video_codec.maxFramerate) /
546 1000; 551 1000;
547 } 552 }
548 553
549 if (video_codec.minBitrate < kEncoderMinBitrate) 554 if (video_codec.minBitrate < kEncoderMinBitrate)
(...skipping 21 matching lines...) Expand all
571 vie_encoder_->SetSsrcs(used_ssrcs); 576 vie_encoder_->SetSsrcs(used_ssrcs);
572 577
573 // Restart the media flow 578 // Restart the media flow
574 vie_encoder_->Restart(); 579 vie_encoder_->Restart();
575 580
576 return true; 581 return true;
577 } 582 }
578 583
579 } // namespace internal 584 } // namespace internal
580 } // namespace webrtc 585 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698