| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void set_render_time_ms(int64_t render_time_ms) { | 118 void set_render_time_ms(int64_t render_time_ms) { |
| 119 render_time_ms_ = render_time_ms; | 119 render_time_ms_ = render_time_ms; |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Get render time in miliseconds. | 122 // Get render time in miliseconds. |
| 123 int64_t render_time_ms() const { return render_time_ms_; } | 123 int64_t render_time_ms() const { return render_time_ms_; } |
| 124 | 124 |
| 125 // Return true if underlying plane buffers are of zero size, false if not. | 125 // Return true if underlying plane buffers are of zero size, false if not. |
| 126 bool IsZeroSize() const; | 126 bool IsZeroSize() const; |
| 127 | 127 |
| 128 // Return the handle of the underlying video frame. This is used when the | 128 // Return the underlying buffer. Never nullptr for a properly |
| 129 // frame is backed by a texture. The object should be destroyed when it is no | 129 // initialized VideoFrame. |
| 130 // longer in use, so the underlying resource can be freed. | |
| 131 void* native_handle() const; | |
| 132 | |
| 133 // Return the underlying buffer. | |
| 134 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const; | 130 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const; |
| 135 | 131 |
| 136 // Set the underlying buffer. | 132 // Set the underlying buffer. |
| 137 void set_video_frame_buffer( | 133 void set_video_frame_buffer( |
| 138 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer); | 134 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer); |
| 139 | 135 |
| 140 // Convert native-handle frame to memory-backed I420 frame. Should not be | 136 // Convert native-handle frame to memory-backed I420 frame. Should not be |
| 141 // called on a non-native-handle frame. | 137 // called on a non-native-handle frame. |
| 142 VideoFrame ConvertNativeToI420Frame() const; | 138 VideoFrame ConvertNativeToI420Frame() const; |
| 143 | 139 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 uint8_t* _buffer; | 182 uint8_t* _buffer; |
| 187 size_t _length; | 183 size_t _length; |
| 188 size_t _size; | 184 size_t _size; |
| 189 bool _completeFrame = false; | 185 bool _completeFrame = false; |
| 190 AdaptReason adapt_reason_; | 186 AdaptReason adapt_reason_; |
| 191 int qp_ = -1; // Quantizer value. | 187 int qp_ = -1; // Quantizer value. |
| 192 }; | 188 }; |
| 193 | 189 |
| 194 } // namespace webrtc | 190 } // namespace webrtc |
| 195 #endif // WEBRTC_VIDEO_FRAME_H_ | 191 #endif // WEBRTC_VIDEO_FRAME_H_ |
| OLD | NEW |