| 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 |
| 68 int WebRtcVideoFrame::width() const { | 74 int WebRtcVideoFrame::width() const { |
| 69 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 75 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
| 70 } | 76 } |
| 71 | 77 |
| 72 int WebRtcVideoFrame::height() const { | 78 int WebRtcVideoFrame::height() const { |
| 73 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 79 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
| 74 } | 80 } |
| 75 | 81 |
| 76 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& | 82 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
| 77 WebRtcVideoFrame::video_frame_buffer() const { | 83 WebRtcVideoFrame::video_frame_buffer() const { |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 rotated_frame_->video_frame_buffer()->StrideV(), | 219 rotated_frame_->video_frame_buffer()->StrideV(), |
| 214 orig_width, orig_height, | 220 orig_width, orig_height, |
| 215 static_cast<libyuv::RotationMode>(rotation())); | 221 static_cast<libyuv::RotationMode>(rotation())); |
| 216 if (ret == 0) { | 222 if (ret == 0) { |
| 217 return rotated_frame_.get(); | 223 return rotated_frame_.get(); |
| 218 } | 224 } |
| 219 return nullptr; | 225 return nullptr; |
| 220 } | 226 } |
| 221 | 227 |
| 222 } // namespace cricket | 228 } // namespace cricket |
| OLD | NEW |