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

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

Issue 1952443002: [H264][Simulcast] Implement the simulcast logic for h264 encoder Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix a few issues with the patch Created 4 years, 7 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
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 424 }
425 425
426 void SendStatisticsProxy::OnSendEncodedImage( 426 void SendStatisticsProxy::OnSendEncodedImage(
427 const EncodedImage& encoded_image, 427 const EncodedImage& encoded_image,
428 const CodecSpecificInfo* codec_info) { 428 const CodecSpecificInfo* codec_info) {
429 size_t simulcast_idx = 0; 429 size_t simulcast_idx = 0;
430 430
431 if (codec_info) { 431 if (codec_info) {
432 if (codec_info->codecType == kVideoCodecVP8) { 432 if (codec_info->codecType == kVideoCodecVP8) {
433 simulcast_idx = codec_info->codecSpecific.VP8.simulcastIdx; 433 simulcast_idx = codec_info->codecSpecific.VP8.simulcastIdx;
434 } else if (codec_info->codecType == kVideoCodecH264) {
435 simulcast_idx = codec_info->codecSpecific.H264.simulcastIdx;
434 } else if (codec_info->codecType == kVideoCodecGeneric) { 436 } else if (codec_info->codecType == kVideoCodecGeneric) {
435 simulcast_idx = codec_info->codecSpecific.generic.simulcast_idx; 437 simulcast_idx = codec_info->codecSpecific.generic.simulcast_idx;
436 } 438 }
437 } 439 }
438 440
439 if (simulcast_idx >= config_.rtp.ssrcs.size()) { 441 if (simulcast_idx >= config_.rtp.ssrcs.size()) {
440 LOG(LS_ERROR) << "Encoded image outside simulcast range (" << simulcast_idx 442 LOG(LS_ERROR) << "Encoded image outside simulcast range (" << simulcast_idx
441 << " >= " << config_.rtp.ssrcs.size() << ")."; 443 << " >= " << config_.rtp.ssrcs.size() << ").";
442 return; 444 return;
443 } 445 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 return Fraction(min_required_samples, 1000.0f); 624 return Fraction(min_required_samples, 1000.0f);
623 } 625 }
624 626
625 int SendStatisticsProxy::BoolSampleCounter::Fraction( 627 int SendStatisticsProxy::BoolSampleCounter::Fraction(
626 int min_required_samples, float multiplier) const { 628 int min_required_samples, float multiplier) const {
627 if (num_samples < min_required_samples || num_samples == 0) 629 if (num_samples < min_required_samples || num_samples == 0)
628 return -1; 630 return -1;
629 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 631 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
630 } 632 }
631 } // namespace webrtc 633 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698