ref: 0dc461541a9885b5cf79b9a3bafb43054ce291a2
parent: 91574afca4d32a80a8f66794d85090fbe65c55eb
parent: 8bfeae27a4cbca63014dca4f6f5e49399335ce92
author: sijchen <[email protected]>
date: Fri Dec 19 04:32:48 EST 2014
Merge pull request #1651 from mstorsjo/improve-version-header Improve version header
--- 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/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -70,7 +70,7 @@
unsigned int uMinor; ///< The minor version number
unsigned int uRevision; ///< The revision number
unsigned int uReserved; ///< The reserved number, it should be 0.
-}Openh264Version;
+} OpenH264Version;
/**
* @brief Decoding status
--- a/codec/api/svc/codec_ver.h
+++ b/codec/api/svc/codec_ver.h
@@ -4,8 +4,8 @@
#include "codec_app_def.h"
-static const Openh264Version g_stCodecVersion = {1,3,0,0};
-static const char* g_strCodecVer = "Openh264 version:1.3.0.0";
+static const OpenH264Version g_stCodecVersion = {1,3,0,0};
+static const char* g_strCodecVer = "OpenH264 version:1.3.0.0";
#define OPENH264_MAJOR (1)
#define OPENH264_MINOR (3)
--- a/codec/build/generate_codec_ver.sh
+++ b/codec/build/generate_codec_ver.sh
@@ -27,12 +27,12 @@
echo "#include \"codec_app_def.h\"" >>codec_ver.h
echo "" >>codec_ver.h
-echo "static const Openh264Version g_stCodecVersion = {$1};"|tr '.' ',' >>codec_ver.h
-echo "static const char* g_strCodecVer = \"Openh264 version:$1\";" >>codec_ver.h
+echo "static const OpenH264Version g_stCodecVersion = {$1};"|tr '.' ',' >>codec_ver.h
+echo "static const char* g_strCodecVer = \"OpenH264 version:$1\";" >>codec_ver.h
#if [ "$2"x = ""x ]; then
-#echo "static const char* g_strCodecBuildNum = \"Openh264 revision:$revision\";" >> codec_ver.h
+#echo "static const char* g_strCodecBuildNum = \"OpenH264 revision:$revision\";" >> codec_ver.h
#else
-#echo "static const char* g_strCodecBuildNum = \"Openh264 build:$2, OpenH264 revision:$revision\";" >> codec_ver.h
+#echo "static const char* g_strCodecBuildNum = \"OpenH264 build:$2, OpenH264 revision:$revision\";" >> codec_ver.h
#fi
echo "" >>codec_ver.h
--- 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