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

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

Issue 27374002: Add support for avc3 codec string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 7 years, 2 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 | « media/mp4/fourccs.h ('k') | media/test/data/bear-1280x720-v_frag-avc3.mp4 » ('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/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/time.h" 10 #include "base/time/time.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 base::TimeDelta()); 261 base::TimeDelta());
262 has_audio_ = true; 262 has_audio_ = true;
263 audio_track_id_ = track->header.track_id; 263 audio_track_id_ = track->header.track_id;
264 } 264 }
265 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) { 265 if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) {
266 RCHECK(!samp_descr.video_entries.empty()); 266 RCHECK(!samp_descr.video_entries.empty());
267 if (desc_idx >= samp_descr.video_entries.size()) 267 if (desc_idx >= samp_descr.video_entries.size())
268 desc_idx = 0; 268 desc_idx = 0;
269 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx]; 269 const VideoSampleEntry& entry = samp_descr.video_entries[desc_idx];
270 270
271 if (!(entry.format == FOURCC_AVC1 || 271 if (!entry.IsFormatValid()) {
272 (entry.format == FOURCC_ENCV &&
273 entry.sinf.format.format == FOURCC_AVC1))) {
274 MEDIA_LOG(log_cb_) << "Unsupported video format 0x" 272 MEDIA_LOG(log_cb_) << "Unsupported video format 0x"
275 << std::hex << entry.format << " in stsd box."; 273 << std::hex << entry.format << " in stsd box.";
276 return false; 274 return false;
277 } 275 }
278 276
279 // TODO(strobe): Recover correct crop box 277 // TODO(strobe): Recover correct crop box
280 gfx::Size coded_size(entry.width, entry.height); 278 gfx::Size coded_size(entry.width, entry.height);
281 gfx::Rect visible_rect(coded_size); 279 gfx::Rect visible_rect(coded_size);
282 gfx::Size natural_size = GetNaturalSize(visible_rect.size(), 280 gfx::Size natural_size = GetNaturalSize(visible_rect.size(),
283 entry.pixel_aspect.h_spacing, 281 entry.pixel_aspect.h_spacing,
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 return !err; 567 return !err;
570 } 568 }
571 569
572 void MP4StreamParser::ChangeState(State new_state) { 570 void MP4StreamParser::ChangeState(State new_state) {
573 DVLOG(2) << "Changing state: " << new_state; 571 DVLOG(2) << "Changing state: " << new_state;
574 state_ = new_state; 572 state_ = new_state;
575 } 573 }
576 574
577 } // namespace mp4 575 } // namespace mp4
578 } // namespace media 576 } // namespace media
OLDNEW
« no previous file with comments | « media/mp4/fourccs.h ('k') | media/test/data/bear-1280x720-v_frag-avc3.mp4 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698