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

Side by Side Diff: media/formats/mp4/track_run_iterator.h

Issue 447963003: Introduce DecodeTimestamp class to make it easier to distiguish presentation and decode timestamps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
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 #ifndef MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ 5 #ifndef MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_
6 #define MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ 6 #define MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "media/base/media_export.h" 12 #include "media/base/media_export.h"
13 #include "media/base/media_log.h" 13 #include "media/base/media_log.h"
14 #include "media/base/stream_parser_buffer.h"
14 #include "media/formats/mp4/box_definitions.h" 15 #include "media/formats/mp4/box_definitions.h"
15 #include "media/formats/mp4/cenc.h" 16 #include "media/formats/mp4/cenc.h"
16 17
17 namespace media { 18 namespace media {
18 19
19 class DecryptConfig; 20 class DecryptConfig;
20 21
21 namespace mp4 { 22 namespace mp4 {
22 23
23 using base::TimeDelta;
24 base::TimeDelta MEDIA_EXPORT TimeDeltaFromRational(int64 numer, int64 denom); 24 base::TimeDelta MEDIA_EXPORT TimeDeltaFromRational(int64 numer, int64 denom);
25 DecodeTimestamp MEDIA_EXPORT DecodeTimestampFromRational(int64 numer,
26 int64 denom);
25 27
26 struct SampleInfo; 28 struct SampleInfo;
27 struct TrackRunInfo; 29 struct TrackRunInfo;
28 30
29 class MEDIA_EXPORT TrackRunIterator { 31 class MEDIA_EXPORT TrackRunIterator {
30 public: 32 public:
31 // Create a new TrackRunIterator. A reference to |moov| will be retained for 33 // Create a new TrackRunIterator. A reference to |moov| will be retained for
32 // the lifetime of this object. 34 // the lifetime of this object.
33 TrackRunIterator(const Movie* moov, const LogCB& log_cb); 35 TrackRunIterator(const Movie* moov, const LogCB& log_cb);
34 ~TrackRunIterator(); 36 ~TrackRunIterator();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 int aux_info_size() const; 69 int aux_info_size() const;
68 bool is_encrypted() const; 70 bool is_encrypted() const;
69 bool is_audio() const; 71 bool is_audio() const;
70 // Only one is valid, based on the value of is_audio(). 72 // Only one is valid, based on the value of is_audio().
71 const AudioSampleEntry& audio_description() const; 73 const AudioSampleEntry& audio_description() const;
72 const VideoSampleEntry& video_description() const; 74 const VideoSampleEntry& video_description() const;
73 75
74 // Properties of the current sample. Only valid if IsSampleValid(). 76 // Properties of the current sample. Only valid if IsSampleValid().
75 int64 sample_offset() const; 77 int64 sample_offset() const;
76 int sample_size() const; 78 int sample_size() const;
77 TimeDelta dts() const; 79 DecodeTimestamp dts() const;
78 TimeDelta cts() const; 80 base::TimeDelta cts() const;
79 TimeDelta duration() const; 81 base::TimeDelta duration() const;
80 bool is_keyframe() const; 82 bool is_keyframe() const;
81 bool is_random_access_point() const; 83 bool is_random_access_point() const;
82 84
83 // Only call when is_encrypted() is true and AuxInfoNeedsToBeCached() is 85 // Only call when is_encrypted() is true and AuxInfoNeedsToBeCached() is
84 // false. Result is owned by caller. 86 // false. Result is owned by caller.
85 scoped_ptr<DecryptConfig> GetDecryptConfig(); 87 scoped_ptr<DecryptConfig> GetDecryptConfig();
86 88
87 private: 89 private:
88 void ResetRun(); 90 void ResetRun();
89 const TrackEncryption& track_encryption() const; 91 const TrackEncryption& track_encryption() const;
(...skipping 19 matching lines...) Expand all
109 int64 sample_dts_; 111 int64 sample_dts_;
110 int64 sample_offset_; 112 int64 sample_offset_;
111 113
112 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator); 114 DISALLOW_COPY_AND_ASSIGN(TrackRunIterator);
113 }; 115 };
114 116
115 } // namespace mp4 117 } // namespace mp4
116 } // namespace media 118 } // namespace media
117 119
118 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_ 120 #endif // MEDIA_FORMATS_MP4_TRACK_RUN_ITERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698