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 |
| 11 #include "webrtc/base/logging.h" |
11 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 12 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
12 #include "webrtc/modules/video_coding/encoded_frame.h" | 13 #include "webrtc/modules/video_coding/encoded_frame.h" |
13 #include "webrtc/modules/video_coding/generic_encoder.h" | 14 #include "webrtc/modules/video_coding/generic_encoder.h" |
14 #include "webrtc/modules/video_coding/jitter_buffer_common.h" | 15 #include "webrtc/modules/video_coding/jitter_buffer_common.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), |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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.num_frames = 1; |
| 204 _codecSpecificInfo.stereoInfo.encoded_images[0] = |
| 205 header->stereoInfo.encoded_images[0]; |
| 206 break; |
| 207 } |
196 default: { | 208 default: { |
| 209 RTC_NOTREACHED(); |
197 _codecSpecificInfo.codecType = kVideoCodecUnknown; | 210 _codecSpecificInfo.codecType = kVideoCodecUnknown; |
198 break; | 211 break; |
199 } | 212 } |
200 } | 213 } |
201 } | 214 } |
202 } | 215 } |
203 | 216 |
204 void VCMEncodedFrame::VerifyAndAllocate(size_t minimumSize) { | 217 void VCMEncodedFrame::VerifyAndAllocate(size_t minimumSize) { |
205 if (minimumSize > _size) { | 218 if (minimumSize > _size) { |
206 // create buffer of sufficient size | 219 // create buffer of sufficient size |
207 uint8_t* newBuffer = new uint8_t[minimumSize]; | 220 uint8_t* newBuffer = new uint8_t[minimumSize]; |
208 if (_buffer) { | 221 if (_buffer) { |
209 // copy old data | 222 // copy old data |
210 memcpy(newBuffer, _buffer, _size); | 223 memcpy(newBuffer, _buffer, _size); |
211 delete[] _buffer; | 224 delete[] _buffer; |
212 } | 225 } |
213 _buffer = newBuffer; | 226 _buffer = newBuffer; |
214 _size = minimumSize; | 227 _size = minimumSize; |
215 } | 228 } |
216 } | 229 } |
217 | 230 |
218 } // namespace webrtc | 231 } // namespace webrtc |
OLD | NEW |