Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Side by Side Diff: webrtc/modules/video_coding/main/source/encoded_frame.cc

Issue 1371043003: Unify FrameType and VideoFrameType. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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) 229 } // namespace webrtc
230 {
231 switch(frameType) {
232 case kKeyFrame:
233 return kVideoFrameKey;
234 case kDeltaFrame:
235 return kVideoFrameDelta;
236 }
237 // Bogus default return value.
238 return kVideoFrameDelta;
239 }
240
241 VideoFrameType VCMEncodedFrame::ConvertFrameType(webrtc::FrameType frame_type) {
242 switch (frame_type) {
243 case kVideoFrameKey:
244 return kKeyFrame;
245 case kVideoFrameDelta:
246 return kDeltaFrame;
247 default:
248 assert(false);
249 return kDeltaFrame;
250 }
251 }
252
253 void VCMEncodedFrame::ConvertFrameTypes(
254 const std::vector<webrtc::FrameType>& frame_types,
255 std::vector<VideoFrameType>* video_frame_types) {
256 assert(video_frame_types);
257 video_frame_types->reserve(frame_types.size());
258 for (size_t i = 0; i < frame_types.size(); ++i) {
259 (*video_frame_types)[i] = ConvertFrameType(frame_types[i]);
260 }
261 }
262
263 }
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/main/source/encoded_frame.h ('k') | webrtc/modules/video_coding/main/source/frame_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698