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

Side by Side Diff: media/formats/mp4/box_reader.cc

Issue 2966493005: Turn MediaLog usage from plain wrong into questionable (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « media/formats/mp4/box_reader.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/formats/mp4/box_reader.h" 5 #include "media/formats/mp4/box_reader.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 *err = true; 150 *err = true;
151 return false; 151 return false;
152 } 152 }
153 *type = reader.type(); 153 *type = reader.type();
154 *box_size = reader.box_size(); 154 *box_size = reader.box_size();
155 return true; 155 return true;
156 } 156 }
157 157
158 // static 158 // static
159 BoxReader* BoxReader::ReadConcatentatedBoxes(const uint8_t* buf, 159 BoxReader* BoxReader::ReadConcatentatedBoxes(const uint8_t* buf,
160 const size_t buf_size) { 160 const size_t buf_size,
161 // TODO(wolenetz): Questionable MediaLog usage, http://crbug.com/712310 161 MediaLog* media_log) {
162 MediaLog media_log; 162 BoxReader* reader = new BoxReader(buf, buf_size, media_log, true);
163 BoxReader* reader = new BoxReader(buf, buf_size, &media_log, true);
164 163
165 // Concatenated boxes are passed in without a wrapping parent box. Set 164 // Concatenated boxes are passed in without a wrapping parent box. Set
166 // |box_size_| to the concatenated buffer length to mimic having already 165 // |box_size_| to the concatenated buffer length to mimic having already
167 // parsed the parent box. 166 // parsed the parent box.
168 reader->box_size_ = buf_size; 167 reader->box_size_ = buf_size;
169 reader->box_size_known_ = true; 168 reader->box_size_known_ = true;
170 169
171 return reader; 170 return reader;
172 } 171 }
173 172
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 297
299 // Note that the pos_ head has advanced to the byte immediately after the 298 // Note that the pos_ head has advanced to the byte immediately after the
300 // header, which is where we want it. 299 // header, which is where we want it.
301 box_size_ = base::checked_cast<size_t>(box_size); 300 box_size_ = base::checked_cast<size_t>(box_size);
302 box_size_known_ = true; 301 box_size_known_ = true;
303 return true; 302 return true;
304 } 303 }
305 304
306 } // namespace mp4 305 } // namespace mp4
307 } // namespace media 306 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/box_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698