Index: media/mp4/box_reader.h |
diff --git a/media/mp4/box_reader.h b/media/mp4/box_reader.h |
index bcc3200f05ffd06f7c500ae61d7aaaf2dd6e29f3..43f11d56fe6e5f93fe7bf471ecb5dc8b4ade9f5e 100644 |
--- a/media/mp4/box_reader.h |
+++ b/media/mp4/box_reader.h |
@@ -11,6 +11,7 @@ |
#include "base/compiler_specific.h" |
#include "base/logging.h" |
#include "media/base/media_export.h" |
+#include "media/base/media_log.h" |
#include "media/mp4/fourccs.h" |
#include "media/mp4/rcheck.h" |
@@ -78,6 +79,7 @@ class MEDIA_EXPORT BoxReader : public BufferReader { |
// |buf| is retained but not owned, and must outlive the BoxReader instance. |
static BoxReader* ReadTopLevelBox(const uint8* buf, |
const int buf_size, |
+ const LogCB& log_cb, |
bool* err); |
// Read the box header from the current buffer. This function returns true if |
@@ -88,6 +90,7 @@ class MEDIA_EXPORT BoxReader : public BufferReader { |
// |buf| is not retained. |
static bool StartTopLevelBox(const uint8* buf, |
const int buf_size, |
+ const LogCB& log_cb, |
FourCC* type, |
int* box_size, |
bool* err) WARN_UNUSED_RESULT; |
@@ -95,7 +98,8 @@ class MEDIA_EXPORT BoxReader : public BufferReader { |
// Returns true if |type| is recognized to be a top-level box, false |
// otherwise. This returns true for some boxes which we do not parse. |
// Helpful in debugging misaligned appends. |
- static bool IsValidTopLevelBox(const FourCC& type); |
+ static bool IsValidTopLevelBox(const FourCC& type, |
+ const LogCB& log_cb); |
// Scan through all boxes within the current box, starting at the current |
// buffer position. Must be called before any of the *Child functions work. |
@@ -133,7 +137,7 @@ class MEDIA_EXPORT BoxReader : public BufferReader { |
uint32 flags() const { return flags_; } |
private: |
- BoxReader(const uint8* buf, const int size); |
+ BoxReader(const uint8* buf, const int size, const LogCB& log_cb); |
// Must be called immediately after init. If the return is false, this |
// indicates that the box header and its contents were not available in the |
@@ -144,6 +148,7 @@ class MEDIA_EXPORT BoxReader : public BufferReader { |
// true, the error is unrecoverable and the stream should be aborted. |
bool ReadHeader(bool* err); |
+ LogCB log_cb_; |
FourCC type_; |
uint8 version_; |
uint32 flags_; |
@@ -192,7 +197,7 @@ bool BoxReader::ReadAllChildren(std::vector<T>* children) { |
bool err = false; |
while (pos() < size()) { |
- BoxReader child_reader(&buf_[pos_], size_ - pos_); |
+ BoxReader child_reader(&buf_[pos_], size_ - pos_, log_cb_); |
if (!child_reader.ReadHeader(&err)) break; |
T child; |
RCHECK(child.Parse(&child_reader)); |