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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 DLOG(ERROR) << "Error while parsing MP4"; | 100 DLOG(ERROR) << "Error while parsing MP4"; |
101 queue_.Reset(); | 101 queue_.Reset(); |
102 moov_.reset(); | 102 moov_.reset(); |
103 ChangeState(kError); | 103 ChangeState(kError); |
104 return false; | 104 return false; |
105 } | 105 } |
106 | 106 |
107 return true; | 107 return true; |
108 } | 108 } |
109 | 109 |
110 void MP4StreamParser::SetTimestampOffset(base::TimeDelta offset) { | |
111 // TODO(someone else): Implement. | |
vrk (LEFT CHROMIUM)
2012/07/18 20:37:01
I could either implement these or set an owner for
| |
112 } | |
113 | |
114 void MP4StreamParser::ClearTimestampOffset() { | |
115 // TODO(someone else): Implement. | |
116 } | |
117 | |
110 bool MP4StreamParser::ParseBox(bool* err) { | 118 bool MP4StreamParser::ParseBox(bool* err) { |
111 const uint8* buf; | 119 const uint8* buf; |
112 int size; | 120 int size; |
113 queue_.Peek(&buf, &size); | 121 queue_.Peek(&buf, &size); |
114 if (!size) return false; | 122 if (!size) return false; |
115 | 123 |
116 scoped_ptr<BoxReader> reader(BoxReader::ReadTopLevelBox(buf, size, err)); | 124 scoped_ptr<BoxReader> reader(BoxReader::ReadTopLevelBox(buf, size, err)); |
117 if (reader.get() == NULL) return false; | 125 if (reader.get() == NULL) return false; |
118 | 126 |
119 if (reader->type() == FOURCC_MOOV) { | 127 if (reader->type() == FOURCC_MOOV) { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 return true; | 372 return true; |
365 } | 373 } |
366 | 374 |
367 void MP4StreamParser::ChangeState(State new_state) { | 375 void MP4StreamParser::ChangeState(State new_state) { |
368 DVLOG(2) << "Changing state: " << new_state; | 376 DVLOG(2) << "Changing state: " << new_state; |
369 state_ = new_state; | 377 state_ = new_state; |
370 } | 378 } |
371 | 379 |
372 } // namespace mp4 | 380 } // namespace mp4 |
373 } // namespace media | 381 } // namespace media |
OLD | NEW |