| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |