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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 } | 126 } |
127 | 127 |
128 void VideoFrame::ShallowCopy(const VideoFrame& videoFrame) { | 128 void VideoFrame::ShallowCopy(const VideoFrame& videoFrame) { |
129 video_frame_buffer_ = videoFrame.video_frame_buffer(); | 129 video_frame_buffer_ = videoFrame.video_frame_buffer(); |
130 timestamp_rtp_ = videoFrame.timestamp_rtp_; | 130 timestamp_rtp_ = videoFrame.timestamp_rtp_; |
131 ntp_time_ms_ = videoFrame.ntp_time_ms_; | 131 ntp_time_ms_ = videoFrame.ntp_time_ms_; |
132 timestamp_us_ = videoFrame.timestamp_us_; | 132 timestamp_us_ = videoFrame.timestamp_us_; |
133 rotation_ = videoFrame.rotation_; | 133 rotation_ = videoFrame.rotation_; |
134 } | 134 } |
135 | 135 |
136 // TODO(nisse): Delete. Besides test code, only one use, in | |
137 // webrtcvideoengine2.cc:CreateBlackFrame. | |
138 int VideoFrame::allocated_size(PlaneType type) const { | |
139 const int plane_height = (type == kYPlane) ? height() : (height() + 1) / 2; | |
140 int stride; | |
141 switch (type) { | |
142 case kYPlane: | |
143 stride = video_frame_buffer_->StrideY(); | |
144 break; | |
145 case kUPlane: | |
146 stride = video_frame_buffer_->StrideU(); | |
147 break; | |
148 case kVPlane: | |
149 stride = video_frame_buffer_->StrideV(); | |
150 break; | |
151 default: | |
152 RTC_NOTREACHED(); | |
153 return 0; | |
154 } | |
155 return plane_height * stride; | |
156 } | |
157 | |
158 int VideoFrame::width() const { | 136 int VideoFrame::width() const { |
159 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; | 137 return video_frame_buffer_ ? video_frame_buffer_->width() : 0; |
160 } | 138 } |
161 | 139 |
162 int VideoFrame::height() const { | 140 int VideoFrame::height() const { |
163 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; | 141 return video_frame_buffer_ ? video_frame_buffer_->height() : 0; |
164 } | 142 } |
165 | 143 |
166 bool VideoFrame::IsZeroSize() const { | 144 bool VideoFrame::IsZeroSize() const { |
167 return !video_frame_buffer_; | 145 return !video_frame_buffer_; |
(...skipping 16 matching lines...) Expand all Loading... |
184 case kVideoCodecULPFEC: | 162 case kVideoCodecULPFEC: |
185 case kVideoCodecGeneric: | 163 case kVideoCodecGeneric: |
186 case kVideoCodecUnknown: | 164 case kVideoCodecUnknown: |
187 return 0; | 165 return 0; |
188 } | 166 } |
189 RTC_NOTREACHED(); | 167 RTC_NOTREACHED(); |
190 return 0; | 168 return 0; |
191 } | 169 } |
192 | 170 |
193 } // namespace webrtc | 171 } // namespace webrtc |
OLD | NEW |