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

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

Issue 10826056: Allow auxiliary data to come inside the 'moof' atom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 scoped_ptr<BoxReader> reader(BoxReader::ReadTopLevelBox(buf, size, err)); 120 scoped_ptr<BoxReader> reader(BoxReader::ReadTopLevelBox(buf, size, err));
121 if (reader.get() == NULL) return false; 121 if (reader.get() == NULL) return false;
122 122
123 if (reader->type() == FOURCC_MOOV) { 123 if (reader->type() == FOURCC_MOOV) {
124 *err = !ParseMoov(reader.get()); 124 *err = !ParseMoov(reader.get());
125 } else if (reader->type() == FOURCC_MOOF) { 125 } else if (reader->type() == FOURCC_MOOF) {
126 moof_head_ = queue_.head(); 126 moof_head_ = queue_.head();
127 *err = !ParseMoof(reader.get()); 127 *err = !ParseMoof(reader.get());
128 128
129 // Set up first mdat offset for ParseMDATsUntil() 129 // Set up first mdat offset for ReadMDATsUntil().
130 mdat_tail_ = queue_.head() + reader->size(); 130 mdat_tail_ = queue_.head() + reader->size();
131
132 // Return early to avoid evicting 'moof' data from queue. Auxiliary info may
133 // be located anywhere in the file, including inside the 'moof' itself.
134 // (Since 'default-base-is-moof' is mandated, no data references can come
135 // before the head of the 'moof', so keeping this box around is sufficient.)
136 return !(*err);
131 } else { 137 } else {
132 DVLOG(2) << "Skipping unrecognized top-level box: " 138 DVLOG(2) << "Skipping unrecognized top-level box: "
133 << FourCCToString(reader->type()); 139 << FourCCToString(reader->type());
134 } 140 }
135 141
136 queue_.Pop(reader->size()); 142 queue_.Pop(reader->size());
137 return !(*err); 143 return !(*err);
138 } 144 }
139 145
140 146
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 return true; 462 return true;
457 } 463 }
458 464
459 void MP4StreamParser::ChangeState(State new_state) { 465 void MP4StreamParser::ChangeState(State new_state) {
460 DVLOG(2) << "Changing state: " << new_state; 466 DVLOG(2) << "Changing state: " << new_state;
461 state_ = new_state; 467 state_ = new_state;
462 } 468 }
463 469
464 } // namespace mp4 470 } // namespace mp4
465 } // namespace media 471 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698