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 keyframes. | |
| 77 // Put keyframe stuff inside a derived class of Buffer? | |
|
acolwell GONE FROM CHROMIUM
2012/04/29 18:13:06
I think you should remove this TODO. ISTM if we re
vrk (LEFT CHROMIUM)
2012/05/01 22:51:13
Done.
| |
| 78 bool IsKeyframe() const { return is_keyframe_; } | |
| 79 | |
| 76 protected: | 80 protected: |
| 77 friend class base::RefCountedThreadSafe<Buffer>; | 81 friend class base::RefCountedThreadSafe<Buffer>; |
| 78 Buffer(base::TimeDelta timestamp, base::TimeDelta duration); | 82 Buffer(base::TimeDelta timestamp, base::TimeDelta duration); |
| 83 Buffer(base::TimeDelta timestamp, base::TimeDelta duration, bool is_keyframe); | |
|
acolwell GONE FROM CHROMIUM
2012/04/29 18:13:06
I think we should be able to get away with just ad
vrk (LEFT CHROMIUM)
2012/05/01 22:51:13
Done, CL here:
https://chromiumcodereview.appspot.
| |
| 79 virtual ~Buffer(); | 84 virtual ~Buffer(); |
| 80 | 85 |
| 81 private: | 86 private: |
| 82 base::TimeDelta timestamp_; | 87 base::TimeDelta timestamp_; |
| 83 base::TimeDelta duration_; | 88 base::TimeDelta duration_; |
| 89 bool is_keyframe_; | |
| 84 | 90 |
| 85 DISALLOW_COPY_AND_ASSIGN(Buffer); | 91 DISALLOW_COPY_AND_ASSIGN(Buffer); |
| 86 }; | 92 }; |
| 87 | 93 |
| 88 } // namespace media | 94 } // namespace media |
| 89 | 95 |
| 90 #endif // MEDIA_BASE_BUFFERS_H_ | 96 #endif // MEDIA_BASE_BUFFERS_H_ |
| OLD | NEW |