Index: webrtc/video/send_statistics_proxy.cc |
diff --git a/webrtc/video/send_statistics_proxy.cc b/webrtc/video/send_statistics_proxy.cc |
index 1f12b2d640ab63d9887d9f087d04cc2ac6993006..faa07149f07bef4f77f7969f29d306d3ae71d548 100644 |
--- a/webrtc/video/send_statistics_proxy.cc |
+++ b/webrtc/video/send_statistics_proxy.cc |
@@ -18,6 +18,7 @@ |
#include "webrtc/base/checks.h" |
#include "webrtc/base/logging.h" |
#include "webrtc/base/trace_event.h" |
+#include "webrtc/common_types.h" |
#include "webrtc/modules/video_coding/include/video_codec_interface.h" |
#include "webrtc/system_wrappers/include/metrics.h" |
@@ -50,15 +51,21 @@ const char* GetUmaPrefix(VideoEncoderConfig::ContentType content_type) { |
HistogramCodecType PayloadNameToHistogramCodecType( |
const std::string& payload_name) { |
- if (payload_name == "VP8") { |
- return kVideoVp8; |
- } else if (payload_name == "VP9") { |
- return kVideoVp9; |
- } else if (payload_name == "H264") { |
- return kVideoH264; |
- } else { |
+ rtc::Optional<VideoCodecType> codecType = |
+ PayloadNameToCodecType(payload_name); |
+ if (!codecType) { |
return kVideoUnknown; |
} |
+ switch (*codecType) { |
+ case kVideoCodecVP8: |
+ return kVideoVp8; |
+ case kVideoCodecVP9: |
+ return kVideoVp9; |
+ case kVideoCodecH264: |
+ return kVideoH264; |
+ default: |
+ return kVideoUnknown; |
+ } |
} |
void UpdateCodecTypeHistogram(const std::string& payload_name) { |