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

Unified Diff: webrtc/video/video_receive_stream.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 | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_receive_stream.cc
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc
index 47e8c1efad5dda04eee9e4f00f47a88334a3bbe6..9cc8e04abaa24adaf349d2adc79b6c8a0a679eac 100644
--- a/webrtc/video/video_receive_stream.cc
+++ b/webrtc/video/video_receive_stream.cc
@@ -21,6 +21,7 @@
#include "webrtc/base/logging.h"
#include "webrtc/base/optional.h"
#include "webrtc/base/trace_event.h"
+#include "webrtc/common_types.h"
#include "webrtc/common_video/h264/profile_level_id.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
@@ -142,15 +143,11 @@ VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) {
codec.plType = decoder.payload_type;
strncpy(codec.plName, decoder.payload_name.c_str(), sizeof(codec.plName));
- if (decoder.payload_name == "VP8") {
- codec.codecType = kVideoCodecVP8;
- } else if (decoder.payload_name == "VP9") {
- codec.codecType = kVideoCodecVP9;
- } else if (decoder.payload_name == "H264") {
- codec.codecType = kVideoCodecH264;
- } else {
- codec.codecType = kVideoCodecGeneric;
- }
+ // Convert codec name to enum type, using kVideoCodecGeneric if it's not
+ // recognized.
+ rtc::Optional<VideoCodecType> codecType =
+ PayloadNameToCodecType(decoder.payload_name);
+ codec.codecType = codecType ? *codecType : kVideoCodecGeneric;
sprang_webrtc 2017/03/30 08:14:47 You can simplify this to codec.codecType = Payload
Taylor Brandstetter 2017/03/30 17:04:33 Forgot about that; done.
if (codec.codecType == kVideoCodecVP8) {
*(codec.VP8()) = VideoEncoder::GetDefaultVp8Settings();
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698