Instead just duplicate the common fields. These fields had to be duplicated for the C interface compatibility anyway - but this way there is no risk to accidentally introduce an ABI break since there is no need for the layout of SEncParamBase to actually match the start of SEncParamExt.
Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 5 files). Show all
Unified · Split
| @@ -200,7 +200,7 @@ void CWelsH264SVCEncoder::InitEncoder (void) { · 199 unmodified lines | |||
| 200 | /* | 200 | /* |
| 201 | * SVC Encoder Initialization | 201 | * SVC Encoder Initialization |
| 202 | */ | 202 | */ |
| 203 | int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv, const INIT_TYPE iInitType) { | 203 | int CWelsH264SVCEncoder::Initialize (const void* argv, const INIT_TYPE iInitType) { |
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | if ((INIT_TYPE_PARAMETER_BASED != iInitType && INIT_TYPE_PARAMETER_EXT != iInitType)|| NULL == argv) { | 206 | if ((INIT_TYPE_PARAMETER_BASED != iInitType && INIT_TYPE_PARAMETER_EXT != iInitType)|| NULL == argv) { |
| @@ -213,7 +213,7 @@ int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv, const INIT_TYPE · 6 unmodified lines | |||
| 213 | if(iInitType == INIT_TYPE_PARAMETER_BASED) | 213 | if(iInitType == INIT_TYPE_PARAMETER_BASED) |
| 214 | { | 214 | { |
| 215 | // Convert SEncParamBase into WelsSVCParamConfig here.. | 215 | // Convert SEncParamBase into WelsSVCParamConfig here.. |
| 216 | if (sConfig.ParamBaseTranscode (*argv, true)) { | 216 | if (sConfig.ParamBaseTranscode (*(const SEncParamBase*)argv, true)) { |
| 217 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); | 217 | WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), parameter_translation failed.\n"); |
| 218 | Uninitialize(); | 218 | Uninitialize(); |
| 219 | return cmInitParaError; | 219 | return cmInitParaError; |