| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |