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
5050 #include "encoder_context.h"
5151 #include "utils.h"
5252
53+#ifdef NO_DYNAMIC_VP
54+EResult WELSAPI CreateVpInterface (void **ppCtx, int iVersion);
55+EResult WELSAPI DestroyVpInterface (void **ppCtx, int iVersion);
56+#endif
5357
5458 namespace WelsSVCEnc {
5559
5660 #define WelsSafeDelete(p) if(p){ delete (p); (p) = NULL; }
5761
62+
5863 //***** entry API declaration ************************************************************************//
5964 typedef EResult (WELSAPI *pfnCreateVpInterface) (void **, int );
6065 typedef EResult (WELSAPI *pfnDestroyVpInterface) (void * , int );
@@ -87,6 +92,8 @@ inline void WelsUpdateSpatialIdxMap(sWelsEncCtx * pEncCtx, int32_t iPos, SPic · 26 unmodified lines
8792 CWelsLib::CWelsLib(void *pEncCtx)
8893 {
8994 m_pInterface[0] = m_pInterface[1] = NULL;
95+
96+#ifndef NO_DYNAMIC_VP
9097 #if defined(WIN32)
9198 const str_t WelsVPLib[] = "welsvp.dll";
9299 HMODULE shModule = LoadLibrary(WelsVPLib);
@@ -111,6 +118,7 @@ CWelsLib::CWelsLib(void *pEncCtx) · 18 unmodified lines
111118 #endif
112119
113120 m_pVpLib = (void *)shModule;
121+#endif
114122 }
115123
116124 CWelsLib::~CWelsLib()
@@ -136,6 +144,7 @@ CWelsLib::~CWelsLib() · 19 unmodified lines
136144 void* CWelsLib::QueryFunction(const str_t *pName)
137145 {
138146 void *pFunc = NULL;
147+
139148 if (m_pVpLib)
140149 {
141150 #if defined(WIN32)
@@ -158,23 +167,34 @@ void* CWelsLib::QueryFunction(const str_t *pName) · 16 unmodified lines
158167
159168 int32_t CWelsLib::CreateIface(void **ppEncCtx)
160169 {
170+#ifndef NO_DYNAMIC_VP
161171 if (m_pVpLib)
162172 {
173+
174+#endif
163175 pfnCreateVpInterface pCreateVpInterface = NULL;
164176 pfnDestroyVpInterface pDestroyVpInterface = NULL;
165177
178+#ifndef NO_DYNAMIC_VP
166179 pCreateVpInterface = (pfnCreateVpInterface) QueryFunction("CreateVpInterface");
167180 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
168186
169187 m_pInterface[0] = (void *)pCreateVpInterface;
170188 m_pInterface[1] = (void *)pDestroyVpInterface;
171189
172190 if (m_pInterface[0] && m_pInterface[1])
173191 pCreateVpInterface(ppEncCtx, WELSVP_INTERFACE_VERION);
192+#ifndef NO_DYNAMIC_VP
174193 }
175194 else
176195 {
177196 }
197+#endif
178198
179199 return ppEncCtx ? 0 : 1;
180200 }

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