OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 // Return true if underlying plane buffers are of zero size, false if not. | 114 // Return true if underlying plane buffers are of zero size, false if not. |
115 bool IsZeroSize() const; | 115 bool IsZeroSize() const; |
116 | 116 |
117 // Return the underlying buffer. Never nullptr for a properly | 117 // Return the underlying buffer. Never nullptr for a properly |
118 // initialized VideoFrame. | 118 // initialized VideoFrame. |
119 // Creating a new reference breaks the HasOneRef and IsMutable | 119 // Creating a new reference breaks the HasOneRef and IsMutable |
120 // logic. So return a const ref to our reference. | 120 // logic. So return a const ref to our reference. |
121 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& video_frame_buffer() | 121 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& video_frame_buffer() |
122 const; | 122 const; |
123 | 123 |
| 124 // Set the underlying buffer. |
| 125 void set_video_frame_buffer( |
| 126 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer); |
| 127 |
| 128 // Convert native-handle frame to memory-backed I420 frame. Should not be |
| 129 // called on a non-native-handle frame. |
| 130 VideoFrame ConvertNativeToI420Frame() const; |
| 131 |
124 // Return true if the frame is stored in a texture. | 132 // Return true if the frame is stored in a texture. |
125 bool is_texture() { | 133 bool is_texture() { |
126 return video_frame_buffer() && | 134 return video_frame_buffer() && |
127 video_frame_buffer()->native_handle() != nullptr; | 135 video_frame_buffer()->native_handle() != nullptr; |
128 } | 136 } |
129 | 137 |
130 private: | 138 private: |
131 // An opaque reference counted handle that stores the pixel data. | 139 // An opaque reference counted handle that stores the pixel data. |
132 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; | 140 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; |
133 uint32_t timestamp_; | 141 uint32_t timestamp_; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int qp_ = -1; // Quantizer value. | 187 int qp_ = -1; // Quantizer value. |
180 | 188 |
181 // When an application indicates non-zero values here, it is taken as an | 189 // When an application indicates non-zero values here, it is taken as an |
182 // indication that all future frames will be constrained with those limits | 190 // indication that all future frames will be constrained with those limits |
183 // until the application indicates a change again. | 191 // until the application indicates a change again. |
184 PlayoutDelay playout_delay_ = {-1, -1}; | 192 PlayoutDelay playout_delay_ = {-1, -1}; |
185 }; | 193 }; |
186 | 194 |
187 } // namespace webrtc | 195 } // namespace webrtc |
188 #endif // WEBRTC_VIDEO_FRAME_H_ | 196 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |