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

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

Issue 2998293002: Make CodecType conversion functions non-optional. (Closed)
Patch Set: Keep old functions for backwards-compat Created 3 years, 4 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 return kRealtimePrefix; 43 return kRealtimePrefix;
44 case VideoEncoderConfig::ContentType::kScreen: 44 case VideoEncoderConfig::ContentType::kScreen:
45 return kScreenPrefix; 45 return kScreenPrefix;
46 } 46 }
47 RTC_NOTREACHED(); 47 RTC_NOTREACHED();
48 return nullptr; 48 return nullptr;
49 } 49 }
50 50
51 HistogramCodecType PayloadNameToHistogramCodecType( 51 HistogramCodecType PayloadNameToHistogramCodecType(
52 const std::string& payload_name) { 52 const std::string& payload_name) {
53 rtc::Optional<VideoCodecType> codecType = 53 VideoCodecType codecType = PayloadStringToCodecType(payload_name);
54 PayloadNameToCodecType(payload_name); 54 switch (codecType) {
55 if (!codecType) {
56 return kVideoUnknown;
57 }
58 switch (*codecType) {
59 case kVideoCodecVP8: 55 case kVideoCodecVP8:
60 return kVideoVp8; 56 return kVideoVp8;
61 case kVideoCodecVP9: 57 case kVideoCodecVP9:
62 return kVideoVp9; 58 return kVideoVp9;
63 case kVideoCodecH264: 59 case kVideoCodecH264:
64 return kVideoH264; 60 return kVideoH264;
65 default: 61 default:
66 return kVideoUnknown; 62 return kVideoUnknown;
67 } 63 }
68 } 64 }
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 } 911 }
916 912
917 int SendStatisticsProxy::BoolSampleCounter::Fraction( 913 int SendStatisticsProxy::BoolSampleCounter::Fraction(
918 int64_t min_required_samples, 914 int64_t min_required_samples,
919 float multiplier) const { 915 float multiplier) const {
920 if (num_samples < min_required_samples || num_samples == 0) 916 if (num_samples < min_required_samples || num_samples == 0)
921 return -1; 917 return -1;
922 return static_cast<int>((sum * multiplier / num_samples) + 0.5f); 918 return static_cast<int>((sum * multiplier / num_samples) + 0.5f);
923 } 919 }
924 } // namespace webrtc 920 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/VideoToolbox/objc_video_decoder_factory.mm ('k') | webrtc/video/video_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698