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

Unified Diff: webrtc/video/send_statistics_proxy.cc

Issue 2782273002: Fixing some case-sensitive codec name comparisons. (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/video/video_receive_stream.cc » ('j') | webrtc/video/video_receive_stream.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | webrtc/video/video_receive_stream.cc » ('j') | webrtc/video/video_receive_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698