Merge pull request #1177 from huili2/version_all

version-generate
This commit is contained in:
ruil2 2014-07-16 10:35:20 +08:00
commit 29bb1df645
8 changed files with 43 additions and 4 deletions

View File

@ -121,7 +121,9 @@ MODULE_INCLUDES += -I$(SRC_PATH)gmp-api
.PHONY: test gtest-bootstrap clean
all: libraries binaries
all: General_ver libraries binaries
General_ver:
sh ./codec/common/generate_version.sh
clean:
ifeq (android,$(OS))

View File

@ -49,6 +49,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
04FE0680196FD8BE0004D7CE /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = version.h; path = ../../../common/inc/version.h; sourceTree = "<group>"; };
4CBC1B80194AC4E100214D9E /* intra_pred_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = intra_pred_aarch64_neon.S; path = arm64/intra_pred_aarch64_neon.S; sourceTree = "<group>"; };
4CE4427918B6FC360017DF25 /* libwelsdec.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libwelsdec.a; sourceTree = BUILT_PRODUCTS_DIR; };
4CE4427C18B6FC360017DF25 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@ -265,6 +266,7 @@
4CE4467C18BC5EAA0017DF25 /* inc */ = {
isa = PBXGroup;
children = (
04FE0680196FD8BE0004D7CE /* version.h */,
9AED66571946A1EB009A3567 /* welsCodecTrace.h */,
4CE4467E18BC5EAA0017DF25 /* welsDecoderExt.h */,
);

View File

@ -64,6 +64,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
04FE0684196FD9370004D7CE /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = version.h; path = ../../../common/inc/version.h; sourceTree = "<group>"; };
4C23BC5F195A77E0003B81FC /* intra_pred_sad_3_opt_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = intra_pred_sad_3_opt_aarch64_neon.S; path = arm64/intra_pred_sad_3_opt_aarch64_neon.S; sourceTree = "<group>"; };
4C34066618C57D0400DFA14A /* intra_pred_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_neon.S; sourceTree = "<group>"; };
4C34066718C57D0400DFA14A /* intra_pred_sad_3_opt_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_sad_3_opt_neon.S; sourceTree = "<group>"; };
@ -347,6 +348,7 @@
4CE446FC18BC605C0017DF25 /* inc */ = {
isa = PBXGroup;
children = (
04FE0684196FD9370004D7CE /* version.h */,
9AED664819469FAF009A3567 /* welsCodecTrace.h */,
4CE446FE18BC605C0017DF25 /* welsEncoderExt.h */,
);

View File

@ -0,0 +1,20 @@
#!/bin/bash
rm -f codec/common/inc/version.h
git rev-list HEAD | sort > config.git-hash
LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
if [ $LOCALVER \> 1 ] ; then
VER="$(git rev-list HEAD -n 1 | cut -c 1-7)"
if git status | grep -q "modified:" ; then
VER="${VER}+M"
fi
GIT_VERSION=$VER
else
GIT_VERSION=
VER="x"
fi
GIT_VERSION='"'$GIT_VERSION'"'
rm -f config.git-hash
cat codec/common/inc/version.h.template | sed "s/\$FULL_VERSION/$GIT_VERSION/g" > codec/common/inc/version.h
echo "Generated codec/common/inc/version.h"

View File

@ -0,0 +1,6 @@
#ifndef VERSION_H
#define VERSION_H
#define VERSION_NUMBER "openh264 default: 1.1"
#endif // VERSION_H

View File

@ -0,0 +1,6 @@
#ifndef VERSION_H
#define VERSION_H
#define VERSION_NUMBER $FULL_VERSION
#endif // VERSION_H

View File

@ -46,6 +46,7 @@
#include "typedefs.h"
#include "mem_align.h"
#include "utils.h"
#include "version.h"
//#include "macros.h"
#include "decoder.h"
@ -211,7 +212,7 @@ void CWelsDecoder::UninitDecoder (void) {
if (NULL == m_pDecContext)
return;
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::uninit_decoder()..");
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::uninit_decoder(), openh264 codec version = %s.", VERSION_NUMBER);
WelsEndDecoder (m_pDecContext);

View File

@ -37,7 +37,7 @@
#include "wels_const.h"
#include "utils.h"
#include "macros.h"
#include "version.h"
#include "crt_util_safe_x.h" // Safe CRT routines like util for cross platforms
#include "ref_list_mgr_svc.h"
@ -174,7 +174,7 @@ void CWelsH264SVCEncoder::InitEncoder (void) {
}
m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::InitEncoder(), openh264 codec version = %s", VERSION_NUMBER);
#ifdef REC_FRAME_COUNT
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
"CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal);