OLD | NEW |
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 Loading... |
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 |
OLD | NEW |