OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BASE_VIDEO_FRAME_H_ | 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ |
6 #define MEDIA_BASE_VIDEO_FRAME_H_ | 6 #define MEDIA_BASE_VIDEO_FRAME_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "media/base/buffers.h" | 9 #include "media/base/buffers.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 int rows(size_t plane) const; | 85 int rows(size_t plane) const; |
86 | 86 |
87 // Returns pointer to the buffer for a given plane. The memory is owned by | 87 // Returns pointer to the buffer for a given plane. The memory is owned by |
88 // VideoFrame object and must not be freed by the caller. | 88 // VideoFrame object and must not be freed by the caller. |
89 uint8* data(size_t plane) const; | 89 uint8* data(size_t plane) const; |
90 | 90 |
91 // Returns the ID of the native texture wrapped by this frame. Only valid to | 91 // Returns the ID of the native texture wrapped by this frame. Only valid to |
92 // call if this is a NATIVE_TEXTURE frame. | 92 // call if this is a NATIVE_TEXTURE frame. |
93 uint32 texture_id() const; | 93 uint32 texture_id() const; |
94 | 94 |
| 95 // Returns the texture target. Only valid for NATIVE_TEXTURE frames. |
| 96 uint32 texture_target() const; |
| 97 |
95 // StreamSample interface. | 98 // StreamSample interface. |
96 virtual bool IsEndOfStream() const OVERRIDE; | 99 virtual bool IsEndOfStream() const OVERRIDE; |
97 | 100 |
98 private: | 101 private: |
99 // Clients must use the static CreateFrame() method to create a new frame. | 102 // Clients must use the static CreateFrame() method to create a new frame. |
100 VideoFrame(Format format, | 103 VideoFrame(Format format, |
101 size_t video_width, | 104 size_t video_width, |
102 size_t video_height, | 105 size_t video_height, |
103 base::TimeDelta timestamp, | 106 base::TimeDelta timestamp, |
104 base::TimeDelta duration); | 107 base::TimeDelta duration); |
(...skipping 17 matching lines...) Expand all Loading... |
122 // Array of strides for each plane, typically greater or equal to the width | 125 // Array of strides for each plane, typically greater or equal to the width |
123 // of the surface divided by the horizontal sampling period. Note that | 126 // of the surface divided by the horizontal sampling period. Note that |
124 // strides can be negative. | 127 // strides can be negative. |
125 int32 strides_[kMaxPlanes]; | 128 int32 strides_[kMaxPlanes]; |
126 | 129 |
127 // Array of data pointers to each plane. | 130 // Array of data pointers to each plane. |
128 uint8* data_[kMaxPlanes]; | 131 uint8* data_[kMaxPlanes]; |
129 | 132 |
130 // Native texture ID, if this is a NATIVE_TEXTURE frame. | 133 // Native texture ID, if this is a NATIVE_TEXTURE frame. |
131 uint32 texture_id_; | 134 uint32 texture_id_; |
| 135 uint32 texture_target_; |
132 base::Closure texture_no_longer_needed_; | 136 base::Closure texture_no_longer_needed_; |
133 | 137 |
134 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 138 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
135 }; | 139 }; |
136 | 140 |
137 } // namespace media | 141 } // namespace media |
138 | 142 |
139 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 143 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |