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

Unified Diff: media/formats/webm/webm_content_encodings_client.cc

Issue 1041353002: media-internals: Differentiate error, info, and debug log messages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 5 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
Index: media/formats/webm/webm_content_encodings_client.cc
diff --git a/media/formats/webm/webm_content_encodings_client.cc b/media/formats/webm/webm_content_encodings_client.cc
index f2294de7024b05403a6ab33d056db3997fe73d6a..7265df94f6e65c45ea75e7d9c88d9e2acbae3060 100644
--- a/media/formats/webm/webm_content_encodings_client.cc
+++ b/media/formats/webm/webm_content_encodings_client.cc
@@ -44,7 +44,7 @@ WebMParserClient* WebMContentEncodingsClient::OnListStart(int id) {
if (id == kWebMIdContentEncryption) {
DCHECK(cur_content_encoding_.get());
if (content_encryption_encountered_) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple ContentEncryption.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple ContentEncryption.";
return NULL;
}
content_encryption_encountered_ = true;
@@ -67,7 +67,7 @@ bool WebMContentEncodingsClient::OnListEnd(int id) {
if (id == kWebMIdContentEncodings) {
// ContentEncoding element is mandatory. Check this!
if (content_encodings_.empty()) {
- MEDIA_LOG(log_cb_) << "Missing ContentEncoding.";
+ MEDIA_LOG(ERROR, log_cb_) << "Missing ContentEncoding.";
return false;
}
content_encodings_ready_ = true;
@@ -85,7 +85,7 @@ bool WebMContentEncodingsClient::OnListEnd(int id) {
// Default value of encoding order is 0, which should only be used on the
// first ContentEncoding.
if (!content_encodings_.empty()) {
- MEDIA_LOG(log_cb_) << "Missing ContentEncodingOrder.";
+ MEDIA_LOG(ERROR, log_cb_) << "Missing ContentEncodingOrder.";
return false;
}
cur_content_encoding_->set_order(0);
@@ -99,15 +99,15 @@ bool WebMContentEncodingsClient::OnListEnd(int id) {
// Check for elements valid in spec but not supported for now.
if (cur_content_encoding_->type() == ContentEncoding::kTypeCompression) {
- MEDIA_LOG(log_cb_) << "ContentCompression not supported.";
+ MEDIA_LOG(ERROR, log_cb_) << "ContentCompression not supported.";
return false;
}
// Enforce mandatory elements without default values.
DCHECK(cur_content_encoding_->type() == ContentEncoding::kTypeEncryption);
if (!content_encryption_encountered_) {
- MEDIA_LOG(log_cb_) << "ContentEncodingType is encryption but"
- << " ContentEncryption is missing.";
+ MEDIA_LOG(ERROR, log_cb_) << "ContentEncodingType is encryption but"
+ << " ContentEncryption is missing.";
return false;
}
@@ -146,13 +146,13 @@ bool WebMContentEncodingsClient::OnUInt(int id, int64 val) {
if (id == kWebMIdContentEncodingOrder) {
if (cur_content_encoding_->order() != ContentEncoding::kOrderInvalid) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple ContentEncodingOrder.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple ContentEncodingOrder.";
return false;
}
if (val != static_cast<int64>(content_encodings_.size())) {
// According to the spec, encoding order starts with 0 and counts upwards.
- MEDIA_LOG(log_cb_) << "Unexpected ContentEncodingOrder.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected ContentEncodingOrder.";
return false;
}
@@ -162,18 +162,19 @@ bool WebMContentEncodingsClient::OnUInt(int id, int64 val) {
if (id == kWebMIdContentEncodingScope) {
if (cur_content_encoding_->scope() != ContentEncoding::kScopeInvalid) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple ContentEncodingScope.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple ContentEncodingScope.";
return false;
}
if (val == ContentEncoding::kScopeInvalid ||
val > ContentEncoding::kScopeMax) {
- MEDIA_LOG(log_cb_) << "Unexpected ContentEncodingScope.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected ContentEncodingScope.";
return false;
}
if (val & ContentEncoding::kScopeNextContentEncodingData) {
- MEDIA_LOG(log_cb_) << "Encoded next ContentEncoding is not supported.";
+ MEDIA_LOG(ERROR, log_cb_) << "Encoded next ContentEncoding is not "
+ "supported.";
return false;
}
@@ -183,17 +184,18 @@ bool WebMContentEncodingsClient::OnUInt(int id, int64 val) {
if (id == kWebMIdContentEncodingType) {
if (cur_content_encoding_->type() != ContentEncoding::kTypeInvalid) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple ContentEncodingType.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple ContentEncodingType.";
return false;
}
if (val == ContentEncoding::kTypeCompression) {
- MEDIA_LOG(log_cb_) << "ContentCompression not supported.";
+ MEDIA_LOG(ERROR, log_cb_) << "ContentCompression not supported.";
return false;
}
if (val != ContentEncoding::kTypeEncryption) {
- MEDIA_LOG(log_cb_) << "Unexpected ContentEncodingType " << val << ".";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected ContentEncodingType " << val
+ << ".";
return false;
}
@@ -204,13 +206,13 @@ bool WebMContentEncodingsClient::OnUInt(int id, int64 val) {
if (id == kWebMIdContentEncAlgo) {
if (cur_content_encoding_->encryption_algo() !=
ContentEncoding::kEncAlgoInvalid) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple ContentEncAlgo.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple ContentEncAlgo.";
return false;
}
if (val < ContentEncoding::kEncAlgoNotEncrypted ||
val > ContentEncoding::kEncAlgoAes) {
- MEDIA_LOG(log_cb_) << "Unexpected ContentEncAlgo " << val << ".";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected ContentEncAlgo " << val << ".";
return false;
}
@@ -222,12 +224,13 @@ bool WebMContentEncodingsClient::OnUInt(int id, int64 val) {
if (id == kWebMIdAESSettingsCipherMode) {
if (cur_content_encoding_->cipher_mode() !=
ContentEncoding::kCipherModeInvalid) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple AESSettingsCipherMode.";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple AESSettingsCipherMode.";
return false;
}
if (val != ContentEncoding::kCipherModeCtr) {
- MEDIA_LOG(log_cb_) << "Unexpected AESSettingsCipherMode " << val << ".";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected AESSettingsCipherMode " << val
+ << ".";
return false;
}
@@ -250,7 +253,7 @@ bool WebMContentEncodingsClient::OnBinary(int id, const uint8* data, int size) {
if (id == kWebMIdContentEncKeyID) {
if (!cur_content_encoding_->encryption_key_id().empty()) {
- MEDIA_LOG(log_cb_) << "Unexpected multiple ContentEncKeyID";
+ MEDIA_LOG(ERROR, log_cb_) << "Unexpected multiple ContentEncKeyID";
return false;
}
cur_content_encoding_->SetEncryptionKeyId(data, size);

Powered by Google App Engine
This is Rietveld 408576698