]> git.sesse.net Git - x264/commitdiff
print svn version number in SEI info and in CLI/VfW.
authorLoren Merritt <pengvado@videolan.org>
Tue, 5 Apr 2005 20:39:47 +0000 (20:39 +0000)
committerLoren Merritt <pengvado@videolan.org>
Tue, 5 Apr 2005 20:39:47 +0000 (20:39 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@185 df754926-b1dd-0310-bc7b-ec298dee348c

Makefile
build/cygwin/Makefile
encoder/set.c
version.sh [new file with mode: 0755]
vfw/config.c
x264.c

index 6a5ce3ee3ff5cd6f80d4b5d387228f1f0fd56d8c..b2a85d5c88e449a237ebfc22833761c185a3d48d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -91,18 +91,21 @@ checkasm: testing/checkasm.c libx264.a
 %.o: %.asm
        $(AS) $(ASFLAGS) -o $@ $<
 
-.depend: $(SRCS) x264.c
+.depend: $(SRCS) x264.c config.h
        rm -f .depend
 # Hacky - because gcc 2.9x doesn't have -MT
        $(foreach SRC, $(SRCS) x264.c, ( echo -n "`dirname $(SRC)`/" && $(CC) $(CFLAGS) $(SRC) -MM -g0 ) 1>> .depend;)
 
+config.h: $(wildcard .svn/entries */.svn/entries)
+       ./version.sh
+
 depend: .depend
 ifneq ($(wildcard .depend),)
 include .depend
 endif
 
 clean:
-       rm -f $(OBJS) $(OBJASM) *.a x264.o .depend x264 TAGS
+       rm -f $(OBJS) $(OBJASM) config.h *.a x264.o .depend x264 TAGS
 
 distclean: clean
 
index 630d2eef2053f45f78225ed947992d01eb2514ee..70d7b8dd6037408f5ac935e785e7a0e4726ef356 100644 (file)
@@ -98,6 +98,12 @@ $(DIR_BUILD):
        @mkdir -p $(DIR_BUILD)/$(@D)
        @$(CC) $(CFLAGS) -c -o $(DIR_BUILD)/$@ $<
 
+encoder/set.c: config.h
+config.h:
+       @echo " C: $@"
+       @cd $(DIR_SRC) && \
+       ./version.sh
+
 libx264.a: $(DIR_BUILD) $(OBJECTS)
        @echo " L: $(@F)"
        @cd $(DIR_BUILD) && \
@@ -118,7 +124,7 @@ checkasm.exe: $(DIR_BUILD) libx264.a $(OBJECTS) testing/checkasm.obj
 
 clean:
        @echo " Cl: Object files and target lib"
-       @$(RM) $(DIR_BUILD)
+       @$(RM) $(DIR_BUILD) $(DIR_SRC)/config.h
 
 install: x264.exe
        install x264.h $(DIR_INSTALL)/include/
index a729238459b1b080bd7805f0f339b43f367ecb27..e9a5e3ca03c4f0997fcec059c64fc576bcb6d3af 100644 (file)
@@ -35,6 +35,7 @@
 #include "x264.h"
 #include "common/bs.h"
 #include "common/set.h"
+#include "config.h"
 
 void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
 {
@@ -403,8 +404,8 @@ void x264_sei_version_write( bs_t *s )
     };
     char version[256];
     int length;
-    sprintf( version, "x264 - core %d - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html",
-             X264_BUILD );
+    sprintf( version, "x264 - core %d%s - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html",
+             X264_BUILD, X264_VERSION );
     length = strlen(version)+1+16;
 
     bs_write( s, 8, 0x5 ); // payload_type = user_data_unregistered
diff --git a/version.sh b/version.sh
new file mode 100755 (executable)
index 0000000..ca88c8d
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh
+VER=`svnversion .`
+if [[ $VER && $VER != exported ]]
+then echo "#define X264_VERSION \" svn-$VER\"" > config.h
+else echo "#define X264_VERSION \"\"" > config.h
+fi
index e6dee61eb67f5d93b1d1666046a3b365512dd843..0e9a8cd09afe3d8aa6ad22e15e207734dd885480 100644 (file)
@@ -31,6 +31,7 @@
  **************************************************************************/
 
 #include "x264vfw.h"
+#include "config.h"
 #include <stdio.h>  /* sprintf */
 #include <commctrl.h>
 
@@ -470,7 +471,7 @@ BOOL CALLBACK callback_about( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam
     case WM_INITDIALOG :
     {
         char temp[1024];
-        sprintf( temp, "Core %d, build %s %s", X264_BUILD, __DATE__, __TIME__ );
+        sprintf( temp, "Core %d%s, build %s %s", X264_BUILD, X264_VERSION, __DATE__, __TIME__ );
         SetDlgItemText( hDlg, IDC_BUILD,  temp );
         break;
     }
diff --git a/x264.c b/x264.c
index 525d494c3d699bbba19afc3aac373d2a359e46c2..1e5d6e5a698f2640c34234cbc45e4d4c0e4b016b 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -43,6 +43,7 @@
 #endif
 
 #include "common/common.h"
+#include "config.h"
 #include "x264.h"
 
 #define DATA_MAX 3000000
@@ -124,8 +125,8 @@ int main( int argc, char **argv )
 static void Help( x264_param_t *defaults )
 {
     fprintf( stderr,
-             "x264 build:%d\n"
-             "Syntax: x264 [options] [-o out.h26l] in.yuv widthxheigh\n"
+             "x264 build:%d%s\n"
+             "Syntax: x264 [options] [-o out.264] in.yuv widthxheigh\n"
              "\n"
              "  -h, --help                  Print this help\n"
              "\n"
@@ -185,7 +186,7 @@ static void Help( x264_param_t *defaults )
              "      --quiet                 Quiet Mode\n"
              "  -v, --verbose               Print stats for each frame\n"
              "\n",
-            X264_BUILD,
+            X264_BUILD, X264_VERSION,
             defaults->i_keyint_max,
             defaults->i_keyint_min,
             defaults->i_scenecut_threshold,