Skip to content

Commit

Permalink
Merge pull request #334 from mstorsjo/cleanup-vp-interface
Browse files Browse the repository at this point in the history
Don't use a custom calling convention for the VP library entry points
  • Loading branch information
volvet committed Feb 21, 2014
2 parents e7ed80c + 21e9c83 commit 75f8b41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
9 changes: 2 additions & 7 deletions codec/encoder/core/src/wels_preprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,14 @@
#include "encoder_context.h"
#include "utils.h"

#ifdef NO_DYNAMIC_VP
EResult WELSAPI CreateVpInterface (void** ppCtx, int iVersion);
EResult WELSAPI DestroyVpInterface (void** ppCtx, int iVersion);
#endif

namespace WelsSVCEnc {

#define WelsSafeDelete(p) if(p){ delete (p); (p) = NULL; }


//***** entry API declaration ************************************************************************//
typedef EResult (WELSAPI* pfnCreateVpInterface) (void**, int);
typedef EResult (WELSAPI* pfnDestroyVpInterface) (void*, int);
typedef EResult (* pfnCreateVpInterface) (void**, int);
typedef EResult (* pfnDestroyVpInterface) (void*, int);

int32_t WelsInitScaledPic (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic, CMemoryAlign* pMemoryAlign);
bool JudgeNeedOfScaling (SWelsSvcCodingParam* pParam, Scaled_Picture* pScaledPic);
Expand Down
10 changes: 2 additions & 8 deletions codec/processing/interface/IWelsVP.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@
#ifndef IWELSVP_H_
#define IWELSVP_H_

#ifdef _WIN32
#define WELSAPI __stdcall
#else
#define WELSAPI
#endif

#define WELSVP_MAJOR_VERSION 1
#define WELSVP_MINOR_VERSION 1
#define WELSVP_VERSION ((WELSVP_MAJOR_VERSION << 8) + WELSVP_MINOR_VERSION)
Expand Down Expand Up @@ -276,8 +270,8 @@ class IWelsVP {
#endif

WELSVP_EXTERNC_BEGIN
EResult WELSAPI CreateVpInterface (void** ppCtx, int iVersion /*= WELSVP_INTERFACE_VERION*/);
EResult WELSAPI DestroyVpInterface (void* pCtx , int iVersion /*= WELSVP_INTERFACE_VERION*/);
EResult CreateVpInterface (void** ppCtx, int iVersion /*= WELSVP_INTERFACE_VERION*/);
EResult DestroyVpInterface (void* pCtx , int iVersion /*= WELSVP_INTERFACE_VERION*/);
WELSVP_EXTERNC_END

//////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions codec/processing/src/common/WelsFrameWork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

/* interface API implement */

EResult WELSAPI CreateVpInterface (void** ppCtx, int iVersion) {
EResult CreateVpInterface (void** ppCtx, int iVersion) {
if (iVersion & 0x8000)
return nsWelsVP::CreateSpecificVpInterface ((IWelsVP**)ppCtx);
else if (iVersion & 0x7fff)
Expand All @@ -52,7 +52,7 @@ EResult WELSAPI CreateVpInterface (void** ppCtx, int iVersion) {
return RET_INVALIDPARAM;
}

EResult WELSAPI DestroyVpInterface (void* pCtx, int iVersion) {
EResult DestroyVpInterface (void* pCtx, int iVersion) {
if (iVersion & 0x8000)
return nsWelsVP::DestroySpecificVpInterface ((IWelsVP*)pCtx);
else if (iVersion & 0x7fff)
Expand Down

0 comments on commit 75f8b41

Please sign in to comment.