shithub: openh264

Download patch

ref: 1075338b9b9c201e5b9a8a73870d68b37de02462
parent: 658d1e36512414d759d3de4fbf5bd8ef9748131e
author: Martin Storsjö <[email protected]>
date: Tue Feb 18 07:59:14 EST 2014

Use the actual struct type instead of a void pointer to the decoder Initialize method

--- a/codec/api/svc/codec_api.h
+++ b/codec/api/svc/codec_api.h
@@ -94,7 +94,7 @@
 
 class ISVCDecoder {
  public:
-  virtual long EXTAPI Initialize (void* pParam) = 0;
+  virtual long EXTAPI Initialize (const SDecodingParam* pParam) = 0;
   virtual long EXTAPI Uninitialize() = 0;
 
   virtual DECODING_STATE EXTAPI DecodeFrame (const unsigned char* pSrc,
@@ -162,7 +162,7 @@
 typedef struct ISVCDecoderVtbl ISVCDecoderVtbl;
 typedef const ISVCDecoderVtbl* ISVCDecoder;
 struct ISVCDecoderVtbl {
-  long (*Initialize) (ISVCDecoder*, void* pParam);
+  long (*Initialize) (ISVCDecoder*, const SDecodingParam* pParam);
   long (*Uninitialize) (ISVCDecoder*);
 
   DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
--- a/codec/decoder/core/inc/decoder.h
+++ b/codec/decoder/core/inc/decoder.h
@@ -52,7 +52,7 @@
 /*!
  * \brief	configure decoder parameters
  */
-int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const void* kpParam);
+int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpParam);
 
 /*!
  *************************************************************************************
--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -350,7 +350,7 @@
 /*!
  * \brief	configure decoder parameters
  */
-int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const void* kpParam) {
+int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpParam) {
   if (NULL == pCtx || NULL == kpParam)
     return 1;
 
--- a/codec/decoder/plus/inc/welsDecoderExt.h
+++ b/codec/decoder/plus/inc/welsDecoderExt.h
@@ -59,7 +59,7 @@
 CWelsDecoder (void);
 virtual ~CWelsDecoder();
 
-virtual long EXTAPI Initialize (void* pParam);
+virtual long EXTAPI Initialize (const SDecodingParam* pParam);
 virtual long EXTAPI Uninitialize();
 
 /***************************************************************************
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -186,7 +186,7 @@
   }
 }
 
-long CWelsDecoder::Initialize (void* pParam) {
+long CWelsDecoder::Initialize (const SDecodingParam* pParam) {
   if (pParam == NULL) {
     IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument.");
     return cmInitParaError;
--- a/test/cpp_interface_test.cpp
+++ b/test/cpp_interface_test.cpp
@@ -70,7 +70,7 @@
 
 struct SVCDecoderImpl : public ISVCDecoder {
   virtual ~SVCDecoderImpl() {}
-  virtual long EXTAPI Initialize(void* pParam) {
+  virtual long EXTAPI Initialize(const SDecodingParam* pParam) {
     EXPECT_TRUE(gThis == this);
     return 1;
   }