Commit b286003c authored by Matt Wolenetz's avatar Matt Wolenetz Committed by Commit Bot

MSE: Improve top-level mp4 box anomaly logging

Reduces confusion between a couple top-level mp4 box log messages:
1) BoxReader::IsValidTopLevelBox() issues a MEDIA_LOG if an unrecognized
   top-level box is found in the path that returns false, and typically
   results in parse error. Since I could find no caller which allows
   this to proceed without parse error, I changed this from a DEBUG to
   an ERROR to give web apps more visibility into the root cause via
   MediaError.message. (Caveat, until bug 1099034 is fixed, the more
   generic "stream parsing failed" error replaces the more specific, new
   parse error added in this change.)
2) Mp4StreamParser::ParseBox() issued a similarly-worded DVLOG if there
   is a top-level box that *is* valid, but is skipped over. This change
   removes the confusing word "unrecognized" from this DVLOG, since the
   box is recognized as valid, but is just not parsed in detail.

TEST=(For #1) Updated BoxReaderTest.WrongFourCCTest
BUG=1096273,1099034

Change-Id: I5525119177343465a8046aaa6dec3f7993a4caec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264510
Auto-Submit: Matthew Wolenetz <wolenetz@chromium.org>
Reviewed-by: default avatarDan Sanders <sandersd@chromium.org>
Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782621}
parent 7db0c69f
......@@ -177,9 +177,9 @@ bool BoxReader::IsValidTopLevelBox(const FourCC& type, MediaLog* media_log) {
case FOURCC_EMSG:
return true;
default:
// Hex is used to show nonprintable characters and aid in debugging
MEDIA_LOG(DEBUG, media_log) << "Unrecognized top-level box type "
<< FourCCToString(type);
// Hex is used to show nonprintable characters and aid in debugging.
MEDIA_LOG(ERROR, media_log)
<< "Invalid top-level ISO BMFF box type " << FourCCToString(type);
return false;
}
}
......
......@@ -213,7 +213,10 @@ TEST_F(BoxReaderTest, WrongFourCCTest) {
buf[6] = 0x4c;
buf[7] = 0x45;
EXPECT_MEDIA_LOG(HasSubstr("Unrecognized top-level box type DALE"));
// Also, tests that the offending FourCC is emitted only in a debug media log.
EXPECT_MEDIA_LOG(
AllOf(HasSubstr("error"),
HasSubstr("Invalid top-level ISO BMFF box type DALE")));
std::unique_ptr<BoxReader> reader;
ParseResult result =
......
......@@ -257,8 +257,7 @@ ParseResult MP4StreamParser::ParseBox() {
} else {
// TODO(wolenetz,chcunningham): Enforce more strict adherence to MSE byte
// stream spec for ftyp and styp. See http://crbug.com/504514.
DVLOG(2) << "Skipping unrecognized top-level box: "
<< FourCCToString(reader->type());
DVLOG(2) << "Skipping top-level box: " << FourCCToString(reader->type());
}
queue_.Pop(reader->box_size());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment