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

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: less output (+rebase) 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 613e094d7e461c5cc614e3180ecfa5d6d1c06e3e..24f2088d524c8fb94f57417a2ac23d2dd45af777 100644
--- a/media/base/decoder_buffer.cc
+++ b/media/base/decoder_buffer.cc
@@ -4,6 +4,8 @@
#include "media/base/decoder_buffer.h"
+#include "base/strings/string_number_conversions.h"
+
namespace media {
// Allocates a block of memory which is padded for use with the SIMD
@@ -89,13 +91,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_ < 17)
+ s << base::HexEncode(data_.get(), size_);
+ else {
+ s << base::HexEncode(data_.get(), 8) << "..."
+ << base::HexEncode(data_.get() + size_ - 8, 8);
xhwang 2016/01/05 17:29:11 I still don't see a general use case for dumping t
jrummell 2016/01/12 20:00:36 Done.
+ }
+ 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