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

Side by Side Diff: modules/video_coding/encoded_frame.cc

Issue 2951033003: [EXPERIMENTAL] Generic stereo codec with index header sending single frames
Patch Set: Rebase and add external codec support. Created 3 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
11 #include "modules/video_coding/include/video_coding_defines.h"
12 #include "modules/video_coding/encoded_frame.h" 11 #include "modules/video_coding/encoded_frame.h"
13 #include "modules/video_coding/generic_encoder.h" 12 #include "modules/video_coding/generic_encoder.h"
13 #include "modules/video_coding/include/video_coding_defines.h"
14 #include "modules/video_coding/jitter_buffer_common.h" 14 #include "modules/video_coding/jitter_buffer_common.h"
15 #include "rtc_base/logging.h"
15 16
16 namespace webrtc { 17 namespace webrtc {
17 18
18 VCMEncodedFrame::VCMEncodedFrame() 19 VCMEncodedFrame::VCMEncodedFrame()
19 : webrtc::EncodedImage(), 20 : webrtc::EncodedImage(),
20 _renderTimeMs(-1), 21 _renderTimeMs(-1),
21 _payloadType(0), 22 _payloadType(0),
22 _missingFrame(false), 23 _missingFrame(false),
23 _codec(kVideoCodecUnknown), 24 _codec(kVideoCodecUnknown),
24 _rotation_set(false) { 25 _rotation_set(false) {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 187 }
187 _codecSpecificInfo.codecSpecific.VP9.gof.CopyGofInfoVP9( 188 _codecSpecificInfo.codecSpecific.VP9.gof.CopyGofInfoVP9(
188 header->codecHeader.VP9.gof); 189 header->codecHeader.VP9.gof);
189 } 190 }
190 break; 191 break;
191 } 192 }
192 case kRtpVideoH264: { 193 case kRtpVideoH264: {
193 _codecSpecificInfo.codecType = kVideoCodecH264; 194 _codecSpecificInfo.codecType = kVideoCodecH264;
194 break; 195 break;
195 } 196 }
197 case kRtpVideoStereo: {
198 RTPVideoHeader modified_header = *header;
199 modified_header.codec = kRtpVideoVp9;
200 CopyCodecSpecific(&modified_header);
201 _codecSpecificInfo.codecType = kVideoCodecStereo;
202 _codecSpecificInfo.stereoInfo.stereoCodecType = kVideoCodecVP9;
203 _codecSpecificInfo.stereoInfo.frameIndex =
204 header->stereoInfo.frameIndex;
205 _codecSpecificInfo.stereoInfo.frameCount =
206 header->stereoInfo.frameCount;
207 _codecSpecificInfo.stereoInfo.pictureIndex =
208 header->stereoInfo.pictureIndex;
209 break;
210 }
196 default: { 211 default: {
212 RTC_NOTREACHED();
197 _codecSpecificInfo.codecType = kVideoCodecUnknown; 213 _codecSpecificInfo.codecType = kVideoCodecUnknown;
198 break; 214 break;
199 } 215 }
200 } 216 }
201 } 217 }
202 } 218 }
203 219
204 void VCMEncodedFrame::VerifyAndAllocate(size_t minimumSize) { 220 void VCMEncodedFrame::VerifyAndAllocate(size_t minimumSize) {
205 if (minimumSize > _size) { 221 if (minimumSize > _size) {
206 // create buffer of sufficient size 222 // create buffer of sufficient size
207 uint8_t* newBuffer = new uint8_t[minimumSize]; 223 uint8_t* newBuffer = new uint8_t[minimumSize];
208 if (_buffer) { 224 if (_buffer) {
209 // copy old data 225 // copy old data
210 memcpy(newBuffer, _buffer, _size); 226 memcpy(newBuffer, _buffer, _size);
211 delete[] _buffer; 227 delete[] _buffer;
212 } 228 }
213 _buffer = newBuffer; 229 _buffer = newBuffer;
214 _size = minimumSize; 230 _size = minimumSize;
215 } 231 }
216 } 232 }
217 233
218 } // namespace webrtc 234 } // namespace webrtc
OLDNEW
« no previous file with comments | « modules/video_coding/codecs/stereo/stereo_encoder_adapter.cc ('k') | modules/video_coding/frame_buffer2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698