OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 } | 58 } |
59 | 59 |
60 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh, | 60 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh, |
61 bool apply_rotation) { | 61 bool apply_rotation) { |
62 return Reset(frame->fourcc, frame->width, frame->height, dw, dh, | 62 return Reset(frame->fourcc, frame->width, frame->height, dw, dh, |
63 static_cast<uint8_t*>(frame->data), frame->data_size, | 63 static_cast<uint8_t*>(frame->data), frame->data_size, |
64 frame->time_stamp / rtc::kNumNanosecsPerMicrosec, | 64 frame->time_stamp / rtc::kNumNanosecsPerMicrosec, |
65 frame->rotation, apply_rotation); | 65 frame->rotation, apply_rotation); |
66 } | 66 } |
67 | 67 |
68 bool WebRtcVideoFrame::InitToBlack(int w, int h, | |
69 int64_t time_stamp_ns) { | |
70 InitToEmptyBuffer(w, h, time_stamp_ns); | |
71 return SetToBlack(); | |
72 } | |
73 | |
74 int WebRtcVideoFrame::width() const { | 68 int WebRtcVideoFrame::width() const { |
75 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 69 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
76 } | 70 } |
77 | 71 |
78 int WebRtcVideoFrame::height() const { | 72 int WebRtcVideoFrame::height() const { |
79 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 73 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
80 } | 74 } |
81 | 75 |
82 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& | 76 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
83 WebRtcVideoFrame::video_frame_buffer() const { | 77 WebRtcVideoFrame::video_frame_buffer() const { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 rotated_frame_->video_frame_buffer()->StrideV(), | 213 rotated_frame_->video_frame_buffer()->StrideV(), |
220 orig_width, orig_height, | 214 orig_width, orig_height, |
221 static_cast<libyuv::RotationMode>(rotation())); | 215 static_cast<libyuv::RotationMode>(rotation())); |
222 if (ret == 0) { | 216 if (ret == 0) { |
223 return rotated_frame_.get(); | 217 return rotated_frame_.get(); |
224 } | 218 } |
225 return nullptr; | 219 return nullptr; |
226 } | 220 } |
227 | 221 |
228 } // namespace cricket | 222 } // namespace cricket |
OLD | NEW |