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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
72 } | 72 } |
73 | 73 |
74 int WebRtcVideoFrame::width() const { | 74 int WebRtcVideoFrame::width() const { |
75 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 75 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
76 } | 76 } |
77 | 77 |
78 int WebRtcVideoFrame::height() const { | 78 int WebRtcVideoFrame::height() const { |
79 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 79 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
80 } | 80 } |
81 | 81 |
82 bool WebRtcVideoFrame::IsExclusive() const { | |
83 return video_frame_buffer_->IsMutable(); | |
84 } | |
85 | |
86 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& | 82 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& |
87 WebRtcVideoFrame::video_frame_buffer() const { | 83 WebRtcVideoFrame::video_frame_buffer() const { |
88 return video_frame_buffer_; | 84 return video_frame_buffer_; |
89 } | 85 } |
90 | 86 |
87 VideoFrame* WebRtcVideoFrame::CreateWithBuffer( | |
tommi
2016/05/25 12:14:25
return std::unique_ptr<VideoFrame>?
nisse-webrtc
2016/05/25 12:38:02
That's inconsistent with neighboring methods, but
| |
88 const rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer, | |
89 webrtc::VideoRotation rotation, | |
90 int64_t timestamp_us) const { | |
91 return new WebRtcVideoFrame(buffer, rotation, timestamp_us); | |
92 } | |
93 | |
91 VideoFrame* WebRtcVideoFrame::Copy() const { | 94 VideoFrame* WebRtcVideoFrame::Copy() const { |
92 return new WebRtcVideoFrame(video_frame_buffer_, rotation_, timestamp_us_); | 95 return new WebRtcVideoFrame(video_frame_buffer_, rotation_, timestamp_us_); |
93 } | 96 } |
94 | 97 |
95 size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc, | 98 size_t WebRtcVideoFrame::ConvertToRgbBuffer(uint32_t to_fourcc, |
96 uint8_t* buffer, | 99 uint8_t* buffer, |
97 size_t size, | 100 size_t size, |
98 int stride_rgb) const { | 101 int stride_rgb) const { |
99 RTC_CHECK(video_frame_buffer_); | 102 RTC_CHECK(video_frame_buffer_); |
100 RTC_CHECK(video_frame_buffer_->native_handle() == nullptr); | 103 RTC_CHECK(video_frame_buffer_->native_handle() == nullptr); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 rotated_frame_->video_frame_buffer()->StrideV(), | 226 rotated_frame_->video_frame_buffer()->StrideV(), |
224 orig_width, orig_height, | 227 orig_width, orig_height, |
225 static_cast<libyuv::RotationMode>(rotation())); | 228 static_cast<libyuv::RotationMode>(rotation())); |
226 if (ret == 0) { | 229 if (ret == 0) { |
227 return rotated_frame_.get(); | 230 return rotated_frame_.get(); |
228 } | 231 } |
229 return nullptr; | 232 return nullptr; |
230 } | 233 } |
231 | 234 |
232 } // namespace cricket | 235 } // namespace cricket |
OLD | NEW |