Chromium Code Reviews| 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 // Defines a base class for representing timestamped media data. Every buffer | 5 // Defines a base class for representing timestamped media data. Every buffer |
| 6 // contains a timestamp in microseconds describing the relative position of | 6 // contains a timestamp in microseconds describing the relative position of |
| 7 // the buffer within the media stream, and the duration in microseconds for | 7 // the buffer within the media stream, and the duration in microseconds for |
| 8 // the length of time the buffer will be rendered. | 8 // the length of time the buffer will be rendered. |
| 9 // | 9 // |
| 10 // Timestamps are derived directly from the encoded media file and are commonly | 10 // Timestamps are derived directly from the encoded media file and are commonly |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 timestamp_ = timestamp; | 66 timestamp_ = timestamp; |
| 67 } | 67 } |
| 68 | 68 |
| 69 base::TimeDelta GetDuration() const { | 69 base::TimeDelta GetDuration() const { |
| 70 return duration_; | 70 return duration_; |
| 71 } | 71 } |
| 72 void SetDuration(const base::TimeDelta& duration) { | 72 void SetDuration(const base::TimeDelta& duration) { |
| 73 duration_ = duration; | 73 duration_ = duration; |
| 74 } | 74 } |
| 75 | 75 |
| 76 // TODO(vrk): Only ChunkDemuxer and friends care about these methods. | |
| 77 // Put these methods inside a derived class of Buffer? | |
| 78 bool IsKeyframe() const { return is_keyframe_; } | |
| 79 void SetKeyframe(bool is_keyframe) { | |
|
acolwell GONE FROM CHROMIUM
2012/04/26 00:52:34
Could we get away with just providing this info vi
vrk (LEFT CHROMIUM)
2012/04/27 23:19:30
Done, but it's a little icky since I have to add a
| |
| 80 is_keyframe_ = is_keyframe; | |
| 81 } | |
| 82 | |
| 76 protected: | 83 protected: |
| 77 friend class base::RefCountedThreadSafe<Buffer>; | 84 friend class base::RefCountedThreadSafe<Buffer>; |
| 78 Buffer(base::TimeDelta timestamp, base::TimeDelta duration); | 85 Buffer(base::TimeDelta timestamp, base::TimeDelta duration); |
| 79 virtual ~Buffer(); | 86 virtual ~Buffer(); |
| 80 | 87 |
| 81 private: | 88 private: |
| 82 base::TimeDelta timestamp_; | 89 base::TimeDelta timestamp_; |
| 83 base::TimeDelta duration_; | 90 base::TimeDelta duration_; |
| 91 bool is_keyframe_; | |
| 84 | 92 |
| 85 DISALLOW_COPY_AND_ASSIGN(Buffer); | 93 DISALLOW_COPY_AND_ASSIGN(Buffer); |
| 86 }; | 94 }; |
| 87 | 95 |
| 88 } // namespace media | 96 } // namespace media |
| 89 | 97 |
| 90 #endif // MEDIA_BASE_BUFFERS_H_ | 98 #endif // MEDIA_BASE_BUFFERS_H_ |
| OLD | NEW |