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

Side by Side Diff: media/mp4/mp4_stream_parser.cc

Issue 10823139: Set error on unrecognized top-level BMFF boxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove FourCCs used only for testing Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« media/mp4/box_reader_unittest.cc ('K') | « media/mp4/fourccs.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/mp4/mp4_stream_parser.h" 5 #include "media/mp4/mp4_stream_parser.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 const uint8* buf; 443 const uint8* buf;
444 int size; 444 int size;
445 queue_.PeekAt(mdat_tail_, &buf, &size); 445 queue_.PeekAt(mdat_tail_, &buf, &size);
446 446
447 FourCC type; 447 FourCC type;
448 int box_sz; 448 int box_sz;
449 if (!BoxReader::StartTopLevelBox(buf, size, &type, &box_sz, &err)) 449 if (!BoxReader::StartTopLevelBox(buf, size, &type, &box_sz, &err))
450 break; 450 break;
451 451
452 if (type != FOURCC_MDAT) { 452 if (type != FOURCC_MDAT) {
453 DLOG(WARNING) << "Unexpected type while parsing MDATs: " 453 DLOG(WARNING) << "Unexpected box type while parsing MDATs: "
454 << FourCCToString(type); 454 << FourCCToString(type);
455 } 455 }
456 mdat_tail_ += box_sz; 456 mdat_tail_ += box_sz;
457 } 457 }
458 queue_.Trim(std::min(mdat_tail_, offset)); 458 queue_.Trim(std::min(mdat_tail_, offset));
459 return !err; 459 return !err;
460 } 460 }
461 461
462 void MP4StreamParser::ChangeState(State new_state) { 462 void MP4StreamParser::ChangeState(State new_state) {
463 DVLOG(2) << "Changing state: " << new_state; 463 DVLOG(2) << "Changing state: " << new_state;
464 state_ = new_state; 464 state_ = new_state;
465 } 465 }
466 466
467 } // namespace mp4 467 } // namespace mp4
468 } // namespace media 468 } // namespace media
OLDNEW
« media/mp4/box_reader_unittest.cc ('K') | « media/mp4/fourccs.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698