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

Unified Diff: media/base/video_decoder_config.cc

Issue 743483002: Emit Media Source codec names as media_log events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the switces for android g++ Created 6 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
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_decoder_config.cc
diff --git a/media/base/video_decoder_config.cc b/media/base/video_decoder_config.cc
index d2b6e410103e4a066c9b971a9376a30d3caa48c9..27fe9f59b9f08dc780081fd650928fd0dfcc09ff 100644
--- a/media/base/video_decoder_config.cc
+++ b/media/base/video_decoder_config.cc
@@ -113,7 +113,7 @@ bool VideoDecoderConfig::Matches(const VideoDecoderConfig& config) const {
std::string VideoDecoderConfig::AsHumanReadableString() const {
std::ostringstream s;
- s << "codec: " << codec()
+ s << "codec: " << GetHumanReadableCodecName()
<< " format: " << format()
<< " profile: " << profile()
<< " coded size: [" << coded_size().width()
@@ -129,6 +129,30 @@ std::string VideoDecoderConfig::AsHumanReadableString() const {
return s.str();
}
+// The names come from src/third_party/ffmpeg/libavcodec/codec_desc.c
+std::string VideoDecoderConfig::GetHumanReadableCodecName() const {
+ switch (codec()) {
+ case kUnknownVideoCodec:
+ return "unknown";
+ case kCodecH264:
+ return "h264";
+ case kCodecVC1:
+ return "vc1";
+ case kCodecMPEG2:
+ return "mpeg2video";
+ case kCodecMPEG4:
+ return "mpeg4";
+ case kCodecTheora:
+ return "theora";
+ case kCodecVP8:
+ return "vp8";
+ case kCodecVP9:
+ return "vp9";
+ }
+ NOTREACHED();
+ return "";
+}
+
VideoCodec VideoDecoderConfig::codec() const {
return codec_;
}
« no previous file with comments | « media/base/video_decoder_config.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698