Mark the Initialize pointer parameter as const
This makes it clear to the callers that the struct will not be modified by this call.
This commit is contained in:
parent
2438b31323
commit
6d6a63a703
@ -56,7 +56,7 @@ class ISVCEncoder {
|
||||
/*
|
||||
* return: CM_RETURN: 0 - success; otherwise - failed;
|
||||
*/
|
||||
virtual int EXTAPI Initialize (SEncParamBase* pParam, const INIT_TYPE kiInitType = INIT_TYPE_PARAMETER_BASED) = 0;
|
||||
virtual int EXTAPI Initialize (const SEncParamBase* pParam, const INIT_TYPE kiInitType = INIT_TYPE_PARAMETER_BASED) = 0;
|
||||
|
||||
virtual int EXTAPI Uninitialize() = 0;
|
||||
|
||||
@ -140,7 +140,7 @@ typedef struct ISVCEncoderVtbl ISVCEncoderVtbl;
|
||||
typedef const ISVCEncoderVtbl* ISVCEncoder;
|
||||
struct ISVCEncoderVtbl {
|
||||
|
||||
int (*Initialize) (ISVCEncoder*, SEncParamBase* pParam, const INIT_TYPE kiInitType);
|
||||
int (*Initialize) (ISVCEncoder*, const SEncParamBase* pParam, const INIT_TYPE kiInitType);
|
||||
|
||||
int (*Uninitialize) (ISVCEncoder*);
|
||||
|
||||
|
@ -66,7 +66,7 @@ class CWelsH264SVCEncoder : public ISVCEncoder {
|
||||
/*
|
||||
* return: CM_RETURN: 0 - success; otherwise - failed;
|
||||
*/
|
||||
virtual int EXTAPI Initialize (SEncParamBase* argv, const INIT_TYPE init_type);
|
||||
virtual int EXTAPI Initialize (const SEncParamBase* argv, const INIT_TYPE init_type);
|
||||
|
||||
virtual int EXTAPI Uninitialize();
|
||||
|
||||
|
@ -200,7 +200,7 @@ void CWelsH264SVCEncoder::InitEncoder (void) {
|
||||
/*
|
||||
* SVC Encoder Initialization
|
||||
*/
|
||||
int CWelsH264SVCEncoder::Initialize (SEncParamBase* argv, const INIT_TYPE iInitType) {
|
||||
int CWelsH264SVCEncoder::Initialize (const SEncParamBase* argv, const INIT_TYPE iInitType) {
|
||||
|
||||
|
||||
if ((INIT_TYPE_PARAMETER_BASED != iInitType && INIT_TYPE_PARAMETER_EXT != iInitType)|| NULL == argv) {
|
||||
|
@ -22,7 +22,7 @@ static void* gThis;
|
||||
*/
|
||||
struct SVCEncoderImpl : public ISVCEncoder {
|
||||
virtual ~SVCEncoderImpl() {}
|
||||
virtual int EXTAPI Initialize(SEncParamBase* pParam,
|
||||
virtual int EXTAPI Initialize(const SEncParamBase* pParam,
|
||||
const INIT_TYPE kiInitType) {
|
||||
EXPECT_TRUE(gThis == this);
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user