Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 37 VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 37 VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
| 38 webrtc::VideoRotation rotation, | 38 webrtc::VideoRotation rotation, |
| 39 int64_t timestamp_us); | 39 int64_t timestamp_us); |
| 40 | 40 |
| 41 // Preferred constructor. | 41 // Preferred constructor. |
| 42 VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 42 VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
| 43 uint32_t timestamp, | 43 uint32_t timestamp, |
| 44 int64_t render_time_ms, | 44 int64_t render_time_ms, |
| 45 VideoRotation rotation); | 45 VideoRotation rotation); |
| 46 | 46 |
| 47 // Support move and copy. | |
| 48 VideoFrame(const VideoFrame&) = default; | |
| 49 VideoFrame(VideoFrame&&) = default; | |
| 50 VideoFrame& operator=(const VideoFrame&) = default; | |
| 51 VideoFrame& operator=(VideoFrame&&) = default; | |
| 52 | |
| 47 // CreateFrame: Sets the frame's members and buffers. If required size is | 53 // CreateFrame: Sets the frame's members and buffers. If required size is |
| 48 // bigger than allocated one, new buffers of adequate size will be allocated. | 54 // bigger than allocated one, new buffers of adequate size will be allocated. |
| 49 | 55 |
| 50 // TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and | 56 // TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and |
| 51 // webrtc::VideoFrame merge. Instead, create a VideoFrameBuffer and pass to | 57 // webrtc::VideoFrame merge. Instead, create a VideoFrameBuffer and pass to |
| 52 // the constructor. E.g, use I420Buffer::Copy(WrappedI420Buffer(...)). | 58 // the constructor. E.g, use I420Buffer::Copy(WrappedI420Buffer(...)). |
| 53 void CreateFrame(const uint8_t* buffer_y, | 59 void CreateFrame(const uint8_t* buffer_y, |
| 54 const uint8_t* buffer_u, | 60 const uint8_t* buffer_u, |
| 55 const uint8_t* buffer_v, | 61 const uint8_t* buffer_v, |
| 56 int width, | 62 int width, |
| 57 int height, | 63 int height, |
| 58 int stride_y, | 64 int stride_y, |
| 59 int stride_u, | 65 int stride_u, |
| 60 int stride_v, | 66 int stride_v, |
| 61 VideoRotation rotation); | 67 VideoRotation rotation); |
| 62 | 68 |
| 63 // CreateFrame: Sets the frame's members and buffers. If required size is | 69 // CreateFrame: Sets the frame's members and buffers. If required size is |
| 64 // bigger than allocated one, new buffers of adequate size will be allocated. | 70 // bigger than allocated one, new buffers of adequate size will be allocated. |
| 65 // |buffer| must be a packed I420 buffer. | 71 // |buffer| must be a packed I420 buffer. |
| 66 | 72 |
| 67 // TODO(nisse): Deprecated, see above method for advice. | 73 // TODO(nisse): Deprecated, see above method for advice. |
| 68 void CreateFrame(const uint8_t* buffer, | 74 void CreateFrame(const uint8_t* buffer, |
| 69 int width, | 75 int width, |
| 70 int height, | 76 int height, |
| 71 VideoRotation rotation); | 77 VideoRotation rotation); |
| 72 | 78 |
| 73 // Creates a shallow copy of |videoFrame|, i.e, the this object will retain a | 79 // Creates a shallow copy of |videoFrame|, i.e, the this object will retain a |
| 74 // reference to the video buffer also retained by |videoFrame|. | 80 // reference to the video buffer also retained by |videoFrame|. |
| 75 // TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and | 81 // TODO(nisse): Deprecated. Use constructor or assignment instead. |
| 76 // webrtc::VideoFrame merge. Instead, pass video_frame_buffer() and timestamps | 82 // Delete after applications are updated. |
| 77 // to the constructor. | |
| 78 void ShallowCopy(const VideoFrame& videoFrame); | 83 void ShallowCopy(const VideoFrame& videoFrame); |
|
tommi
2016/10/24 10:52:17
video_frame or frame
nisse-chromium (ooo August 14)
2016/10/24 11:01:20
Done.
| |
| 79 | 84 |
| 80 // Get frame width. | 85 // Get frame width. |
| 81 int width() const; | 86 int width() const; |
| 82 | 87 |
| 83 // Get frame height. | 88 // Get frame height. |
| 84 int height() const; | 89 int height() const; |
| 85 | 90 |
| 86 // System monotonic clock, same timebase as rtc::TimeMicros(). | 91 // System monotonic clock, same timebase as rtc::TimeMicros(). |
| 87 int64_t timestamp_us() const { return timestamp_us_; } | 92 int64_t timestamp_us() const { return timestamp_us_; } |
| 88 void set_timestamp_us(int64_t timestamp_us) { | 93 void set_timestamp_us(int64_t timestamp_us) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 int qp_ = -1; // Quantizer value. | 215 int qp_ = -1; // Quantizer value. |
| 211 | 216 |
| 212 // When an application indicates non-zero values here, it is taken as an | 217 // When an application indicates non-zero values here, it is taken as an |
| 213 // indication that all future frames will be constrained with those limits | 218 // indication that all future frames will be constrained with those limits |
| 214 // until the application indicates a change again. | 219 // until the application indicates a change again. |
| 215 PlayoutDelay playout_delay_ = {-1, -1}; | 220 PlayoutDelay playout_delay_ = {-1, -1}; |
| 216 }; | 221 }; |
| 217 | 222 |
| 218 } // namespace webrtc | 223 } // namespace webrtc |
| 219 #endif // WEBRTC_VIDEO_FRAME_H_ | 224 #endif // WEBRTC_VIDEO_FRAME_H_ |
| OLD | NEW |