History

First cut at new build system. Tested on Mac

EKR committed 12 years ago

Commit 2edc2511 parent 59dae5011 files · +614 −22Browse files

Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 11 files). Show all

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+20−0
@@ -50,11 +50,16 @@ · 49 unmodified lines
50#include "encoder_context.h"50#include "encoder_context.h"
51#include "utils.h"51#include "utils.h"
52 52
53#ifdef NO_DYNAMIC_VP
54EResult WELSAPI CreateVpInterface (void **ppCtx, int iVersion);
55EResult WELSAPI DestroyVpInterface (void **ppCtx, int iVersion);
56#endif
53 57
54namespace WelsSVCEnc {58namespace WelsSVCEnc {
55 59
56#define WelsSafeDelete(p) if(p){ delete (p); (p) = NULL; }60#define WelsSafeDelete(p) if(p){ delete (p); (p) = NULL; }
57 61
62
58//***** entry API declaration ************************************************************************//63//***** entry API declaration ************************************************************************//
59typedef EResult (WELSAPI *pfnCreateVpInterface) (void **, int );64typedef EResult (WELSAPI *pfnCreateVpInterface) (void **, int );
60typedef EResult (WELSAPI *pfnDestroyVpInterface) (void * , int );65typedef EResult (WELSAPI *pfnDestroyVpInterface) (void * , int );
@@ -87,6 +92,8 @@ inline void WelsUpdateSpatialIdxMap(sWelsEncCtx * pEncCtx, int32_t iPos, SPic · 26 unmodified lines
87CWelsLib::CWelsLib(void *pEncCtx)92CWelsLib::CWelsLib(void *pEncCtx)
88{93{
89 m_pInterface[0] = m_pInterface[1] = NULL;94 m_pInterface[0] = m_pInterface[1] = NULL;
95
96#ifndef NO_DYNAMIC_VP
90#if defined(WIN32)97#if defined(WIN32)
91 const str_t WelsVPLib[] = "welsvp.dll";98 const str_t WelsVPLib[] = "welsvp.dll";
92 HMODULE shModule = LoadLibrary(WelsVPLib);99 HMODULE shModule = LoadLibrary(WelsVPLib);
@@ -111,6 +118,7 @@ CWelsLib::CWelsLib(void *pEncCtx) · 18 unmodified lines
111#endif118#endif
112 119
113 m_pVpLib = (void *)shModule;120 m_pVpLib = (void *)shModule;
121#endif
114}122}
115 123
116CWelsLib::~CWelsLib()124CWelsLib::~CWelsLib()
@@ -136,6 +144,7 @@ CWelsLib::~CWelsLib() · 19 unmodified lines
136void* CWelsLib::QueryFunction(const str_t *pName)144void* CWelsLib::QueryFunction(const str_t *pName)
137{145{
138 void *pFunc = NULL;146 void *pFunc = NULL;
147
139 if (m_pVpLib)148 if (m_pVpLib)
140 {149 {
141#if defined(WIN32)150#if defined(WIN32)
@@ -158,23 +167,34 @@ void* CWelsLib::QueryFunction(const str_t *pName) · 16 unmodified lines
158 167
159int32_t CWelsLib::CreateIface(void **ppEncCtx)168int32_t CWelsLib::CreateIface(void **ppEncCtx)
160{169{
170#ifndef NO_DYNAMIC_VP
161 if (m_pVpLib)171 if (m_pVpLib)
162 {172 {
173
174#endif
163 pfnCreateVpInterface pCreateVpInterface = NULL;175 pfnCreateVpInterface pCreateVpInterface = NULL;
164 pfnDestroyVpInterface pDestroyVpInterface = NULL;176 pfnDestroyVpInterface pDestroyVpInterface = NULL;
165 177
178#ifndef NO_DYNAMIC_VP
166 pCreateVpInterface = (pfnCreateVpInterface) QueryFunction("CreateVpInterface");179 pCreateVpInterface = (pfnCreateVpInterface) QueryFunction("CreateVpInterface");
167 pDestroyVpInterface = (pfnDestroyVpInterface) QueryFunction("DestroyVpInterface");180 pDestroyVpInterface = (pfnDestroyVpInterface) QueryFunction("DestroyVpInterface");
181#else
182 pCreateVpInterface = CreateVpInterface;
183 // TODO(ekr@rtfm.com): This cast corrects a signature difference... This is a potential real problem
184 pDestroyVpInterface = (pfnDestroyVpInterface)DestroyVpInterface;
185#endif
168 186
169 m_pInterface[0] = (void *)pCreateVpInterface;187 m_pInterface[0] = (void *)pCreateVpInterface;
170 m_pInterface[1] = (void *)pDestroyVpInterface;188 m_pInterface[1] = (void *)pDestroyVpInterface;
171 189
172 if (m_pInterface[0] && m_pInterface[1])190 if (m_pInterface[0] && m_pInterface[1])
173 pCreateVpInterface(ppEncCtx, WELSVP_INTERFACE_VERION);191 pCreateVpInterface(ppEncCtx, WELSVP_INTERFACE_VERION);
192#ifndef NO_DYNAMIC_VP
174 }193 }
175 else194 else
176 {195 {
177 } 196 }
197#endif
178 198
179 return ppEncCtx ? 0 : 1;199 return ppEncCtx ? 0 : 1;
180}200}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t