| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 int dh, | 59 int dh, |
| 60 uint8_t* sample, | 60 uint8_t* sample, |
| 61 size_t sample_size, | 61 size_t sample_size, |
| 62 int64_t time_stamp_ns, | 62 int64_t time_stamp_ns, |
| 63 webrtc::VideoRotation rotation) { | 63 webrtc::VideoRotation rotation) { |
| 64 return Reset(format, w, h, dw, dh, sample, sample_size, | 64 return Reset(format, w, h, dw, dh, sample, sample_size, |
| 65 time_stamp_ns / rtc::kNumNanosecsPerMicrosec, rotation, | 65 time_stamp_ns / rtc::kNumNanosecsPerMicrosec, rotation, |
| 66 true /*apply_rotation*/); | 66 true /*apply_rotation*/); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool WebRtcVideoFrame::Init(const CapturedFrame* frame, int dw, int dh, | |
| 70 bool apply_rotation) { | |
| 71 return Reset(frame->fourcc, frame->width, frame->height, dw, dh, | |
| 72 static_cast<uint8_t*>(frame->data), frame->data_size, | |
| 73 frame->time_stamp / rtc::kNumNanosecsPerMicrosec, | |
| 74 frame->rotation, apply_rotation); | |
| 75 } | |
| 76 | |
| 77 int WebRtcVideoFrame::width() const { | 69 int WebRtcVideoFrame::width() const { |
| 78 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 70 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
| 79 } | 71 } |
| 80 | 72 |
| 81 int WebRtcVideoFrame::height() const { | 73 int WebRtcVideoFrame::height() const { |
| 82 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 74 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
| 83 } | 75 } |
| 84 | 76 |
| 85 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& | 77 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
| 86 WebRtcVideoFrame::video_frame_buffer() const { | 78 WebRtcVideoFrame::video_frame_buffer() const { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 timestamp_us_ = timestamp_us; | 152 timestamp_us_ = timestamp_us; |
| 161 return true; | 153 return true; |
| 162 } | 154 } |
| 163 | 155 |
| 164 void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) { | 156 void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) { |
| 165 video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h); | 157 video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h); |
| 166 rotation_ = webrtc::kVideoRotation_0; | 158 rotation_ = webrtc::kVideoRotation_0; |
| 167 } | 159 } |
| 168 | 160 |
| 169 } // namespace cricket | 161 } // namespace cricket |
| OLD | NEW |