| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 VideoFrame::VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 39 VideoFrame::VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
| 40 uint32_t timestamp, | 40 uint32_t timestamp, |
| 41 int64_t render_time_ms, | 41 int64_t render_time_ms, |
| 42 VideoRotation rotation) | 42 VideoRotation rotation) |
| 43 : video_frame_buffer_(buffer), | 43 : video_frame_buffer_(buffer), |
| 44 timestamp_(timestamp), | 44 timestamp_(timestamp), |
| 45 ntp_time_ms_(0), | 45 ntp_time_ms_(0), |
| 46 render_time_ms_(render_time_ms), | 46 render_time_ms_(render_time_ms), |
| 47 rotation_(rotation) { | 47 rotation_(rotation) { |
| 48 RTC_DCHECK(buffer); |
| 48 } | 49 } |
| 49 | 50 |
| 50 void VideoFrame::CreateEmptyFrame(int width, | 51 void VideoFrame::CreateEmptyFrame(int width, |
| 51 int height, | 52 int height, |
| 52 int stride_y, | 53 int stride_y, |
| 53 int stride_u, | 54 int stride_u, |
| 54 int stride_v) { | 55 int stride_v) { |
| 55 const int half_width = (width + 1) / 2; | 56 const int half_width = (width + 1) / 2; |
| 56 RTC_DCHECK_GT(width, 0); | 57 RTC_DCHECK_GT(width, 0); |
| 57 RTC_DCHECK_GT(height, 0); | 58 RTC_DCHECK_GT(height, 0); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 return !video_frame_buffer_; | 167 return !video_frame_buffer_; |
| 167 } | 168 } |
| 168 | 169 |
| 169 const rtc::scoped_refptr<VideoFrameBuffer>& VideoFrame::video_frame_buffer() | 170 const rtc::scoped_refptr<VideoFrameBuffer>& VideoFrame::video_frame_buffer() |
| 170 const { | 171 const { |
| 171 return video_frame_buffer_; | 172 return video_frame_buffer_; |
| 172 } | 173 } |
| 173 | 174 |
| 174 void VideoFrame::set_video_frame_buffer( | 175 void VideoFrame::set_video_frame_buffer( |
| 175 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer) { | 176 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer) { |
| 177 RTC_DCHECK(buffer); |
| 176 video_frame_buffer_ = buffer; | 178 video_frame_buffer_ = buffer; |
| 177 } | 179 } |
| 178 | 180 |
| 179 VideoFrame VideoFrame::ConvertNativeToI420Frame() const { | 181 VideoFrame VideoFrame::ConvertNativeToI420Frame() const { |
| 180 RTC_DCHECK(video_frame_buffer_->native_handle()); | 182 RTC_DCHECK(video_frame_buffer_->native_handle()); |
| 181 VideoFrame frame; | 183 VideoFrame frame; |
| 182 frame.ShallowCopy(*this); | 184 frame.ShallowCopy(*this); |
| 183 frame.set_video_frame_buffer(video_frame_buffer_->NativeToI420Buffer()); | 185 frame.set_video_frame_buffer(video_frame_buffer_->NativeToI420Buffer()); |
| 184 return frame; | 186 return frame; |
| 185 } | 187 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 196 case kVideoCodecULPFEC: | 198 case kVideoCodecULPFEC: |
| 197 case kVideoCodecGeneric: | 199 case kVideoCodecGeneric: |
| 198 case kVideoCodecUnknown: | 200 case kVideoCodecUnknown: |
| 199 return 0; | 201 return 0; |
| 200 } | 202 } |
| 201 RTC_NOTREACHED(); | 203 RTC_NOTREACHED(); |
| 202 return 0; | 204 return 0; |
| 203 } | 205 } |
| 204 | 206 |
| 205 } // namespace webrtc | 207 } // namespace webrtc |
| OLD | NEW |