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

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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 RTC_DCHECK_GE(config.encoder_settings.payload_type, 0); 218 RTC_DCHECK_GE(config.encoder_settings.payload_type, 0);
219 RTC_DCHECK_LE(config.encoder_settings.payload_type, 127); 219 RTC_DCHECK_LE(config.encoder_settings.payload_type, 127);
220 RTC_CHECK_EQ(0, vie_encoder_->RegisterExternalEncoder( 220 RTC_CHECK_EQ(0, vie_encoder_->RegisterExternalEncoder(
221 config.encoder_settings.encoder, 221 config.encoder_settings.encoder,
222 config.encoder_settings.payload_type, 222 config.encoder_settings.payload_type,
223 config.encoder_settings.internal_source)); 223 config.encoder_settings.internal_source));
224 224
225 RTC_CHECK(ReconfigureVideoEncoder(encoder_config)); 225 RTC_CHECK(ReconfigureVideoEncoder(encoder_config));
226 226
227 vie_channel_->RegisterSendSideDelayObserver(&stats_proxy_); 227 vie_channel_->RegisterSendSideDelayObserver(&stats_proxy_);
228 vie_channel_->RegisterSendPacketObserver(&stats_proxy_);
228 229
229 if (config_.post_encode_callback) 230 if (config_.post_encode_callback)
230 vie_encoder_->RegisterPostEncodeImageCallback(&encoded_frame_proxy_); 231 vie_encoder_->RegisterPostEncodeImageCallback(&encoded_frame_proxy_);
231 232
232 if (config_.suspend_below_min_bitrate) 233 if (config_.suspend_below_min_bitrate)
233 vie_encoder_->SuspendBelowMinBitrate(); 234 vie_encoder_->SuspendBelowMinBitrate();
234 235
235 congestion_controller_->AddEncoder(vie_encoder_.get()); 236 congestion_controller_->AddEncoder(vie_encoder_.get());
236 encoder_feedback_->AddEncoder(ssrcs, vie_encoder_.get()); 237 encoder_feedback_->AddEncoder(ssrcs, vie_encoder_.get());
237 238
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 &jitter, &rtt_ms) == 0) { 535 &jitter, &rtt_ms) == 0) {
535 return rtt_ms; 536 return rtt_ms;
536 } 537 }
537 return -1; 538 return -1;
538 } 539 }
539 540
540 int VideoSendStream::GetPaddingNeededBps() const { 541 int VideoSendStream::GetPaddingNeededBps() const {
541 return vie_encoder_->GetPaddingNeededBps(); 542 return vie_encoder_->GetPaddingNeededBps();
542 } 543 }
543 544
545 bool VideoSendStream::OnSentPacket(int packet_id) {
546 return stats_proxy_.OnSentPacket(packet_id);
547 }
548
544 bool VideoSendStream::SetSendCodec(VideoCodec video_codec) { 549 bool VideoSendStream::SetSendCodec(VideoCodec video_codec) {
545 static const int kEncoderMinBitrate = 30; 550 static const int kEncoderMinBitrate = 30;
546 if (video_codec.maxBitrate == 0) { 551 if (video_codec.maxBitrate == 0) {
547 // Unset max bitrate -> cap to one bit per pixel. 552 // Unset max bitrate -> cap to one bit per pixel.
548 video_codec.maxBitrate = 553 video_codec.maxBitrate =
549 (video_codec.width * video_codec.height * video_codec.maxFramerate) / 554 (video_codec.width * video_codec.height * video_codec.maxFramerate) /
550 1000; 555 1000;
551 } 556 }
552 557
553 if (video_codec.minBitrate < kEncoderMinBitrate) 558 if (video_codec.minBitrate < kEncoderMinBitrate)
(...skipping 21 matching lines...) Expand all
575 vie_encoder_->SetSsrcs(used_ssrcs); 580 vie_encoder_->SetSsrcs(used_ssrcs);
576 581
577 // Restart the media flow 582 // Restart the media flow
578 vie_encoder_->Restart(); 583 vie_encoder_->Restart();
579 584
580 return true; 585 return true;
581 } 586 }
582 587
583 } // namespace internal 588 } // namespace internal
584 } // namespace webrtc 589 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698