ref: 6d6a63a7039157cb3cf34fb30fc4d5ff4692f427
parent: 2438b313231c43d55e18b54780566dad55914a7b
author: Martin Storsjö <[email protected]>
date: Tue Feb 18 06:53:27 EST 2014
Mark the Initialize pointer parameter as const This makes it clear to the callers that the struct will not be modified by this call.
--- a/codec/api/svc/codec_api.h
+++ b/codec/api/svc/codec_api.h
@@ -56,7 +56,7 @@
/*
* 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 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*);
--- a/codec/encoder/plus/inc/welsEncoderExt.h
+++ b/codec/encoder/plus/inc/welsEncoderExt.h
@@ -66,7 +66,7 @@
/*
* 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();
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -200,7 +200,7 @@
/*
* 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) {
--- a/test/cpp_interface_test.cpp
+++ b/test/cpp_interface_test.cpp
@@ -22,7 +22,7 @@
*/
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;