shithub: openh264

Download patch

ref: 8bfeae27a4cbca63014dca4f6f5e49399335ce92
parent: 4fb442a983384c29f7768b6ec0d8464ab5f61769
author: Martin Storsjö <[email protected]>
date: Thu Dec 18 08:20:33 EST 2014

Add a public function for getting the codec version

If the codec library is loaded dynamically, it may be necessary that
the loaded library actually matches the version that was used when
it was built, to avoid issues due to ABI differences. Therefore add
a public function to allow getting the version of the currently
loaded library.

--- a/codec/api/svc/codec_api.h
+++ b/codec/api/svc/codec_api.h
@@ -531,6 +531,11 @@
 */
 void WelsDestroyDecoder (ISVCDecoder* pDecoder);
 
+/** @brief   Get codec version
+ *  @return  The linked codec version
+*/
+OpenH264Version WelsGetCodecVersion ();
+
 #ifdef __cplusplus
 }
 #endif
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -40,6 +40,7 @@
 #include "version.h"
 #include "crt_util_safe_x.h"	// Safe CRT routines like util for cross platforms
 #include "ref_list_mgr_svc.h"
+#include "codec_ver.h"
 
 #include <time.h>
 #include <measure_time.h>
@@ -1257,5 +1258,9 @@
     delete pSVCEncoder;
     pSVCEncoder = NULL;
   }
+}
+
+OpenH264Version WelsGetCodecVersion () {
+  return g_stCodecVersion;
 }
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- a/codec/encoder/plus/src/wels_enc_export.def
+++ b/codec/encoder/plus/src/wels_enc_export.def
@@ -1,3 +1,4 @@
 EXPORTS
     WelsCreateSVCEncoder
-    WelsDestroySVCEncoder
\ No newline at end of file
+    WelsDestroySVCEncoder
+    WelsGetCodecVersion
--- a/openh264.def
+++ b/openh264.def
@@ -3,3 +3,4 @@
 	WelsDestroyDecoder
 	WelsCreateSVCEncoder
 	WelsDestroySVCEncoder
+	WelsGetCodecVersion