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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 VideoRotation rotation); | 58 VideoRotation rotation); |
59 | 59 |
60 // Deep copy frame: If required size is bigger than allocated one, new | 60 // Deep copy frame: If required size is bigger than allocated one, new |
61 // buffers of adequate size will be allocated. | 61 // buffers of adequate size will be allocated. |
62 void CopyFrame(const VideoFrame& videoFrame); | 62 void CopyFrame(const VideoFrame& videoFrame); |
63 | 63 |
64 // Creates a shallow copy of |videoFrame|, i.e, the this object will retain a | 64 // Creates a shallow copy of |videoFrame|, i.e, the this object will retain a |
65 // reference to the video buffer also retained by |videoFrame|. | 65 // reference to the video buffer also retained by |videoFrame|. |
66 void ShallowCopy(const VideoFrame& videoFrame); | 66 void ShallowCopy(const VideoFrame& videoFrame); |
67 | 67 |
| 68 // Get pointer to buffer per plane. |
| 69 uint8_t* buffer(PlaneType type); |
| 70 // Overloading with const. |
| 71 const uint8_t* buffer(PlaneType type) const; |
| 72 |
68 // Get allocated size per plane. | 73 // Get allocated size per plane. |
69 int allocated_size(PlaneType type) const; | 74 int allocated_size(PlaneType type) const; |
70 | 75 |
| 76 // Get allocated stride per plane. |
| 77 int stride(PlaneType type) const; |
| 78 |
71 // Get frame width. | 79 // Get frame width. |
72 int width() const; | 80 int width() const; |
73 | 81 |
74 // Get frame height. | 82 // Get frame height. |
75 int height() const; | 83 int height() const; |
76 | 84 |
77 // Set frame timestamp (90kHz). | 85 // Set frame timestamp (90kHz). |
78 void set_timestamp(uint32_t timestamp) { timestamp_ = timestamp; } | 86 void set_timestamp(uint32_t timestamp) { timestamp_ = timestamp; } |
79 | 87 |
80 // Get frame timestamp (90kHz). | 88 // Get frame timestamp (90kHz). |
(...skipping 28 matching lines...) Expand all Loading... |
109 } | 117 } |
110 | 118 |
111 // Get render time in miliseconds. | 119 // Get render time in miliseconds. |
112 int64_t render_time_ms() const { return render_time_ms_; } | 120 int64_t render_time_ms() const { return render_time_ms_; } |
113 | 121 |
114 // Return true if underlying plane buffers are of zero size, false if not. | 122 // Return true if underlying plane buffers are of zero size, false if not. |
115 bool IsZeroSize() const; | 123 bool IsZeroSize() const; |
116 | 124 |
117 // Return the underlying buffer. Never nullptr for a properly | 125 // Return the underlying buffer. Never nullptr for a properly |
118 // initialized VideoFrame. | 126 // initialized VideoFrame. |
119 // Creating a new reference breaks the HasOneRef and IsMutable | 127 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() const; |
120 // logic. So return a const ref to our reference. | |
121 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& video_frame_buffer() | |
122 const; | |
123 | 128 |
124 // Set the underlying buffer. | 129 // Set the underlying buffer. |
125 void set_video_frame_buffer( | 130 void set_video_frame_buffer( |
126 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer); | 131 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer); |
127 | 132 |
128 // Convert native-handle frame to memory-backed I420 frame. Should not be | 133 // Convert native-handle frame to memory-backed I420 frame. Should not be |
129 // called on a non-native-handle frame. | 134 // called on a non-native-handle frame. |
130 VideoFrame ConvertNativeToI420Frame() const; | 135 VideoFrame ConvertNativeToI420Frame() const; |
131 | 136 |
132 private: | 137 private: |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 size_t _length; | 181 size_t _length; |
177 size_t _size; | 182 size_t _size; |
178 VideoRotation rotation_ = kVideoRotation_0; | 183 VideoRotation rotation_ = kVideoRotation_0; |
179 bool _completeFrame = false; | 184 bool _completeFrame = false; |
180 AdaptReason adapt_reason_; | 185 AdaptReason adapt_reason_; |
181 int qp_ = -1; // Quantizer value. | 186 int qp_ = -1; // Quantizer value. |
182 }; | 187 }; |
183 | 188 |
184 } // namespace webrtc | 189 } // namespace webrtc |
185 #endif // WEBRTC_VIDEO_FRAME_H_ | 190 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |