Add a new public function WelsGetCodecVersionEx

This function doesn't return a struct, but fills in a struct via
a provided pointer.

The ABI of returning a struct is different between MSVC and mingw.

This allows using the same function from mingw, even though the DLL
has been built with MSVC.
This commit is contained in:
Martin Storsjö 2015-01-03 00:18:02 +02:00
parent 47d8a840c0
commit 50dc4757e4
4 changed files with 12 additions and 0 deletions

View File

@ -532,10 +532,16 @@ long WelsCreateDecoder (ISVCDecoder** ppDecoder);
void WelsDestroyDecoder (ISVCDecoder* pDecoder);
/** @brief Get codec version
* Note, this function isn't ABI compatible between MSVC and Mingw.
* @return The linked codec version
*/
OpenH264Version WelsGetCodecVersion ();
/** @brief Get codec version
* @param pVersion struct to fill in with the version
*/
void WelsGetCodecVersionEx (OpenH264Version *pVersion);
#ifdef __cplusplus
}
#endif

View File

@ -1231,4 +1231,8 @@ OpenH264Version WelsGetCodecVersion() {
(void) g_strCodecVer; // Avoid warnings about unused static variables
return g_stCodecVersion;
}
void WelsGetCodecVersionEx (OpenH264Version* pVersion) {
*pVersion = g_stCodecVersion;
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -2,3 +2,4 @@ EXPORTS
WelsCreateSVCEncoder
WelsDestroySVCEncoder
WelsGetCodecVersion
WelsGetCodecVersionEx

View File

@ -4,3 +4,4 @@ EXPORTS
WelsCreateSVCEncoder
WelsDestroySVCEncoder
WelsGetCodecVersion
WelsGetCodecVersionEx