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

Unified Diff: webrtc/modules/video_coding/utility/ivf_file_writer.cc

Issue 2509273002: Unify VideoCodecType to/from string functionality (Closed)
Patch Set: Rebase and update unknown string in WebRtcVideoEncoderFactory Created 4 years, 1 month 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
Index: webrtc/modules/video_coding/utility/ivf_file_writer.cc
diff --git a/webrtc/modules/video_coding/utility/ivf_file_writer.cc b/webrtc/modules/video_coding/utility/ivf_file_writer.cc
index 4198dfea496ab3036d959ad6808ce73df78524b6..d01d0231e854482c851d438e23bf8b71482d93cc 100644
--- a/webrtc/modules/video_coding/utility/ivf_file_writer.cc
+++ b/webrtc/modules/video_coding/utility/ivf_file_writer.cc
@@ -122,20 +122,8 @@ bool IvfFileWriter::InitFromFirstFrame(const EncodedImage& encoded_image,
if (!WriteHeader())
return false;
- std::string codec_name;
- switch (codec_type_) {
- case kVideoCodecVP8:
- codec_name = "VP8";
- break;
- case kVideoCodecVP9:
- codec_name = "VP9";
- break;
- case kVideoCodecH264:
- codec_name = "H264";
- break;
- default:
- codec_name = "Unknown";
- }
+ const char* codec_name =
+ CodecTypeToPayloadName(codec_type_).value_or("Unknown");
LOG(LS_WARNING) << "Created IVF file for codec data of type " << codec_name
<< " at resolution " << width_ << " x " << height_
<< ", using " << (using_capture_timestamps_ ? "1" : "90")

Powered by Google App Engine
This is Rietveld 408576698