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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 int dh, | 53 int dh, |
54 uint8_t* sample, | 54 uint8_t* sample, |
55 size_t sample_size, | 55 size_t sample_size, |
56 int64_t time_stamp_ns, | 56 int64_t time_stamp_ns, |
57 webrtc::VideoRotation rotation) { | 57 webrtc::VideoRotation rotation) { |
58 return Reset(format, w, h, dw, dh, sample, sample_size, | 58 return Reset(format, w, h, dw, dh, sample, sample_size, |
59 time_stamp_ns / rtc::kNumNanosecsPerMicrosec, rotation, | 59 time_stamp_ns / rtc::kNumNanosecsPerMicrosec, rotation, |
60 true /*apply_rotation*/); | 60 true /*apply_rotation*/); |
61 } | 61 } |
62 | 62 |
63 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh, | |
64 bool apply_rotation) { | |
65 return Reset(frame->fourcc, frame->width, frame->height, dw, dh, | |
66 static_cast<uint8_t*>(frame->data), frame->data_size, | |
67 frame->time_stamp / rtc::kNumNanosecsPerMicrosec, | |
68 frame->rotation, apply_rotation); | |
69 } | |
70 | |
71 int WebRtcVideoFrame::width() const { | 63 int WebRtcVideoFrame::width() const { |
72 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 64 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
73 } | 65 } |
74 | 66 |
75 int WebRtcVideoFrame::height() const { | 67 int WebRtcVideoFrame::height() const { |
76 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 68 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
77 } | 69 } |
78 | 70 |
79 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& | 71 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
80 WebRtcVideoFrame::video_frame_buffer() const { | 72 WebRtcVideoFrame::video_frame_buffer() const { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 static_cast<libyuv::RotationMode>(rotation())); | 208 static_cast<libyuv::RotationMode>(rotation())); |
217 if (ret == 0) { | 209 if (ret == 0) { |
218 rotated_frame_.reset(new WebRtcVideoFrame( | 210 rotated_frame_.reset(new WebRtcVideoFrame( |
219 buffer, webrtc::kVideoRotation_0, timestamp_us_, transport_frame_id_)); | 211 buffer, webrtc::kVideoRotation_0, timestamp_us_, transport_frame_id_)); |
220 } | 212 } |
221 | 213 |
222 return rotated_frame_.get(); | 214 return rotated_frame_.get(); |
223 } | 215 } |
224 | 216 |
225 } // namespace cricket | 217 } // namespace cricket |
OLD | NEW |