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

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

Issue 10536014: Implement ISO BMFF support in Media Source. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Don't use std::abs() (breaks on ARM) Created 8 years, 6 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 | « 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/track_run_iterator.h" 5 #include "media/mp4/track_run_iterator.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "media/base/stream_parser_buffer.h" 9 #include "media/base/stream_parser_buffer.h"
10 #include "media/mp4/rcheck.h" 10 #include "media/mp4/rcheck.h"
11 11
12 namespace media { 12 namespace media {
13 namespace mp4 { 13 namespace mp4 {
14 14
15 base::TimeDelta TimeDeltaFromFrac(int64 numer, uint64 denom) { 15 base::TimeDelta TimeDeltaFromFrac(int64 numer, uint64 denom) {
16 DCHECK_LT(std::abs(numer), kint64max / base::Time::kMicrosecondsPerSecond); 16 DCHECK_LT((numer > 0 ? numer : -numer),
17 kint64max / base::Time::kMicrosecondsPerSecond);
17 return base::TimeDelta::FromMicroseconds( 18 return base::TimeDelta::FromMicroseconds(
18 base::Time::kMicrosecondsPerSecond * numer / denom); 19 base::Time::kMicrosecondsPerSecond * numer / denom);
19 } 20 }
20 21
21 static const uint32 kSampleIsDifferenceSampleFlagMask = 0x10000; 22 static const uint32 kSampleIsDifferenceSampleFlagMask = 0x10000;
22 23
23 TrackRunInfo::TrackRunInfo() {} 24 TrackRunInfo::TrackRunInfo() {}
24 TrackRunInfo::~TrackRunInfo() {} 25 TrackRunInfo::~TrackRunInfo() {}
25 26
26 TrackRunIterator::TrackRunIterator() {} 27 TrackRunIterator::TrackRunIterator() {}
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 return sample_itr_->is_keyframe; 254 return sample_itr_->is_keyframe;
254 } 255 }
255 256
256 const FrameCENCInfo& TrackRunIterator::frame_cenc_info() { 257 const FrameCENCInfo& TrackRunIterator::frame_cenc_info() {
257 DCHECK(is_encrypted()); 258 DCHECK(is_encrypted());
258 return frame_cenc_info_; 259 return frame_cenc_info_;
259 } 260 }
260 261
261 } // namespace mp4 262 } // namespace mp4
262 } // namespace media 263 } // 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