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

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

Issue 10938034: Eliminate box reordering in media::mp4::BoxReader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | media/mp4/box_reader.h » ('j') | 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/box_definitions.h" 5 #include "media/mp4/box_definitions.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "media/mp4/es_descriptor.h" 8 #include "media/mp4/es_descriptor.h"
9 #include "media/mp4/rcheck.h" 9 #include "media/mp4/rcheck.h"
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 return true; 218 return true;
219 } 219 }
220 220
221 SampleDescription::SampleDescription() : type(kInvalid) {} 221 SampleDescription::SampleDescription() : type(kInvalid) {}
222 SampleDescription::~SampleDescription() {} 222 SampleDescription::~SampleDescription() {}
223 FourCC SampleDescription::BoxType() const { return FOURCC_STSD; } 223 FourCC SampleDescription::BoxType() const { return FOURCC_STSD; }
224 224
225 bool SampleDescription::Parse(BoxReader* reader) { 225 bool SampleDescription::Parse(BoxReader* reader) {
226 uint32 count; 226 uint32 count;
227 RCHECK(reader->SkipBytes(4) && 227 RCHECK(reader->SkipBytes(4) &&
228 reader->Read4(&count) && 228 reader->Read4(&count));
229 reader->ScanChildren());
230 video_entries.clear(); 229 video_entries.clear();
231 audio_entries.clear(); 230 audio_entries.clear();
232 231
233 // Note: this value is preset before scanning begins. See comments in the 232 // Note: this value is preset before scanning begins. See comments in the
234 // Parse(Media*) function. 233 // Parse(Media*) function.
235 if (type == kVideo) { 234 if (type == kVideo) {
236 RCHECK(reader->ReadAllChildren(&video_entries)); 235 RCHECK(reader->ReadAllChildren(&video_entries));
237 } else if (type == kAudio) { 236 } else if (type == kAudio) {
238 RCHECK(reader->ReadAllChildren(&audio_entries)); 237 RCHECK(reader->ReadAllChildren(&audio_entries));
239 } 238 }
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 bool MovieFragment::Parse(BoxReader* reader) { 741 bool MovieFragment::Parse(BoxReader* reader) {
743 RCHECK(reader->ScanChildren() && 742 RCHECK(reader->ScanChildren() &&
744 reader->ReadChild(&header) && 743 reader->ReadChild(&header) &&
745 reader->ReadChildren(&tracks) && 744 reader->ReadChildren(&tracks) &&
746 reader->MaybeReadChildren(&pssh)); 745 reader->MaybeReadChildren(&pssh));
747 return true; 746 return true;
748 } 747 }
749 748
750 } // namespace mp4 749 } // namespace mp4
751 } // namespace media 750 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/mp4/box_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698