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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 { | 219 { |
220 // copy old data | 220 // copy old data |
221 memcpy(newBuffer, _buffer, _size); | 221 memcpy(newBuffer, _buffer, _size); |
222 delete [] _buffer; | 222 delete [] _buffer; |
223 } | 223 } |
224 _buffer = newBuffer; | 224 _buffer = newBuffer; |
225 _size = minimumSize; | 225 _size = minimumSize; |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 webrtc::FrameType VCMEncodedFrame::ConvertFrameType(VideoFrameType frameType) | |
230 { | |
231 switch(frameType) { | |
232 case kKeyFrame: | |
233 return kVideoFrameKey; | |
234 case kDeltaFrame: | |
235 return kVideoFrameDelta; | |
236 case kSkipFrame: | |
237 return kFrameEmpty; | |
238 default: | |
239 return kVideoFrameDelta; | |
240 } | |
241 } | 229 } |
242 | |
243 VideoFrameType VCMEncodedFrame::ConvertFrameType(webrtc::FrameType frame_type) { | |
244 switch (frame_type) { | |
245 case kVideoFrameKey: | |
246 return kKeyFrame; | |
247 case kVideoFrameDelta: | |
248 return kDeltaFrame; | |
249 default: | |
250 assert(false); | |
251 return kDeltaFrame; | |
252 } | |
253 } | |
254 | |
255 void VCMEncodedFrame::ConvertFrameTypes( | |
256 const std::vector<webrtc::FrameType>& frame_types, | |
257 std::vector<VideoFrameType>* video_frame_types) { | |
258 assert(video_frame_types); | |
259 video_frame_types->reserve(frame_types.size()); | |
260 for (size_t i = 0; i < frame_types.size(); ++i) { | |
261 (*video_frame_types)[i] = ConvertFrameType(frame_types[i]); | |
262 } | |
263 } | |
264 | |
265 } | |
OLD | NEW |