[FFmpeg-devel] [PATCH 5/5] Add Windows Resource File support for shared libraries

jamal jamrial at gmail.com
Thu Sep 27 09:35:33 CEST 2012


Working only with GNU windres.
The .rc files will be compiled only when building ffmpeg with MinGW/Cygwin and shared libraries enabled
---
 Makefile                       |    3 +-
 common.mak                     |    7 +++++-
 configure                      |   11 ++++++++-
 libavcodec/Makefile            |    3 ++
 libavcodec/avcodecres.rc       |   49 ++++++++++++++++++++++++++++++++++++++++
 libavdevice/Makefile           |    3 ++
 libavdevice/avdeviceres.rc     |   49 ++++++++++++++++++++++++++++++++++++++++
 libavfilter/Makefile           |    3 ++
 libavfilter/avfilterres.rc     |   49 ++++++++++++++++++++++++++++++++++++++++
 libavformat/Makefile           |    3 ++
 libavformat/avformatres.rc     |   49 ++++++++++++++++++++++++++++++++++++++++
 libavutil/Makefile             |    3 ++
 libavutil/avutilres.rc         |   49 ++++++++++++++++++++++++++++++++++++++++
 libpostproc/Makefile           |    3 ++
 libpostproc/postprocessres.rc  |   49 ++++++++++++++++++++++++++++++++++++++++
 library.mak                    |    2 +-
 libswresample/Makefile         |    3 ++
 libswresample/swresampleres.rc |   49 ++++++++++++++++++++++++++++++++++++++++
 libswscale/Makefile            |    3 ++
 libswscale/swscaleres.rc       |   49 ++++++++++++++++++++++++++++++++++++++++
 20 files changed, 435 insertions(+), 4 deletions(-)
 create mode 100644 libavcodec/avcodecres.rc
 create mode 100644 libavdevice/avdeviceres.rc
 create mode 100644 libavfilter/avfilterres.rc
 create mode 100644 libavformat/avformatres.rc
 create mode 100644 libavutil/avutilres.rc
 create mode 100644 libpostproc/postprocessres.rc
 create mode 100644 libswresample/swresampleres.rc
 create mode 100644 libswscale/swscaleres.rc

diff --git a/Makefile b/Makefile
index 53db626..380c334 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ vpath %.cpp  $(SRC_PATH)
 vpath %.h    $(SRC_PATH)
 vpath %.S    $(SRC_PATH)
 vpath %.asm  $(SRC_PATH)
+vpath %.rc   $(SRC_PATH)
 vpath %.v    $(SRC_PATH)
 vpath %.texi $(SRC_PATH)
 vpath %/fate_config.sh.template $(SRC_PATH)
@@ -73,7 +74,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
                MMI-OBJS ALTIVEC-OBJS VIS-OBJS                            \
                MMX-OBJS YASM-OBJS                                        \
                MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
-               OBJS HOSTOBJS TESTOBJS
+               OBJS SLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
 $(1) :=
diff --git a/common.mak b/common.mak
index dd5de7a..ee49f13 100644
--- a/common.mak
+++ b/common.mak
@@ -10,7 +10,7 @@ ifndef SUBDIR
 ifndef V
 Q      = @
 ECHO   = printf "$(1)\t%s\n" $(2)
-BRIEF  = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP
+BRIEF  = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
 SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
 
 MSG    = $@
@@ -56,6 +56,9 @@ COMPILE_S = $(call COMPILE,AS)
 %.o: %.S
 	$(COMPILE_S)
 
+%.o: %.rc
+	$(WINDRES) $(IFLAGS) -o $@ $<
+
 %.h.c:
 	$(Q)echo '#include "$*.h"' >$@
 
@@ -79,6 +82,7 @@ endif
 include $(SRC_PATH)/arch.mak
 
 OBJS      += $(OBJS-yes)
+SLIBOBJS  += $(SLIBOBJS-yes)
 FFLIBS    := $(FFLIBS-yes) $(FFLIBS)
 TESTPROGS += $(TESTPROGS-yes)
 
@@ -87,6 +91,7 @@ FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
 
 EXAMPLES  := $(EXAMPLES:%=$(SUBDIR)%-example$(EXESUF))
 OBJS      := $(sort $(OBJS:%=$(SUBDIR)%))
+SLIBOBJS  := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
 TESTOBJS  := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
 TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
 HOSTOBJS  := $(HOSTPROGS:%=$(SUBDIR)%.o)
diff --git a/configure b/configure
index 8b6969c..62afaf3 100755
--- a/configure
+++ b/configure
@@ -236,6 +236,7 @@ Advanced options (experts only):
   --nm=NM                  use nm tool NM [$nm_default]
   --ar=AR                  use archive tool AR [$ar_default]
   --as=AS                  use assembler AS [$as_default]
+  --windres=WINDRES        use windows resource compiler WINDRES [$windres_default]
   --yasmexe=EXE            use yasm-compatible assembler EXE [$yasmexe_default]
   --cc=CC                  use C compiler CC [$cc_default]
   --cxx=CXX                use C compiler CXX [$cxx_default]
@@ -1303,6 +1304,7 @@ HAVE_LIST="
     gettimeofday
     glob
     gnu_as
+    gnu_windres
     ibm_asm
     inet_aton
     inline_asm
@@ -1490,6 +1492,7 @@ CMDLINE_SET="
     toolchain
     valgrind
     yasmexe
+    windres
 "
 
 CMDLINE_APPEND="
@@ -2025,6 +2028,7 @@ pkg_config_default=pkg-config
 ranlib="ranlib"
 strip_default="strip"
 yasmexe_default="yasm"
+windres_default="windres"
 
 nogas=":"
 
@@ -2310,6 +2314,7 @@ nm_default="${cross_prefix}${nm_default}"
 pkg_config_default="${cross_prefix}${pkg_config_default}"
 ranlib="${cross_prefix}${ranlib}"
 strip_default="${cross_prefix}${strip_default}"
+windres_default="${cross_prefix}${windres_default}"
 
 sysinclude_default="${sysroot}/usr/include"
 
@@ -2664,7 +2669,7 @@ test -n "$cc_type" && enable $cc_type ||
 : ${dep_cc_default:=$cc}
 : ${ld_default:=$cc}
 : ${host_ld_default:=$host_cc}
-set_default ar as dep_cc ld host_ld
+set_default ar as dep_cc ld host_ld windres
 
 probe_cc as "$as"
 asflags_filter=$_flags_filter
@@ -3098,6 +3103,7 @@ case $target_os in
         enable dos_paths
         check_cflags -fno-common
         add_cppflags -U__STRICT_ANSI__
+        enabled shared && check_cmd $windres --version && enable gnu_windres
         ;;
     cygwin*)
         target_os=cygwin
@@ -3114,6 +3120,7 @@ case $target_os in
         enable dos_paths
         check_cflags -fno-common
         add_cppflags -U__STRICT_ANSI__
+        enabled shared && check_cmd $windres --version && enable gnu_windres
         ;;
     *-dos|freedos|opendos)
         network_extralibs="-lsocket"
@@ -4153,6 +4160,7 @@ LD_O=$LD_O
 LD_LIB=$LD_LIB
 LD_PATH=$LD_PATH
 DLLTOOL=$dlltool
+WINDRES=$windres
 LDFLAGS=$LDFLAGS
 LDFLAGS-ffserver=$FFSERVERLDFLAGS
 SHFLAGS=$SHFLAGS
@@ -4256,6 +4264,7 @@ cat > $TMPH <<EOF
 #define av_restrict $_restrict
 #define EXTERN_PREFIX "${extern_prefix}"
 #define EXTERN_ASM ${extern_prefix}
+#define BUILDSUF "$build_suffix"
 #define SLIBSUF "$SLIBSUF"
 #define HAVE_MMX2 HAVE_MMXEXT
 EOF
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 9b86f7c..69d145c 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -754,6 +754,9 @@ OBJS-$(HAVE_OS2THREADS)                += pthread.o frame_thread_encoder.o
 # well.
 OBJS-$(!CONFIG_SMALL)                  += inverse.o
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES)           += avcodecres.o
+
 SKIPHEADERS                            += %_tablegen.h                  \
                                           %_tables.h                    \
                                           aac_tablegen_decl.h           \
diff --git a/libavcodec/avcodecres.rc b/libavcodec/avcodecres.rc
new file mode 100644
index 0000000..9ab88d4
--- /dev/null
+++ b/libavcodec/avcodecres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libavcodec/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO, 0
+PRODUCTVERSION  LIBAVCODEC_VERSION_MAJOR, LIBAVCODEC_VERSION_MINOR, LIBAVCODEC_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg codec library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBAVCODEC_VERSION)
+            VALUE "InternalName",     "libavcodec"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "avcodec" BUILDSUF "-" AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libavcodec"
+            VALUE "ProductVersion",   LIBAVCODEC_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/libavdevice/Makefile b/libavdevice/Makefile
index efffa8b..1cc88a3 100644
--- a/libavdevice/Makefile
+++ b/libavdevice/Makefile
@@ -41,6 +41,9 @@ OBJS-$(CONFIG_X11GRAB_INDEV)             += x11grab.o
 OBJS-$(CONFIG_LIBCDIO_INDEV)             += libcdio.o
 OBJS-$(CONFIG_LIBDC1394_INDEV)           += libdc1394.o
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES)             += avdeviceres.o
+
 SKIPHEADERS-$(CONFIG_DSHOW_INDEV)        += dshow_capture.h
 SKIPHEADERS-$(HAVE_ALSA_ASOUNDLIB_H)     += alsa-audio.h
 SKIPHEADERS-$(HAVE_SNDIO_H)              += sndio_common.h
diff --git a/libavdevice/avdeviceres.rc b/libavdevice/avdeviceres.rc
new file mode 100644
index 0000000..c51a5ab
--- /dev/null
+++ b/libavdevice/avdeviceres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libavdevice/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBAVDEVICE_VERSION_MAJOR, LIBAVDEVICE_VERSION_MINOR, LIBAVDEVICE_VERSION_MICRO, 0
+PRODUCTVERSION  LIBAVDEVICE_VERSION_MAJOR, LIBAVDEVICE_VERSION_MINOR, LIBAVDEVICE_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg device handling library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBAVDEVICE_VERSION)
+            VALUE "InternalName",     "libavdevice"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "avdevice" BUILDSUF "-" AV_STRINGIFY(LIBAVDEVICE_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libavdevice"
+            VALUE "ProductVersion",   LIBAVDEVICE_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 3477eca..d2ba9d0 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -214,6 +214,9 @@ OBJS-$(CONFIG_SHOWWAVES_FILTER)              += avf_showwaves.o
 OBJS-$(CONFIG_AMOVIE_FILTER)                 += src_movie.o
 OBJS-$(CONFIG_MOVIE_FILTER)                  += src_movie.o
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES) += avfilterres.o
+
 TOOLS     = graph2dot
 TESTPROGS = drawutils filtfmts formats
 
diff --git a/libavfilter/avfilterres.rc b/libavfilter/avfilterres.rc
new file mode 100644
index 0000000..2725a43
--- /dev/null
+++ b/libavfilter/avfilterres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libavfilter/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO, 0
+PRODUCTVERSION  LIBAVFILTER_VERSION_MAJOR, LIBAVFILTER_VERSION_MINOR, LIBAVFILTER_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg video filtering library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBAVFILTER_VERSION)
+            VALUE "InternalName",     "libavfilter"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "avfilter" BUILDSUF "-" AV_STRINGIFY(LIBAVFILTER_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libavfilter"
+            VALUE "ProductVersion",   LIBAVFILTER_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 01d750d..9de63eb 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -408,6 +408,9 @@ OBJS-$(CONFIG_TCP_PROTOCOL)              += tcp.o
 OBJS-$(CONFIG_TLS_PROTOCOL)              += tls.o
 OBJS-$(CONFIG_UDP_PROTOCOL)              += udp.o
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES)             += avformatres.o
+
 SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h
 SKIPHEADERS-$(CONFIG_NETWORK)            += network.h rtsp.h
 TESTPROGS = seek
diff --git a/libavformat/avformatres.rc b/libavformat/avformatres.rc
new file mode 100644
index 0000000..5d5c834
--- /dev/null
+++ b/libavformat/avformatres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libavformat/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO, 0
+PRODUCTVERSION  LIBAVFORMAT_VERSION_MAJOR, LIBAVFORMAT_VERSION_MINOR, LIBAVFORMAT_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg container format library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBAVFORMAT_VERSION)
+            VALUE "InternalName",     "libavformat"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "avformat" BUILDSUF "-" AV_STRINGIFY(LIBAVFORMAT_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libavformat"
+            VALUE "ProductVersion",   LIBAVFORMAT_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 18a5a63..a7db813 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -98,6 +98,9 @@ OBJS-$(HAVE_BROKEN_SNPRINTF) += ../compat/msvcrt/snprintf.o
 
 OBJS-$(HAVE_MSVCRT) += ../compat/strtod.o
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o
+
 TESTPROGS = adler32                                                     \
             aes                                                         \
             avstring                                                    \
diff --git a/libavutil/avutilres.rc b/libavutil/avutilres.rc
new file mode 100644
index 0000000..31f277d
--- /dev/null
+++ b/libavutil/avutilres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libavutil/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO, 0
+PRODUCTVERSION  LIBAVUTIL_VERSION_MAJOR, LIBAVUTIL_VERSION_MINOR, LIBAVUTIL_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg utility library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBAVUTIL_VERSION)
+            VALUE "InternalName",     "libavutil"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "avutil" BUILDSUF "-" AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libavutil"
+            VALUE "ProductVersion",   LIBAVUTIL_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/libpostproc/Makefile b/libpostproc/Makefile
index 3fb5a70..386162b 100644
--- a/libpostproc/Makefile
+++ b/libpostproc/Makefile
@@ -7,3 +7,6 @@ HEADERS = postprocess.h        \
           version.h            \
 
 OBJS = postprocess.o
+
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES) += postprocessres.o
diff --git a/libpostproc/postprocessres.rc b/libpostproc/postprocessres.rc
new file mode 100644
index 0000000..9719b21
--- /dev/null
+++ b/libpostproc/postprocessres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libpostproc/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO, 0
+PRODUCTVERSION  LIBPOSTPROC_VERSION_MAJOR, LIBPOSTPROC_VERSION_MINOR, LIBPOSTPROC_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg postprocessing library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBPOSTPROC_VERSION)
+            VALUE "InternalName",     "libpostproc"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "postproc" BUILDSUF "-" AV_STRINGIFY(LIBPOSTPROC_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libpostproc"
+            VALUE "ProductVersion",   LIBPOSTPROC_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/library.mak b/library.mak
index 821fe7e..94438f1 100644
--- a/library.mak
+++ b/library.mak
@@ -40,7 +40,7 @@ $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o
 $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR)
 	$(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME)
 
-$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver
+$(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SLIBOBJS) $(SUBDIR)lib$(NAME).ver
 	$(SLIB_CREATE_DEF_CMD)
 	$$(LD) $(SHFLAGS) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $(FFEXTRALIBS) $(EXTRAOBJS)
 	$(SLIB_EXTRA_CMD)
diff --git a/libswresample/Makefile b/libswresample/Makefile
index d85ed8b..a57a1b3 100644
--- a/libswresample/Makefile
+++ b/libswresample/Makefile
@@ -12,4 +12,7 @@ OBJS = audioconvert.o                        \
        resample.o                            \
        swresample.o                          \
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o
+
 TESTPROGS = swresample
diff --git a/libswresample/swresampleres.rc b/libswresample/swresampleres.rc
new file mode 100644
index 0000000..98e42ca
--- /dev/null
+++ b/libswresample/swresampleres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libswresample/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO, 0
+PRODUCTVERSION  LIBSWRESAMPLE_VERSION_MAJOR, LIBSWRESAMPLE_VERSION_MINOR, LIBSWRESAMPLE_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg audio rescaling library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
+            VALUE "InternalName",     "libswresample"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "swresample" BUILDSUF "-" AV_STRINGIFY(LIBSWRESAMPLE_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libswresample"
+            VALUE "ProductVersion",   LIBSWRESAMPLE_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
diff --git a/libswscale/Makefile b/libswscale/Makefile
index dd00f7d..cc5ecab 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -15,5 +15,8 @@ OBJS = input.o                                          \
        utils.o                                          \
        yuv2rgb.o                                        \
 
+# windows resource file
+SLIBOBJS-$(HAVE_GNU_WINDRES) += swscaleres.o
+
 TESTPROGS = colorspace                                                  \
             swscale                                                     \
diff --git a/libswscale/swscaleres.rc b/libswscale/swscaleres.rc
new file mode 100644
index 0000000..ad88ea6
--- /dev/null
+++ b/libswscale/swscaleres.rc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <windows.h>
+#include "libswscale/version.h"
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION     LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO, 0
+PRODUCTVERSION  LIBSWSCALE_VERSION_MAJOR, LIBSWSCALE_VERSION_MINOR, LIBSWSCALE_VERSION_MICRO, 0
+FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
+FILEOS          VOS_NT_WINDOWS32
+FILETYPE        VFT_DLL
+{
+    BLOCK "StringFileInfo"
+    {
+        BLOCK "040904E4"
+        {
+            VALUE "CompanyName",      "FFmpeg"
+            VALUE "FileDescription",  "FFmpeg image rescaling library"
+            VALUE "FileVersion",      AV_STRINGIFY(LIBSWSCALE_VERSION)
+            VALUE "InternalName",     "libswscale"
+            VALUE "LegalCopyright",   "Copyright (C) 2000-2012 FFmpeg"
+            VALUE "OriginalFilename", "swscale" BUILDSUF "-" AV_STRINGIFY(LIBSWSCALE_VERSION_MAJOR) ".dll"
+            VALUE "ProductName",      "libswscale"
+            VALUE "ProductVersion",   LIBSWSCALE_IDENT
+        }
+    }
+
+    BLOCK "VarFileInfo"
+    {
+        VALUE "Translation", 0x0409, 0x04E4
+    }
+}
-- 
1.7.8.6



More information about the ffmpeg-devel mailing list