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

Unified Diff: media/base/decoder_buffer.cc

Issue 1536783003: Improve logging output for DecoderBuffer and VideoFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | media/base/video_frame.h » ('j') | media/base/video_frame.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decoder_buffer.cc
diff --git a/media/base/decoder_buffer.cc b/media/base/decoder_buffer.cc
index ce02937864ea49f0ff942478ade0127ac4576e58..7b651fca6ad56af15131aa4a04f5201b5fdbd7e8 100644
--- a/media/base/decoder_buffer.cc
+++ b/media/base/decoder_buffer.cc
@@ -4,6 +4,7 @@
#include "media/base/decoder_buffer.h"
+#include "base/strings/string_number_conversions.h"
namespace media {
@@ -92,13 +93,21 @@ std::string DecoderBuffer::AsHumanReadableString() {
std::ostringstream s;
s << "timestamp: " << timestamp_.InMicroseconds()
- << " duration: " << duration_.InMicroseconds()
- << " size: " << size_
- << " side_data_size: " << side_data_size_
+ << " duration: " << duration_.InMicroseconds() << " size: " << size_
+ << " data: ";
+ if (size_ == 0 || !data_)
+ s << "<null>";
+ else if (size_ < 32)
+ s << base::HexEncode(data_.get(), size_);
+ else {
+ s << base::HexEncode(data_.get(), 16) << "..."
+ << base::HexEncode(data_.get() + size_ - 16, 16);
xhwang 2015/12/18 23:07:43 I am not sure whether we want to log this by defau
jrummell 2015/12/22 01:30:43 Reduced the string to just 35 characters, so it wo
+ }
+ s << " side_data_size: " << side_data_size_
<< " is_key_frame: " << is_key_frame_
- << " encrypted: " << (decrypt_config_ != NULL)
- << " discard_padding (ms): (" << discard_padding_.first.InMilliseconds()
- << ", " << discard_padding_.second.InMilliseconds() << ")";
+ << " encrypted: " << (decrypt_config_ != NULL) << " discard_padding (ms): ("
+ << discard_padding_.first.InMilliseconds() << ", "
+ << discard_padding_.second.InMilliseconds() << ")";
if (decrypt_config_)
s << " decrypt:" << (*decrypt_config_);
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | media/base/video_frame.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698