OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 init_params.iPicHeight = codec_settings_.height; | 221 init_params.iPicHeight = codec_settings_.height; |
222 // |init_params| uses bit/s, |codec_settings_| uses kbit/s. | 222 // |init_params| uses bit/s, |codec_settings_| uses kbit/s. |
223 init_params.iTargetBitrate = codec_settings_.targetBitrate * 1000; | 223 init_params.iTargetBitrate = codec_settings_.targetBitrate * 1000; |
224 init_params.iMaxBitrate = codec_settings_.maxBitrate * 1000; | 224 init_params.iMaxBitrate = codec_settings_.maxBitrate * 1000; |
225 // Rate Control mode | 225 // Rate Control mode |
226 init_params.iRCMode = RC_BITRATE_MODE; | 226 init_params.iRCMode = RC_BITRATE_MODE; |
227 init_params.fMaxFrameRate = static_cast<float>(codec_settings_.maxFramerate); | 227 init_params.fMaxFrameRate = static_cast<float>(codec_settings_.maxFramerate); |
228 | 228 |
229 // The following parameters are extension parameters (they're in SEncParamExt, | 229 // The following parameters are extension parameters (they're in SEncParamExt, |
230 // not in SEncParamBase). | 230 // not in SEncParamBase). |
231 init_params.bEnableFrameSkip = | 231 init_params.bEnableFrameSkip = codec_settings_.H264()->frameDroppingOn; |
232 codec_settings_.codecSpecific.H264.frameDroppingOn; | |
233 // |uiIntraPeriod| - multiple of GOP size | 232 // |uiIntraPeriod| - multiple of GOP size |
234 // |keyFrameInterval| - number of frames | 233 // |keyFrameInterval| - number of frames |
235 init_params.uiIntraPeriod = | 234 init_params.uiIntraPeriod = codec_settings_.H264()->keyFrameInterval; |
236 codec_settings_.codecSpecific.H264.keyFrameInterval; | |
237 init_params.uiMaxNalSize = 0; | 235 init_params.uiMaxNalSize = 0; |
238 // Threading model: use auto. | 236 // Threading model: use auto. |
239 // 0: auto (dynamic imp. internal encoder) | 237 // 0: auto (dynamic imp. internal encoder) |
240 // 1: single thread (default value) | 238 // 1: single thread (default value) |
241 // >1: number of threads | 239 // >1: number of threads |
242 init_params.iMultipleThreadIdc = NumberOfThreads(init_params.iPicWidth, | 240 init_params.iMultipleThreadIdc = NumberOfThreads(init_params.iPicWidth, |
243 init_params.iPicHeight, | 241 init_params.iPicHeight, |
244 number_of_cores); | 242 number_of_cores); |
245 // The base spatial layer 0 is the only one we use. | 243 // The base spatial layer 0 is the only one we use. |
246 init_params.sSpatialLayers[0].iVideoWidth = init_params.iPicWidth; | 244 init_params.sSpatialLayers[0].iVideoWidth = init_params.iPicWidth; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 439 } |
442 | 440 |
443 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { | 441 int32_t H264EncoderImpl::SetPeriodicKeyFrames(bool enable) { |
444 return WEBRTC_VIDEO_CODEC_OK; | 442 return WEBRTC_VIDEO_CODEC_OK; |
445 } | 443 } |
446 | 444 |
447 void H264EncoderImpl::OnDroppedFrame() { | 445 void H264EncoderImpl::OnDroppedFrame() { |
448 } | 446 } |
449 | 447 |
450 } // namespace webrtc | 448 } // namespace webrtc |
OLD | NEW |