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

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

Issue 1235793005: Deprecate LogCB in favor of using MediaLog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and attempt to fix Android compilation Created 5 years, 5 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_definitions.h ('k') | media/formats/mp4/box_reader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/box_definitions.cc
diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc
index 72809cfdffdd542a7c97b2563f97bb935bc79779..db4fff3c6ebae997fb7b7d91b91bd240c1bc5c04 100644
--- a/media/formats/mp4/box_definitions.cc
+++ b/media/formats/mp4/box_definitions.cc
@@ -409,16 +409,17 @@ AVCDecoderConfigurationRecord::~AVCDecoderConfigurationRecord() {}
FourCC AVCDecoderConfigurationRecord::BoxType() const { return FOURCC_AVCC; }
bool AVCDecoderConfigurationRecord::Parse(BoxReader* reader) {
- return ParseInternal(reader, reader->log_cb());
+ return ParseInternal(reader, reader->media_log());
}
bool AVCDecoderConfigurationRecord::Parse(const uint8* data, int data_size) {
BufferReader reader(data, data_size);
- return ParseInternal(&reader, LogCB());
+ return ParseInternal(&reader, new MediaLog());
}
-bool AVCDecoderConfigurationRecord::ParseInternal(BufferReader* reader,
- const LogCB& log_cb) {
+bool AVCDecoderConfigurationRecord::ParseInternal(
+ BufferReader* reader,
+ const scoped_refptr<MediaLog>& media_log) {
RCHECK(reader->Read1(&version) && version == 1 &&
reader->Read1(&profile_indication) &&
reader->Read1(&profile_compatibility) &&
@@ -441,11 +442,11 @@ bool AVCDecoderConfigurationRecord::ParseInternal(BufferReader* reader,
reader->ReadVec(&sps_list[i], sps_length));
RCHECK(sps_list[i].size() > 4);
- if (!log_cb.is_null()) {
- MEDIA_LOG(INFO, log_cb) << "Video codec: avc1." << std::hex
- << static_cast<int>(sps_list[i][1])
- << static_cast<int>(sps_list[i][2])
- << static_cast<int>(sps_list[i][3]);
+ if (media_log.get()) {
+ MEDIA_LOG(INFO, media_log) << "Video codec: avc1." << std::hex
+ << static_cast<int>(sps_list[i][1])
+ << static_cast<int>(sps_list[i][2])
+ << static_cast<int>(sps_list[i][3]);
}
}
@@ -538,12 +539,12 @@ bool ElementaryStreamDescriptor::Parse(BoxReader* reader) {
object_type = es_desc.object_type();
if (object_type != 0x40) {
- MEDIA_LOG(INFO, reader->log_cb()) << "Audio codec: mp4a." << std::hex
- << static_cast<int>(object_type);
+ MEDIA_LOG(INFO, reader->media_log()) << "Audio codec: mp4a." << std::hex
+ << static_cast<int>(object_type);
}
if (es_desc.IsAAC(object_type))
- RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->log_cb()));
+ RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->media_log()));
return true;
}
@@ -709,7 +710,7 @@ bool Movie::Parse(BoxReader* reader) {
RCHECK(reader->ScanChildren() && reader->ReadChild(&header) &&
reader->ReadChildren(&tracks));
- RCHECK_MEDIA_LOGGED(reader->ReadChild(&extends), reader->log_cb(),
+ RCHECK_MEDIA_LOGGED(reader->ReadChild(&extends), reader->media_log(),
"Detected unfragmented MP4. Media Source Extensions "
"require ISO BMFF moov to contain mvex to indicate that "
"Movie Fragments are to be expected.");
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/box_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698