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

Unified Diff: media/formats/mp4/box_reader.cc

Issue 2815303006: Convert MediaLog from being ref counted to owned by WebMediaPlayer. (Closed)
Patch Set: Rebase. Created 3 years, 8 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
« no previous file with comments | « media/formats/mp4/box_reader.h ('k') | media/formats/mp4/box_reader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/box_reader.cc
diff --git a/media/formats/mp4/box_reader.cc b/media/formats/mp4/box_reader.cc
index 863f2a0fbebd8b81e771a88aebf73ee6fb4db834..a6f94c91114548bcb7b840f367613779c6f21db0 100644
--- a/media/formats/mp4/box_reader.cc
+++ b/media/formats/mp4/box_reader.cc
@@ -91,7 +91,7 @@ bool BufferReader::Read4sInto8s(int64_t* v) {
BoxReader::BoxReader(const uint8_t* buf,
const size_t buf_size,
- const scoped_refptr<MediaLog>& media_log,
+ MediaLog* media_log,
bool is_EOS)
: BufferReader(buf, buf_size),
media_log_(media_log),
@@ -117,7 +117,7 @@ BoxReader::~BoxReader() {
// static
BoxReader* BoxReader::ReadTopLevelBox(const uint8_t* buf,
const size_t buf_size,
- const scoped_refptr<MediaLog>& media_log,
+ MediaLog* media_log,
bool* err) {
std::unique_ptr<BoxReader> reader(
new BoxReader(buf, buf_size, media_log, false));
@@ -140,7 +140,7 @@ BoxReader* BoxReader::ReadTopLevelBox(const uint8_t* buf,
// static
bool BoxReader::StartTopLevelBox(const uint8_t* buf,
const size_t buf_size,
- const scoped_refptr<MediaLog>& media_log,
+ MediaLog* media_log,
FourCC* type,
size_t* box_size,
bool* err) {
@@ -158,7 +158,9 @@ bool BoxReader::StartTopLevelBox(const uint8_t* buf,
// static
BoxReader* BoxReader::ReadConcatentatedBoxes(const uint8_t* buf,
const size_t buf_size) {
- BoxReader* reader = new BoxReader(buf, buf_size, new MediaLog(), true);
+ // TODO(wolenetz): Questionable MediaLog usage, http://crbug.com/712310
+ MediaLog media_log;
+ BoxReader* reader = new BoxReader(buf, buf_size, &media_log, true);
// Concatenated boxes are passed in without a wrapping parent box. Set
// |box_size_| to the concatenated buffer length to mimic having already
@@ -170,8 +172,7 @@ BoxReader* BoxReader::ReadConcatentatedBoxes(const uint8_t* buf,
}
// static
-bool BoxReader::IsValidTopLevelBox(const FourCC& type,
- const scoped_refptr<MediaLog>& media_log) {
+bool BoxReader::IsValidTopLevelBox(const FourCC& type, MediaLog* media_log) {
switch (type) {
case FOURCC_FTYP:
case FOURCC_PDIN:
« no previous file with comments | « media/formats/mp4/box_reader.h ('k') | media/formats/mp4/box_reader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698