[PATCH 0/5] Windows Resource File support
This patchset adds support for Windows Resource files in Windows shared libraries. I thought about doing it for the executables as well, but I'd rather wait until i can get an icon for them. The first four commits add some missing version macros and header dependencies. With this the macros across all libraries will be consistent. This was done because they are needed by the rc files. I implemented this in all libraries except for libavresample. It's not enabled by default and the ffmpeg project isn't maintaining it. Regards jamal (5): avcodec: Add missing include to version.h postproc: Create version.h header swresample: Create version.h header Add missing version macros to libraries Add Windows Resource File support for shared libraries Makefile | 3 +- common.mak | 7 +++++- configure | 15 +++++++++-- libavcodec/Makefile | 3 ++ libavcodec/avcodecres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libavcodec/version.h | 2 + libavdevice/Makefile | 3 ++ libavdevice/avdeviceres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libavdevice/version.h | 2 + libavfilter/Makefile | 3 ++ libavfilter/avfilterres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libavfilter/version.h | 2 + libavformat/Makefile | 3 ++ libavformat/avformatres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libavutil/Makefile | 3 ++ libavutil/avutilres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libpostproc/Makefile | 6 ++++- libpostproc/postprocess.h | 18 +-------------- libpostproc/postprocessres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libpostproc/version.h | 47 ++++++++++++++++++++++++++++++++++++++ library.mak | 2 +- libswresample/Makefile | 6 ++++- libswresample/swresample.h | 8 +----- libswresample/swresampleres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ libswresample/version.h | 45 ++++++++++++++++++++++++++++++++++++ libswscale/Makefile | 3 ++ libswscale/swscaleres.rc | 49 ++++++++++++++++++++++++++++++++++++++++ 27 files changed, 541 insertions(+), 32 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 libpostproc/version.h create mode 100644 libswresample/swresampleres.rc create mode 100644 libswresample/version.h create mode 100644 libswscale/swscaleres.rc -- 1.7.8.6
--- libavcodec/version.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libavcodec/version.h b/libavcodec/version.h index d96086a..d24ef29 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -26,6 +26,8 @@ * Libavcodec version macros. */ +#include "libavutil/avutil.h" + #define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MINOR 59 #define LIBAVCODEC_VERSION_MICRO 100 -- 1.7.8.6
On date Thursday 2012-09-27 04:35:29 -0300, jamal encoded:
--- libavcodec/version.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/version.h b/libavcodec/version.h index d96086a..d24ef29 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -26,6 +26,8 @@ * Libavcodec version macros. */
+#include "libavutil/avutil.h" + #define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MINOR 59 #define LIBAVCODEC_VERSION_MICRO 100
LGTM. -- FFmpeg = Fanciful and Funny Magic Plastic Evil Gem
On Thu, Sep 27, 2012 at 10:25:30AM +0200, Stefano Sabatini wrote:
On date Thursday 2012-09-27 04:35:29 -0300, jamal encoded:
--- libavcodec/version.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/version.h b/libavcodec/version.h index d96086a..d24ef29 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -26,6 +26,8 @@ * Libavcodec version macros. */
+#include "libavutil/avutil.h" + #define LIBAVCODEC_VERSION_MAJOR 54 #define LIBAVCODEC_VERSION_MINOR 59 #define LIBAVCODEC_VERSION_MICRO 100
LGTM.
applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When the tyrant has disposed of foreign enemies by conquest or treaty, and there is nothing more to fear from them, then he is always stirring up some war or other, in order that the people may require a leader. -- Plato
--- configure | 2 +- libpostproc/Makefile | 3 +- libpostproc/postprocess.h | 18 +---------------- libpostproc/version.h | 47 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 libpostproc/version.h diff --git a/configure b/configure index d2d3a66..1737532 100755 --- a/configure +++ b/configure @@ -4233,7 +4233,7 @@ fi eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak } -get_version_old LIBPOSTPROC libpostproc/postprocess.h +get_version_old LIBPOSTPROC libpostproc/version.h get_version_old LIBSWRESAMPLE libswresample/swresample.h get_version libavcodec diff --git a/libpostproc/Makefile b/libpostproc/Makefile index 6242157..3fb5a70 100644 --- a/libpostproc/Makefile +++ b/libpostproc/Makefile @@ -3,6 +3,7 @@ include $(SUBDIR)../config.mak NAME = postproc FFLIBS = avutil -HEADERS = postprocess.h +HEADERS = postprocess.h \ + version.h \ OBJS = postprocess.o diff --git a/libpostproc/postprocess.h b/libpostproc/postprocess.h index c2c5c73..623b3b5 100644 --- a/libpostproc/postprocess.h +++ b/libpostproc/postprocess.h @@ -27,23 +27,7 @@ * external postprocessing API */ -#include "libavutil/avutil.h" - -#ifndef LIBPOSTPROC_VERSION_MAJOR -#define LIBPOSTPROC_VERSION_MAJOR 52 -#define LIBPOSTPROC_VERSION_MINOR 0 -#define LIBPOSTPROC_VERSION_MICRO 100 -#endif - -#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ - LIBPOSTPROC_VERSION_MINOR, \ - LIBPOSTPROC_VERSION_MICRO) -#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ - LIBPOSTPROC_VERSION_MINOR, \ - LIBPOSTPROC_VERSION_MICRO) -#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT - -#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) +#include "libpostproc/version.h" /** * Return the LIBPOSTPROC_VERSION_INT constant. diff --git a/libpostproc/version.h b/libpostproc/version.h new file mode 100644 index 0000000..17443ea --- /dev/null +++ b/libpostproc/version.h @@ -0,0 +1,47 @@ +/* + * Version macros. + * + * 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 + */ + +#ifndef POSTPROC_POSTPROCESS_VERSION_H +#define POSTPROC_POSTPROCESS_VERSION_H + +/** + * @file + * Libpostproc version macros + */ + +#include "libavutil/avutil.h" + +#ifndef LIBPOSTPROC_VERSION_MAJOR +#define LIBPOSTPROC_VERSION_MAJOR 52 +#define LIBPOSTPROC_VERSION_MINOR 0 +#define LIBPOSTPROC_VERSION_MICRO 100 +#endif + +#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT + +#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) + +#endif /* POSTPROC_POSTPROCESS_VERSION_H */ -- 1.7.8.6
On date Thursday 2012-09-27 04:35:30 -0300, jamal encoded:
--- configure | 2 +- libpostproc/Makefile | 3 +- libpostproc/postprocess.h | 18 +---------------- libpostproc/version.h | 47 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+), 19 deletions(-) create mode 100644 libpostproc/version.h
diff --git a/configure b/configure index d2d3a66..1737532 100755 --- a/configure +++ b/configure @@ -4233,7 +4233,7 @@ fi eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak }
-get_version_old LIBPOSTPROC libpostproc/postprocess.h +get_version_old LIBPOSTPROC libpostproc/version.h get_version_old LIBSWRESAMPLE libswresample/swresample.h
get_version libavcodec diff --git a/libpostproc/Makefile b/libpostproc/Makefile index 6242157..3fb5a70 100644 --- a/libpostproc/Makefile +++ b/libpostproc/Makefile @@ -3,6 +3,7 @@ include $(SUBDIR)../config.mak NAME = postproc FFLIBS = avutil
-HEADERS = postprocess.h +HEADERS = postprocess.h \ + version.h \
OBJS = postprocess.o diff --git a/libpostproc/postprocess.h b/libpostproc/postprocess.h index c2c5c73..623b3b5 100644 --- a/libpostproc/postprocess.h +++ b/libpostproc/postprocess.h @@ -27,23 +27,7 @@ * external postprocessing API */
-#include "libavutil/avutil.h" - -#ifndef LIBPOSTPROC_VERSION_MAJOR -#define LIBPOSTPROC_VERSION_MAJOR 52 -#define LIBPOSTPROC_VERSION_MINOR 0 -#define LIBPOSTPROC_VERSION_MICRO 100 -#endif - -#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ - LIBPOSTPROC_VERSION_MINOR, \ - LIBPOSTPROC_VERSION_MICRO) -#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ - LIBPOSTPROC_VERSION_MINOR, \ - LIBPOSTPROC_VERSION_MICRO) -#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT - -#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) +#include "libpostproc/version.h"
/** * Return the LIBPOSTPROC_VERSION_INT constant. diff --git a/libpostproc/version.h b/libpostproc/version.h new file mode 100644 index 0000000..17443ea --- /dev/null +++ b/libpostproc/version.h @@ -0,0 +1,47 @@ +/* + * Version macros. + * + * 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 + */ + +#ifndef POSTPROC_POSTPROCESS_VERSION_H +#define POSTPROC_POSTPROCESS_VERSION_H + +/** + * @file + * Libpostproc version macros + */ + +#include "libavutil/avutil.h" + +#ifndef LIBPOSTPROC_VERSION_MAJOR +#define LIBPOSTPROC_VERSION_MAJOR 52 +#define LIBPOSTPROC_VERSION_MINOR 0 +#define LIBPOSTPROC_VERSION_MICRO 100 +#endif + +#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT + +#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) + +#endif /* POSTPROC_POSTPROCESS_VERSION_H */
LGTM. I believe the purpose of this and other similar patches is to create a minimal version.h file which can be easily included in another file. -- FFmpeg = Fancy Forgiving Multimedia Programmable Elected Geek
--- configure | 2 +- libswresample/Makefile | 3 ++- libswresample/swresample.h | 8 +------- libswresample/version.h | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 libswresample/version.h diff --git a/configure b/configure index 1737532..8b6969c 100755 --- a/configure +++ b/configure @@ -4234,7 +4234,6 @@ fi } get_version_old LIBPOSTPROC libpostproc/version.h -get_version_old LIBSWRESAMPLE libswresample/swresample.h get_version libavcodec get_version libavdevice @@ -4242,6 +4241,7 @@ get_version libavfilter get_version libavformat get_version libavresample get_version libavutil +get_version libswresample get_version libswscale cat > $TMPH <<EOF diff --git a/libswresample/Makefile b/libswresample/Makefile index 0a5c5d2..d85ed8b 100644 --- a/libswresample/Makefile +++ b/libswresample/Makefile @@ -3,7 +3,8 @@ include $(SUBDIR)../config.mak NAME = swresample FFLIBS = avutil -HEADERS = swresample.h +HEADERS = swresample.h \ + version.h \ OBJS = audioconvert.o \ dither.o \ diff --git a/libswresample/swresample.h b/libswresample/swresample.h index ac87207..ac43cd2 100644 --- a/libswresample/swresample.h +++ b/libswresample/swresample.h @@ -29,13 +29,7 @@ #include <inttypes.h> #include "libavutil/samplefmt.h" -#define LIBSWRESAMPLE_VERSION_MAJOR 0 -#define LIBSWRESAMPLE_VERSION_MINOR 15 -#define LIBSWRESAMPLE_VERSION_MICRO 100 - -#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ - LIBSWRESAMPLE_VERSION_MINOR, \ - LIBSWRESAMPLE_VERSION_MICRO) +#include "libswresample/version.h" #if LIBSWRESAMPLE_VERSION_MAJOR < 1 #define SWR_CH_MAX 32 ///< Maximum number of channels diff --git a/libswresample/version.h b/libswresample/version.h new file mode 100644 index 0000000..0f610bc --- /dev/null +++ b/libswresample/version.h @@ -0,0 +1,39 @@ +/* + * Version macros. + * + * This file is part of libswresample + * + * libswresample 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. + * + * libswresample 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 libswresample; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWR_VERSION_H +#define SWR_VERSION_H + +/** + * @file + * Libswresample version macros + */ + +#include "libavutil/avutil.h" + +#define LIBSWRESAMPLE_VERSION_MAJOR 0 +#define LIBSWRESAMPLE_VERSION_MINOR 15 +#define LIBSWRESAMPLE_VERSION_MICRO 100 + +#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) + +#endif /* SWR_VERSION_H */ -- 1.7.8.6
On date Thursday 2012-09-27 04:35:31 -0300, jamal encoded:
--- configure | 2 +- libswresample/Makefile | 3 ++- libswresample/swresample.h | 8 +------- libswresample/version.h | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 libswresample/version.h
diff --git a/configure b/configure index 1737532..8b6969c 100755 --- a/configure +++ b/configure @@ -4234,7 +4234,6 @@ fi }
get_version_old LIBPOSTPROC libpostproc/version.h -get_version_old LIBSWRESAMPLE libswresample/swresample.h
get_version libavcodec get_version libavdevice @@ -4242,6 +4241,7 @@ get_version libavfilter get_version libavformat get_version libavresample get_version libavutil +get_version libswresample get_version libswscale
cat > $TMPH <<EOF diff --git a/libswresample/Makefile b/libswresample/Makefile index 0a5c5d2..d85ed8b 100644 --- a/libswresample/Makefile +++ b/libswresample/Makefile @@ -3,7 +3,8 @@ include $(SUBDIR)../config.mak NAME = swresample FFLIBS = avutil
-HEADERS = swresample.h +HEADERS = swresample.h \ + version.h \
OBJS = audioconvert.o \ dither.o \ diff --git a/libswresample/swresample.h b/libswresample/swresample.h index ac87207..ac43cd2 100644 --- a/libswresample/swresample.h +++ b/libswresample/swresample.h @@ -29,13 +29,7 @@ #include <inttypes.h> #include "libavutil/samplefmt.h"
-#define LIBSWRESAMPLE_VERSION_MAJOR 0 -#define LIBSWRESAMPLE_VERSION_MINOR 15 -#define LIBSWRESAMPLE_VERSION_MICRO 100 - -#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ - LIBSWRESAMPLE_VERSION_MINOR, \ - LIBSWRESAMPLE_VERSION_MICRO) +#include "libswresample/version.h"
#if LIBSWRESAMPLE_VERSION_MAJOR < 1 #define SWR_CH_MAX 32 ///< Maximum number of channels diff --git a/libswresample/version.h b/libswresample/version.h new file mode 100644 index 0000000..0f610bc --- /dev/null +++ b/libswresample/version.h @@ -0,0 +1,39 @@ +/* + * Version macros. + * + * This file is part of libswresample + * + * libswresample 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. + * + * libswresample 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 libswresample; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWR_VERSION_H +#define SWR_VERSION_H + +/** + * @file + * Libswresample version macros + */ + +#include "libavutil/avutil.h" + +#define LIBSWRESAMPLE_VERSION_MAJOR 0 +#define LIBSWRESAMPLE_VERSION_MINOR 15 +#define LIBSWRESAMPLE_VERSION_MICRO 100 + +#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) + +#endif /* SWR_VERSION_H */ -- 1.7.8.6
LGTM. Bonus: bump minor since you're adding a public header. -- FFmpeg = Furious and Friendly Muttering Pacific Eager Guru
On Thu, Sep 27, 2012 at 10:29:51AM +0200, Stefano Sabatini wrote:
On date Thursday 2012-09-27 04:35:31 -0300, jamal encoded:
--- configure | 2 +- libswresample/Makefile | 3 ++- libswresample/swresample.h | 8 +------- libswresample/version.h | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 libswresample/version.h
diff --git a/configure b/configure index 1737532..8b6969c 100755 --- a/configure +++ b/configure @@ -4234,7 +4234,6 @@ fi }
get_version_old LIBPOSTPROC libpostproc/version.h -get_version_old LIBSWRESAMPLE libswresample/swresample.h
get_version libavcodec get_version libavdevice @@ -4242,6 +4241,7 @@ get_version libavfilter get_version libavformat get_version libavresample get_version libavutil +get_version libswresample get_version libswscale
cat > $TMPH <<EOF diff --git a/libswresample/Makefile b/libswresample/Makefile index 0a5c5d2..d85ed8b 100644 --- a/libswresample/Makefile +++ b/libswresample/Makefile @@ -3,7 +3,8 @@ include $(SUBDIR)../config.mak NAME = swresample FFLIBS = avutil
-HEADERS = swresample.h +HEADERS = swresample.h \ + version.h \
OBJS = audioconvert.o \ dither.o \ diff --git a/libswresample/swresample.h b/libswresample/swresample.h index ac87207..ac43cd2 100644 --- a/libswresample/swresample.h +++ b/libswresample/swresample.h @@ -29,13 +29,7 @@ #include <inttypes.h> #include "libavutil/samplefmt.h"
-#define LIBSWRESAMPLE_VERSION_MAJOR 0 -#define LIBSWRESAMPLE_VERSION_MINOR 15 -#define LIBSWRESAMPLE_VERSION_MICRO 100 - -#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ - LIBSWRESAMPLE_VERSION_MINOR, \ - LIBSWRESAMPLE_VERSION_MICRO) +#include "libswresample/version.h"
#if LIBSWRESAMPLE_VERSION_MAJOR < 1 #define SWR_CH_MAX 32 ///< Maximum number of channels diff --git a/libswresample/version.h b/libswresample/version.h new file mode 100644 index 0000000..0f610bc --- /dev/null +++ b/libswresample/version.h @@ -0,0 +1,39 @@ +/* + * Version macros. + * + * This file is part of libswresample + * + * libswresample 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. + * + * libswresample 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 libswresample; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWR_VERSION_H +#define SWR_VERSION_H + +/** + * @file + * Libswresample version macros + */ + +#include "libavutil/avutil.h" + +#define LIBSWRESAMPLE_VERSION_MAJOR 0 +#define LIBSWRESAMPLE_VERSION_MINOR 15 +#define LIBSWRESAMPLE_VERSION_MICRO 100 + +#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) + +#endif /* SWR_VERSION_H */ -- 1.7.8.6
LGTM.
applied
Bonus: bump minor since you're adding a public header.
seems this is in a subsequent patch [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Asymptotically faster algorithms should always be preferred if you have asymptotical amounts of data
--- libavdevice/version.h | 2 ++ libavfilter/version.h | 2 ++ libswresample/version.h | 6 ++++++ 3 files changed, 10 insertions(+), 0 deletions(-) diff --git a/libavdevice/version.h b/libavdevice/version.h index d8aa94f..04c2a16 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -39,6 +39,8 @@ LIBAVDEVICE_VERSION_MICRO) #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT +#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) + /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of diff --git a/libavfilter/version.h b/libavfilter/version.h index 3d3d1c9..033af90 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -40,6 +40,8 @@ LIBAVFILTER_VERSION_MICRO) #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT +#define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) + /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of diff --git a/libswresample/version.h b/libswresample/version.h index 0f610bc..2031acd 100644 --- a/libswresample/version.h +++ b/libswresample/version.h @@ -35,5 +35,11 @@ #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ LIBSWRESAMPLE_VERSION_MINOR, \ LIBSWRESAMPLE_VERSION_MICRO) +#define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) +#define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT + +#define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) #endif /* SWR_VERSION_H */ -- 1.7.8.6
On date Thursday 2012-09-27 04:35:32 -0300, jamal encoded:
--- libavdevice/version.h | 2 ++ libavfilter/version.h | 2 ++ libswresample/version.h | 6 ++++++ 3 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/libavdevice/version.h b/libavdevice/version.h index d8aa94f..04c2a16 100644 --- a/libavdevice/version.h +++ b/libavdevice/version.h @@ -39,6 +39,8 @@ LIBAVDEVICE_VERSION_MICRO) #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
+#define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) + /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of diff --git a/libavfilter/version.h b/libavfilter/version.h index 3d3d1c9..033af90 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -40,6 +40,8 @@ LIBAVFILTER_VERSION_MICRO) #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT
+#define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) + /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of diff --git a/libswresample/version.h b/libswresample/version.h index 0f610bc..2031acd 100644 --- a/libswresample/version.h +++ b/libswresample/version.h @@ -35,5 +35,11 @@ #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ LIBSWRESAMPLE_VERSION_MINOR, \ LIBSWRESAMPLE_VERSION_MICRO) +#define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ + LIBSWRESAMPLE_VERSION_MINOR, \ + LIBSWRESAMPLE_VERSION_MICRO) +#define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT + +#define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
LGTM. Again new symbols should be marked by a minor bump (so applications know when they can refer them) and advertised on APIchanges. -- FFmpeg = Fantastic & Freak Multimedia Portable Elitarian Genius
On 27/09/12 5:31 AM, Stefano Sabatini wrote:
LGTM.
Again new symbols should be marked by a minor bump (so applications know when they can refer them) and advertised on APIchanges.
Should i resend those three patches (postproc's and swr's version.h, plus the extra macros one) with the minor bumps added, or just a new patch/es to deal with that instead? And with swsresample should i bump once for the version.h addition then again for the new macros, or only once for all that? Thanks.
On date Thursday 2012-09-27 05:42:02 -0300, jamal encoded:
On 27/09/12 5:31 AM, Stefano Sabatini wrote:
LGTM.
Again new symbols should be marked by a minor bump (so applications know when they can refer them) and advertised on APIchanges.
Should i resend those three patches (postproc's and swr's version.h, plus the extra macros one) with the minor bumps added, or just a new patch/es to deal with that instead?
I prefer self-contained patches, so when a new symbol is added minor should be bumped. The alternative approach is to have a change for the code, and then a bump+APIchanges update separate change. The latter has the benefit that when you do this, you know the hash of the previous related change commit.
And with swsresample should i bump once for the version.h addition then again for the new macros, or only once for all that?
When we had many somewhat related changes in the same library, a single global version bump+APIchanges update is acceptable, but I still tend to prefer self-contained changes (which are a bit more painful to deal with though). So I'd say do it the way you prefer. -- FFmpeg = Fostering & Fantastic Marvellous Perfectionist Experimenting Guru
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
Hi jamal, I just skimmed over the descriptions, so this is not a proper review in any way. jamal wrote:
Working only with GNU windres. The .rc files will be compiled only when building ffmpeg with MinGW/Cygwin and shared libraries enabled --- + VALUE "CompanyName", "FFmpeg"
"FFmpeg team" or "FFmpeg project" might also be alternatives that give hints that FFmpeg is not a company. No, I have no strong feelings about this and I am also fine with just "FFmpeg".
+ VALUE "FileDescription", "FFmpeg video filtering library"
"video filtering" sounds a bit too constrained to me. Maybe use "FFmpeg multimedia filtering library" or "FFmpeg A/V filtering library" or just "FFmpeg filtering library" [...]
+ VALUE "FileDescription", "FFmpeg container format library" [...] + VALUE "FileDescription", "FFmpeg utility library" [...] + VALUE "FileDescription", "FFmpeg postprocessing library" [...] + VALUE "FileDescription", "FFmpeg audio rescaling library"
I would tend to use resampling instead of rescaling here. [...]
+ VALUE "FileDescription", "FFmpeg image rescaling library"
No strong opinion, but maybe video would be the nicer term here. Also considering the pairing of "FFmpeg audio resampling library"/"FFmpeg video rescaling library" [...] Those were all just suggestions, maybe other developers can state their preferences too. Also I guess this can be changed at any time later. No need to do any changes yet. I just think it is always a good idea to think about terminology and to try to come up with a consistent one. It makes it much easier to talk and communicate about FFmpeg, especially to users that normally do not closely follow the development of FFmpeg. Also something slightly OT. I guess you volunteer to maintain this stuff (looks like it will need updates from time to time). Would you like to be the build system maintainer? I think the people currently listed in MAINTAINERS do not maintain our version of the build system anymore which has diverged from their fork. So if you would like to step up to that task, please send a patch to replace the entries in MAINTAINERS with your full name; if you do not want to be listed alone you can write my name after yours. If you want to, you can also maintain a publicly accessible FFmpeg git repo with your proposed changes. This would make it easier for you to get testers prior to inclusion in the official repo and it is easy to merge it into the official repo as soon as it is ready. Alexander Strasser
On 27/09/12 6:24 PM, Alexander Strasser wrote:
Hi jamal,
I just skimmed over the descriptions, so this is not a proper review in any way.
jamal wrote:
Working only with GNU windres. The .rc files will be compiled only when building ffmpeg with MinGW/Cygwin and shared libraries enabled --- + VALUE "CompanyName", "FFmpeg"
"FFmpeg team" or "FFmpeg project" might also be alternatives that give hints that FFmpeg is not a company. No, I have no strong feelings about this and I am also fine with just "FFmpeg".
+ VALUE "FileDescription", "FFmpeg video filtering library"
"video filtering" sounds a bit too constrained to me. Maybe use
"FFmpeg multimedia filtering library" or "FFmpeg A/V filtering library" or just "FFmpeg filtering library"
[...]
+ VALUE "FileDescription", "FFmpeg container format library" [...] + VALUE "FileDescription", "FFmpeg utility library" [...] + VALUE "FileDescription", "FFmpeg postprocessing library" [...] + VALUE "FileDescription", "FFmpeg audio rescaling library"
I would tend to use resampling instead of rescaling here.
[...]
+ VALUE "FileDescription", "FFmpeg image rescaling library"
No strong opinion, but maybe video would be the nicer term here. Also considering the pairing of "FFmpeg audio resampling library"/"FFmpeg video rescaling library"
These descriptions were taken verbatim from the pkgconfig files. I thought "Audio rescaling" didn't seem right, but decided against changing it for consistency's sake. lavr does use "resampling" instead of "rescaling", so if you think it's a good idea to change libswr's description (And lavfi/libsws as well) i can submit a separate patch changing the corresponding lines in configure, plus a new version of this patch with the rc files updated as well.
[...]
Those were all just suggestions, maybe other developers can state their preferences too. Also I guess this can be changed at any time later. No need to do any changes yet. I just think it is always a good idea to think about terminology and to try to come up with a consistent one. It makes it much easier to talk and communicate about FFmpeg, especially to users that normally do not closely follow the development of FFmpeg.
Also something slightly OT. I guess you volunteer to maintain this stuff (looks like it will need updates from time to time). Would you like to be the build system maintainer? I think the people currently listed in MAINTAINERS do not maintain our version of the build system anymore which has diverged from their fork. So if you would like to step up to that task, please send a patch to replace the entries in MAINTAINERS with your full name; if you do not want to be listed alone you can write my name after yours.
I'll think about it. I do plan to maintain the rc files nonetheless (Things like copyright date, and potential new libraries or future changes in descriptions). Or better yet, try to find a reliable way to create them with the configure script.
If you want to, you can also maintain a publicly accessible FFmpeg git repo with your proposed changes. This would make it easier for you to get testers prior to inclusion in the official repo and it is easy to merge it into the official repo as soon as it is ready.
Alexander Strasser
I'll give github/bitbucket a look then. Thanks.
jamal wrote:
On 27/09/12 6:24 PM, Alexander Strasser wrote: [...] These descriptions were taken verbatim from the pkgconfig files. I thought "Audio rescaling" didn't seem right, but decided against changing it for consistency's sake.
lavr does use "resampling" instead of "rescaling", so if you think it's a good idea to change libswr's description (And lavfi/libsws as well) i can submit a separate patch changing the corresponding lines in configure, plus a new version of this patch with the rc files updated as well.
Yeah, you are right then. If we change it, it should be separate from this patchset. But no need to hurry, maybe we can accumulate some more description changes.
[...]
Those were all just suggestions, maybe other developers can state their preferences too. Also I guess this can be changed at any time later. No need to do any changes yet. I just think it is always a good idea to think about terminology and to try to come up with a consistent one. It makes it much easier to talk and communicate about FFmpeg, especially to users that normally do not closely follow the development of FFmpeg.
Also something slightly OT. I guess you volunteer to maintain this stuff (looks like it will need updates from time to time). Would you like to be the build system maintainer? I think the people currently listed in MAINTAINERS do not maintain our version of the build system anymore which has diverged from their fork. So if you would like to step up to that task, please send a patch to replace the entries in MAINTAINERS with your full name; if you do not want to be listed alone you can write my name after yours.
I'll think about it.
OK
I do plan to maintain the rc files nonetheless (Things like copyright date, and potential new libraries or future changes in descriptions). Or better yet, try to find a reliable way to create them with the configure script.
That's good news!
If you want to, you can also maintain a publicly accessible FFmpeg git repo with your proposed changes. This would make it easier for you to get testers prior to inclusion in the official repo and it is easy to merge it into the official repo as soon as it is ready.
I'll give github/bitbucket a look then.
Thanks for your help, Alexander
Based on patch by: James Almer <jamrial@gmail.com> Signed-off-by: Timothy Gu <timothygu99@gmail.com> --- Differences from James's version [1]: * Now generate the .rc files from configure (like we do with pkg-config files). * Use descriptions of libraries from the pkg-config file generation function * Use "FFmpeg Project" as CompanyName like Alexander suggested in the old thread * Use "FFmpeg" for ProductName as MSDN says "name of the product with which the file is distributed" [2]. * Use FFmpeg's version (N-xxxxx-gxxxxxxx) for ProductVersion per MSDN [2]. [1] http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2012-September/131705.html [2] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx --- .gitignore | 1 + Makefile | 3 ++- common.mak | 9 +++++-- configure | 65 +++++++++++++++++++++++++++++++++++++++++++++++++- libavcodec/Makefile | 3 +++ libavdevice/Makefile | 3 +++ libavfilter/Makefile | 3 +++ libavformat/Makefile | 3 +++ libavresample/Makefile | 3 +++ libavutil/Makefile | 3 +++ libpostproc/Makefile | 3 +++ library.mak | 2 +- libswresample/Makefile | 3 +++ libswscale/Makefile | 3 +++ 14 files changed, 102 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7d8adda..8a63efc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.lib *.pc *.pdb +*.rc *.so *.so.* *.ver diff --git a/Makefile b/Makefile index 10202d0..53b8841 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) @@ -74,7 +75,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \ 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 b22badd..0ddaaa5 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 $@ $< + %.i: %.c $(CC) $(CCFLAGS) $(CC_E) $< @@ -82,6 +85,7 @@ endif include $(SRC_PATH)/arch.mak OBJS += $(OBJS-yes) +SLIBOBJS += $(SLIBOBJS-yes) FFLIBS := $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes) @@ -90,6 +94,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) @@ -127,7 +132,7 @@ $(TOOLOBJS): | tools OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS)) CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda -DISTCLEANSUFFIXES = *.pc +DISTCLEANSUFFIXES = *.pc *.rc LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a define RULES diff --git a/configure b/configure index a83b1f0..d26da1d 100755 --- a/configure +++ b/configure @@ -267,6 +267,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] @@ -1477,6 +1478,7 @@ HAVE_LIST=" gettimeofday glob gnu_as + gnu_windres gsm_h ibm_asm inet_aton @@ -2323,6 +2325,7 @@ pkg_config_default=pkg-config ranlib="ranlib" strip_default="strip" yasmexe_default="yasm" +windres_default="windres" nogas=":" @@ -2592,6 +2595,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" @@ -3110,7 +3114,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 @@ -3592,6 +3596,7 @@ case $target_os in elif enabled arm; then LIBTARGET=arm-wince fi + enabled shared && check_cmd $windres --version && enable gnu_windres check_ldflags -Wl,--nxcompat check_ldflags -Wl,--dynamicbase shlibdir_default="$bindir_default" @@ -3654,6 +3659,7 @@ case $target_os in SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' objformat="win32" enable dos_paths + enabled shared && check_cmd $windres --version && enable gnu_windres ;; *-dos|freedos|opendos) network_extralibs="-lsocket" @@ -4829,6 +4835,7 @@ LD_O=$LD_O LD_LIB=$LD_LIB LD_PATH=$LD_PATH DLLTOOL=$dlltool +WINDRES=$windres LDFLAGS=$LDFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) YASMFLAGS=$YASMFLAGS @@ -4914,6 +4921,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 @@ -5014,6 +5022,51 @@ Cflags: -I\${includedir} EOF } +windres_generate(){ + enabled gnu_windres || return 0 + name=$1 + shortname=${name#lib} + comment=$2 + capname=`echo $name | awk '{print toupper($0)}'` + version=${capname}_VERSION + enabled ${name#lib} || return 0 + mkdir -p $name + cat <<EOF > $name/${shortname}res.rc +#include <windows.h> +#include "$name/version.h" +#include "../version.h" +#include "config.h" + +1 VERSIONINFO +FILEVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +PRODUCTVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "FFmpeg Project" + VALUE "FileDescription", "$comment" + VALUE "FileVersion", AV_STRINGIFY($version) + VALUE "InternalName", "$name" + VALUE "LegalCopyright", "Copyright (C) 2000-2013 FFmpeg Project" + VALUE "OriginalFilename", "$shortname" BUILDSUF "-" AV_STRINGIFY(${version}_MAJOR) SLIBSUF + VALUE "ProductName", "FFmpeg" + VALUE "ProductVersion", FFMPEG_VERSION + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409, 0x04E4 + } +} +EOF +} + lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION" enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION," enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION," @@ -5036,6 +5089,16 @@ pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVR pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +windres_generate libavutil "FFmpeg utility library" +windres_generate libavcodec "FFmpeg codec library" +windres_generate libavformat "FFmpeg container format library" +windres_generate libavdevice "FFmpeg device handling library" +windres_generate libavfilter "FFmpeg audio/video filtering library" +windres_generate libpostproc "FFmpeg postprocessing library" +windres_generate libavresample "Libav audio resampling library" +windres_generate libswscale "FFmpeg image rescaling library" +windres_generate libswresample "FFmpeg audio resampling library" + fix_ffmpeg_remote(){ git_remote_from=$1 git_remote_to=$2 diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e8c1c1b..b0a5774 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -812,6 +812,9 @@ OBJS-$(HAVE_OS2THREADS) += pthread.o pthread_slice.o pthread_fram OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o + SKIPHEADERS += %_tablegen.h \ %_tables.h \ aac_tablegen_decl.h \ diff --git a/libavdevice/Makefile b/libavdevice/Makefile index 21ca954..9eb3d3b 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -51,6 +51,9 @@ OBJS-$(CONFIG_XV_OUTDEV) += xv.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-$(CONFIG_LIBPULSE) += pulse_audio_common.h SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 7bd4323..12d803a 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -249,6 +249,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 + SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h SKIPHEADERS-$(CONFIG_OPENCL) += opencl_internal.h deshake_opencl_kernel.h unsharp_opencl_kernel.h diff --git a/libavformat/Makefile b/libavformat/Makefile index b08ce57..609c00f 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -463,6 +463,9 @@ OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.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/libavresample/Makefile b/libavresample/Makefile index 6805280..bca23a9 100644 --- a/libavresample/Makefile +++ b/libavresample/Makefile @@ -13,4 +13,7 @@ OBJS = audio_convert.o \ resample.o \ utils.o \ +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avresampleres.o + TESTPROGS = avresample diff --git a/libavutil/Makefile b/libavutil/Makefile index 02dd728..9153818 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -121,6 +121,9 @@ OBJS-$(CONFIG_OPENCL) += opencl.o opencl_internal.o OBJS += $(COMPAT_OBJS:%=../compat/%) +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o + SKIPHEADERS = old_pix_fmts.h SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h diff --git a/libpostproc/Makefile b/libpostproc/Makefile index 3fb5a70..b9bb4be 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) += postprocres.o diff --git a/library.mak b/library.mak index e48aba1..fe06057 100644 --- a/library.mak +++ b/library.mak @@ -51,7 +51,7 @@ $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) $(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) $(SLIB_EXTRA_CMD) diff --git a/libswresample/Makefile b/libswresample/Makefile index 0b75bd0..953c945 100644 --- a/libswresample/Makefile +++ b/libswresample/Makefile @@ -15,4 +15,7 @@ OBJS = audioconvert.o \ OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o OBJS-$(CONFIG_SHARED) += log2_tab.o +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o + TESTPROGS = swresample diff --git a/libswscale/Makefile b/libswscale/Makefile index dd00f7d..ca6e27d 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 \ -- 1.8.3.2
Based on patch by: James Almer <jamrial@gmail.com> Signed-off-by: Timothy Gu <timothygu99@gmail.com> --- Sorry if the older patch in the thread doesn't apply. --- Differences from James's version [1]: * Now generate the .rc files from configure (like we do with pkg-config files). * Use descriptions of libraries from the pkg-config file generation function * Use "FFmpeg Project" as CompanyName like Alexander suggested in the old thread * Use "FFmpeg" for ProductName as MSDN says "name of the product with which the file is distributed" [2]. * Use FFmpeg's version (N-xxxxx-gxxxxxxx) for ProductVersion per MSDN [2]. [1] http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2012-September/131705.html [2] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx --- .gitignore | 1 + Makefile | 3 ++- common.mak | 9 +++++-- configure | 65 +++++++++++++++++++++++++++++++++++++++++++++++++- libavcodec/Makefile | 3 +++ libavdevice/Makefile | 3 +++ libavfilter/Makefile | 3 +++ libavformat/Makefile | 3 +++ libavresample/Makefile | 3 +++ libavutil/Makefile | 3 +++ libpostproc/Makefile | 3 +++ library.mak | 2 +- libswresample/Makefile | 3 +++ libswscale/Makefile | 3 +++ 14 files changed, 102 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7d8adda..8a63efc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.lib *.pc *.pdb +*.rc *.so *.so.* *.ver diff --git a/Makefile b/Makefile index 10202d0..53b8841 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) @@ -74,7 +75,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \ 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 b22badd..0ddaaa5 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 $@ $< + %.i: %.c $(CC) $(CCFLAGS) $(CC_E) $< @@ -82,6 +85,7 @@ endif include $(SRC_PATH)/arch.mak OBJS += $(OBJS-yes) +SLIBOBJS += $(SLIBOBJS-yes) FFLIBS := $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes) @@ -90,6 +94,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) @@ -127,7 +132,7 @@ $(TOOLOBJS): | tools OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS)) CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda -DISTCLEANSUFFIXES = *.pc +DISTCLEANSUFFIXES = *.pc *.rc LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a define RULES diff --git a/configure b/configure index 6b0375b..b334898 100755 --- a/configure +++ b/configure @@ -267,6 +267,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] @@ -1478,6 +1479,7 @@ HAVE_LIST=" gettimeofday glob gnu_as + gnu_windres gsm_h ibm_asm inet_aton @@ -2325,6 +2327,7 @@ pkg_config_default=pkg-config ranlib="ranlib" strip_default="strip" yasmexe_default="yasm" +windres_default="windres" nogas=":" @@ -2594,6 +2597,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" @@ -3112,7 +3116,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 @@ -3594,6 +3598,7 @@ case $target_os in elif enabled arm; then LIBTARGET=arm-wince fi + enabled shared && check_cmd $windres --version && enable gnu_windres check_ldflags -Wl,--nxcompat check_ldflags -Wl,--dynamicbase shlibdir_default="$bindir_default" @@ -3656,6 +3661,7 @@ case $target_os in SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' objformat="win32" enable dos_paths + enabled shared && check_cmd $windres --version && enable gnu_windres ;; *-dos|freedos|opendos) network_extralibs="-lsocket" @@ -4831,6 +4837,7 @@ LD_O=$LD_O LD_LIB=$LD_LIB LD_PATH=$LD_PATH DLLTOOL=$dlltool +WINDRES=$windres LDFLAGS=$LDFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) YASMFLAGS=$YASMFLAGS @@ -4916,6 +4923,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 @@ -5016,6 +5024,51 @@ Cflags: -I\${includedir} EOF } +windres_generate(){ + enabled gnu_windres || return 0 + name=$1 + shortname=${name#lib} + comment=$2 + capname=`echo $name | awk '{print toupper($0)}'` + version=${capname}_VERSION + enabled ${name#lib} || return 0 + mkdir -p $name + cat <<EOF > $name/${shortname}res.rc +#include <windows.h> +#include "$name/version.h" +#include "../version.h" +#include "config.h" + +1 VERSIONINFO +FILEVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +PRODUCTVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", "FFmpeg Project" + VALUE "FileDescription", "$comment" + VALUE "FileVersion", AV_STRINGIFY($version) + VALUE "InternalName", "$name" + VALUE "LegalCopyright", "Copyright (C) 2000-2013 FFmpeg Project" + VALUE "OriginalFilename", "$shortname" BUILDSUF "-" AV_STRINGIFY(${version}_MAJOR) SLIBSUF + VALUE "ProductName", "FFmpeg" + VALUE "ProductVersion", FFMPEG_VERSION + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409, 0x04E4 + } +} +EOF +} + lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION" enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION," enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION," @@ -5038,6 +5091,16 @@ pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVR pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" +windres_generate libavutil "FFmpeg utility library" +windres_generate libavcodec "FFmpeg codec library" +windres_generate libavformat "FFmpeg container format library" +windres_generate libavdevice "FFmpeg device handling library" +windres_generate libavfilter "FFmpeg audio/video filtering library" +windres_generate libpostproc "FFmpeg postprocessing library" +windres_generate libavresample "Libav audio resampling library" +windres_generate libswscale "FFmpeg image rescaling library" +windres_generate libswresample "FFmpeg audio resampling library" + fix_ffmpeg_remote(){ git_remote_from=$1 git_remote_to=$2 diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e8c1c1b..b0a5774 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -812,6 +812,9 @@ OBJS-$(HAVE_OS2THREADS) += pthread.o pthread_slice.o pthread_fram OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o + SKIPHEADERS += %_tablegen.h \ %_tables.h \ aac_tablegen_decl.h \ diff --git a/libavdevice/Makefile b/libavdevice/Makefile index 21ca954..9eb3d3b 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -51,6 +51,9 @@ OBJS-$(CONFIG_XV_OUTDEV) += xv.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-$(CONFIG_LIBPULSE) += pulse_audio_common.h SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 7bd4323..12d803a 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -249,6 +249,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 + SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h SKIPHEADERS-$(CONFIG_OPENCL) += opencl_internal.h deshake_opencl_kernel.h unsharp_opencl_kernel.h diff --git a/libavformat/Makefile b/libavformat/Makefile index b08ce57..609c00f 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -463,6 +463,9 @@ OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.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/libavresample/Makefile b/libavresample/Makefile index 6805280..bca23a9 100644 --- a/libavresample/Makefile +++ b/libavresample/Makefile @@ -13,4 +13,7 @@ OBJS = audio_convert.o \ resample.o \ utils.o \ +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avresampleres.o + TESTPROGS = avresample diff --git a/libavutil/Makefile b/libavutil/Makefile index 02dd728..9153818 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -121,6 +121,9 @@ OBJS-$(CONFIG_OPENCL) += opencl.o opencl_internal.o OBJS += $(COMPAT_OBJS:%=../compat/%) +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o + SKIPHEADERS = old_pix_fmts.h SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h diff --git a/libpostproc/Makefile b/libpostproc/Makefile index 3fb5a70..b9bb4be 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) += postprocres.o diff --git a/library.mak b/library.mak index e48aba1..fe06057 100644 --- a/library.mak +++ b/library.mak @@ -51,7 +51,7 @@ $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) $(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) $(SLIB_EXTRA_CMD) diff --git a/libswresample/Makefile b/libswresample/Makefile index 0b75bd0..953c945 100644 --- a/libswresample/Makefile +++ b/libswresample/Makefile @@ -15,4 +15,7 @@ OBJS = audioconvert.o \ OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o OBJS-$(CONFIG_SHARED) += log2_tab.o +# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o + TESTPROGS = swresample diff --git a/libswscale/Makefile b/libswscale/Makefile index dd00f7d..ca6e27d 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 \ -- 1.8.3.2
On 25/11/13 6:59 PM, Timothy Gu wrote:
Based on patch by: James Almer <jamrial@gmail.com>
Signed-off-by: Timothy Gu <timothygu99@gmail.com> ---
Sorry if the older patch in the thread doesn't apply.
---
Differences from James's version [1]: * Now generate the .rc files from configure (like we do with pkg-config files).
I'm not sure about this. They don't get installed, and having one .rc file per folder won't bother anyone, whereas the big generator function in configure will be a small nuisance with merges from libav. x264 and mplayer ship with the .rc files in the source tree and don't generate them either.
* Use descriptions of libraries from the pkg-config file generation function * Use "FFmpeg Project" as CompanyName like Alexander suggested in the old thread * Use "FFmpeg" for ProductName as MSDN says "name of the product with which the file is distributed" [2]. * Use FFmpeg's version (N-xxxxx-gxxxxxxx) for ProductVersion per MSDN [2].
[1] http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2012-September/131705.html [2] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx
I'm fine with the changes. Afterwards we should try to extend this to also cover the executables, like Gianluigi Tiesi did on his repo. Some comments below.
--- .gitignore | 1 + Makefile | 3 ++- common.mak | 9 +++++-- configure | 65 +++++++++++++++++++++++++++++++++++++++++++++++++- libavcodec/Makefile | 3 +++ libavdevice/Makefile | 3 +++ libavfilter/Makefile | 3 +++ libavformat/Makefile | 3 +++ libavresample/Makefile | 3 +++ libavutil/Makefile | 3 +++ libpostproc/Makefile | 3 +++ library.mak | 2 +- libswresample/Makefile | 3 +++ libswscale/Makefile | 3 +++ 14 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore index 7d8adda..8a63efc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.lib *.pc *.pdb +*.rc *.so *.so.* *.ver diff --git a/Makefile b/Makefile index 10202d0..53b8841 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) @@ -74,7 +75,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \ 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 b22badd..0ddaaa5 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 $@ $< + %.i: %.c $(CC) $(CCFLAGS) $(CC_E) $<
@@ -82,6 +85,7 @@ endif include $(SRC_PATH)/arch.mak
OBJS += $(OBJS-yes) +SLIBOBJS += $(SLIBOBJS-yes) FFLIBS := $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes)
@@ -90,6 +94,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) @@ -127,7 +132,7 @@ $(TOOLOBJS): | tools OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda -DISTCLEANSUFFIXES = *.pc +DISTCLEANSUFFIXES = *.pc *.rc LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
define RULES diff --git a/configure b/configure index 6b0375b..b334898 100755 --- a/configure +++ b/configure @@ -267,6 +267,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] @@ -1478,6 +1479,7 @@ HAVE_LIST=" gettimeofday glob gnu_as + gnu_windres gsm_h ibm_asm inet_aton @@ -2325,6 +2327,7 @@ pkg_config_default=pkg-config ranlib="ranlib" strip_default="strip" yasmexe_default="yasm" +windres_default="windres"
nogas=":"
@@ -2594,6 +2597,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"
@@ -3112,7 +3116,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 @@ -3594,6 +3598,7 @@ case $target_os in elif enabled arm; then LIBTARGET=arm-wince fi + enabled shared && check_cmd $windres --version && enable gnu_windres check_ldflags -Wl,--nxcompat check_ldflags -Wl,--dynamicbase shlibdir_default="$bindir_default" @@ -3656,6 +3661,7 @@ case $target_os in SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' objformat="win32" enable dos_paths + enabled shared && check_cmd $windres --version && enable gnu_windres ;; *-dos|freedos|opendos) network_extralibs="-lsocket" @@ -4831,6 +4837,7 @@ LD_O=$LD_O LD_LIB=$LD_LIB LD_PATH=$LD_PATH DLLTOOL=$dlltool +WINDRES=$windres LDFLAGS=$LDFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) YASMFLAGS=$YASMFLAGS @@ -4916,6 +4923,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 @@ -5016,6 +5024,51 @@ Cflags: -I\${includedir} EOF }
+windres_generate(){ + enabled gnu_windres || return 0 + name=$1 + shortname=${name#lib} + comment=$2 + capname=`echo $name | awk '{print toupper($0)}'` + version=${capname}_VERSION + enabled ${name#lib} || return 0 + mkdir -p $name + cat <<EOF > $name/${shortname}res.rc +#include <windows.h> +#include "$name/version.h" +#include "../version.h" +#include "config.h" + +1 VERSIONINFO +FILEVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +PRODUCTVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4"
040904B0 might be better (04B0 = Unicode, 04E4 = multilingual).
+ { + VALUE "CompanyName", "FFmpeg Project" + VALUE "FileDescription", "$comment" + VALUE "FileVersion", AV_STRINGIFY($version) + VALUE "InternalName", "$name" + VALUE "LegalCopyright", "Copyright (C) 2000-2013 FFmpeg Project"
This is the one thing that left me unsatisfied back when i first wrote this patch. It would be nice if 2013 could be replaced with a variable to avoid having to update it every year. Maybe moving "const int this_year = 2013;" from cmdutils.c to some header, changing it into a define and including it from the .rc files.
+ VALUE "OriginalFilename", "$shortname" BUILDSUF "-" AV_STRINGIFY(${version}_MAJOR) SLIBSUF + VALUE "ProductName", "FFmpeg" + VALUE "ProductVersion", FFMPEG_VERSION + } + } + + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x0409, 0x04E4
Same as above
+ } +} +EOF +} + lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION" enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION," enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION," @@ -5038,6 +5091,16 @@ pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVR pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION" pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
+windres_generate libavutil "FFmpeg utility library" +windres_generate libavcodec "FFmpeg codec library" +windres_generate libavformat "FFmpeg container format library" +windres_generate libavdevice "FFmpeg device handling library" +windres_generate libavfilter "FFmpeg audio/video filtering library" +windres_generate libpostproc "FFmpeg postprocessing library" +windres_generate libavresample "Libav audio resampling library" +windres_generate libswscale "FFmpeg image rescaling library" +windres_generate libswresample "FFmpeg audio resampling library" + fix_ffmpeg_remote(){ git_remote_from=$1 git_remote_to=$2 diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e8c1c1b..b0a5774 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -812,6 +812,9 @@ OBJS-$(HAVE_OS2THREADS) += pthread.o pthread_slice.o pthread_fram
OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o
+# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avcodecres.o + SKIPHEADERS += %_tablegen.h \ %_tables.h \ aac_tablegen_decl.h \ diff --git a/libavdevice/Makefile b/libavdevice/Makefile index 21ca954..9eb3d3b 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -51,6 +51,9 @@ OBJS-$(CONFIG_XV_OUTDEV) += xv.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-$(CONFIG_LIBPULSE) += pulse_audio_common.h SKIPHEADERS-$(CONFIG_V4L2_INDEV) += v4l2-common.h diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 7bd4323..12d803a 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -249,6 +249,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 + SKIPHEADERS-$(CONFIG_LIBVIDSTAB) += vidstabutils.h SKIPHEADERS-$(CONFIG_OPENCL) += opencl_internal.h deshake_opencl_kernel.h unsharp_opencl_kernel.h
diff --git a/libavformat/Makefile b/libavformat/Makefile index b08ce57..609c00f 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -463,6 +463,9 @@ OBJS-$(CONFIG_TLS_PROTOCOL) += tls.o OBJS-$(CONFIG_UDP_PROTOCOL) += udp.o OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.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/libavresample/Makefile b/libavresample/Makefile index 6805280..bca23a9 100644 --- a/libavresample/Makefile +++ b/libavresample/Makefile @@ -13,4 +13,7 @@ OBJS = audio_convert.o \ resample.o \ utils.o \
+# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avresampleres.o + TESTPROGS = avresample diff --git a/libavutil/Makefile b/libavutil/Makefile index 02dd728..9153818 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -121,6 +121,9 @@ OBJS-$(CONFIG_OPENCL) += opencl.o opencl_internal.o
OBJS += $(COMPAT_OBJS:%=../compat/%)
+# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o + SKIPHEADERS = old_pix_fmts.h
SKIPHEADERS-$(HAVE_ATOMICS_GCC) += atomic_gcc.h diff --git a/libpostproc/Makefile b/libpostproc/Makefile index 3fb5a70..b9bb4be 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) += postprocres.o diff --git a/library.mak b/library.mak index e48aba1..fe06057 100644 --- a/library.mak +++ b/library.mak @@ -51,7 +51,7 @@ $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) $(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) $(SLIB_EXTRA_CMD) diff --git a/libswresample/Makefile b/libswresample/Makefile index 0b75bd0..953c945 100644 --- a/libswresample/Makefile +++ b/libswresample/Makefile @@ -15,4 +15,7 @@ OBJS = audioconvert.o \ OBJS-$(CONFIG_LIBSOXR) += soxr_resample.o OBJS-$(CONFIG_SHARED) += log2_tab.o
+# Windows resource file +SLIBOBJS-$(HAVE_GNU_WINDRES) += swresampleres.o + TESTPROGS = swresample diff --git a/libswscale/Makefile b/libswscale/Makefile index dd00f7d..ca6e27d 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 \
On Mon, Nov 25, 2013 at 2:06 PM, James Almer <jamrial@gmail.com> wrote:
On 25/11/13 6:59 PM, Timothy Gu wrote:
Based on patch by: James Almer <jamrial@gmail.com>
Signed-off-by: Timothy Gu <timothygu99@gmail.com> ---
Sorry if the older patch in the thread doesn't apply.
---
Differences from James's version [1]: * Now generate the .rc files from configure (like we do with pkg-config files).
I'm not sure about this. They don't get installed, and having one .rc file per folder won't bother anyone, whereas the big generator function in configure will be a small nuisance with merges from libav. x264 and mplayer ship with the .rc files in the source tree and don't generate them either.
OK. How about adding this function as a standalone tool to tool/?
* Use descriptions of libraries from the pkg-config file generation function * Use "FFmpeg Project" as CompanyName like Alexander suggested in the old thread * Use "FFmpeg" for ProductName as MSDN says "name of the product with which the file is distributed" [2]. * Use FFmpeg's version (N-xxxxx-gxxxxxxx) for ProductVersion per MSDN [2].
[1] http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2012-September/131705.html [2] http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058.aspx
I'm fine with the changes. Afterwards we should try to extend this to also cover the executables, like Gianluigi Tiesi did on his repo.
Yeah, I was trying to do that too. But one step at a time, right?
Some comments below.
--- .gitignore | 1 + Makefile | 3 ++- common.mak | 9 +++++-- configure | 65 +++++++++++++++++++++++++++++++++++++++++++++++++- libavcodec/Makefile | 3 +++ libavdevice/Makefile | 3 +++ libavfilter/Makefile | 3 +++ libavformat/Makefile | 3 +++ libavresample/Makefile | 3 +++ libavutil/Makefile | 3 +++ libpostproc/Makefile | 3 +++ library.mak | 2 +- libswresample/Makefile | 3 +++ libswscale/Makefile | 3 +++ 14 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore index 7d8adda..8a63efc 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ *.lib *.pc *.pdb +*.rc *.so *.so.* *.ver diff --git a/Makefile b/Makefile index 10202d0..53b8841 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) @@ -74,7 +75,7 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \ 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 b22badd..0ddaaa5 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 $@ $< + %.i: %.c $(CC) $(CCFLAGS) $(CC_E) $<
@@ -82,6 +85,7 @@ endif include $(SRC_PATH)/arch.mak
OBJS += $(OBJS-yes) +SLIBOBJS += $(SLIBOBJS-yes) FFLIBS := $(FFLIBS-yes) $(FFLIBS) TESTPROGS += $(TESTPROGS-yes)
@@ -90,6 +94,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) @@ -127,7 +132,7 @@ $(TOOLOBJS): | tools OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda -DISTCLEANSUFFIXES = *.pc +DISTCLEANSUFFIXES = *.pc *.rc LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
define RULES diff --git a/configure b/configure index 6b0375b..b334898 100755 --- a/configure +++ b/configure @@ -267,6 +267,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] @@ -1478,6 +1479,7 @@ HAVE_LIST=" gettimeofday glob gnu_as + gnu_windres gsm_h ibm_asm inet_aton @@ -2325,6 +2327,7 @@ pkg_config_default=pkg-config ranlib="ranlib" strip_default="strip" yasmexe_default="yasm" +windres_default="windres"
nogas=":"
@@ -2594,6 +2597,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"
@@ -3112,7 +3116,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 @@ -3594,6 +3598,7 @@ case $target_os in elif enabled arm; then LIBTARGET=arm-wince fi + enabled shared && check_cmd $windres --version && enable gnu_windres check_ldflags -Wl,--nxcompat check_ldflags -Wl,--dynamicbase shlibdir_default="$bindir_default" @@ -3656,6 +3661,7 @@ case $target_os in SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a' objformat="win32" enable dos_paths + enabled shared && check_cmd $windres --version && enable gnu_windres ;; *-dos|freedos|opendos) network_extralibs="-lsocket" @@ -4831,6 +4837,7 @@ LD_O=$LD_O LD_LIB=$LD_LIB LD_PATH=$LD_PATH DLLTOOL=$dlltool +WINDRES=$windres LDFLAGS=$LDFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) YASMFLAGS=$YASMFLAGS @@ -4916,6 +4923,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 @@ -5016,6 +5024,51 @@ Cflags: -I\${includedir} EOF }
+windres_generate(){ + enabled gnu_windres || return 0 + name=$1 + shortname=${name#lib} + comment=$2 + capname=`echo $name | awk '{print toupper($0)}'` + version=${capname}_VERSION + enabled ${name#lib} || return 0 + mkdir -p $name + cat <<EOF > $name/${shortname}res.rc +#include <windows.h> +#include "$name/version.h" +#include "../version.h" +#include "config.h" + +1 VERSIONINFO +FILEVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +PRODUCTVERSION ${version}_MAJOR, ${version}_MINOR, ${version}_MICRO, 0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEOS VOS_NT_WINDOWS32 +FILETYPE VFT_DLL +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4"
040904B0 might be better (04B0 = Unicode, 04E4 = multilingual).
Well, they are probably the same, but 0x04b0 seems more specific.
+ { + VALUE "CompanyName", "FFmpeg Project" + VALUE "FileDescription", "$comment" + VALUE "FileVersion", AV_STRINGIFY($version) + VALUE "InternalName", "$name" + VALUE "LegalCopyright", "Copyright (C) 2000-2013 FFmpeg Project"
This is the one thing that left me unsatisfied back when i first wrote this patch. It would be nice if 2013 could be replaced with a variable to avoid having to update it every year. Maybe moving "const int this_year = 2013;" from cmdutils.c to some header, changing it into a define and including it from the .rc files.
[...] Timothy
On 25/11/13 9:26 PM, Timothy Gu wrote:
On Mon, Nov 25, 2013 at 2:06 PM, James Almer <jamrial@gmail.com> wrote:
On 25/11/13 6:59 PM, Timothy Gu wrote:
Based on patch by: James Almer <jamrial@gmail.com>
Signed-off-by: Timothy Gu <timothygu99@gmail.com> ---
Sorry if the older patch in the thread doesn't apply.
---
Differences from James's version [1]: * Now generate the .rc files from configure (like we do with pkg-config files).
I'm not sure about this. They don't get installed, and having one .rc file per folder won't bother anyone, whereas the big generator function in configure will be a small nuisance with merges from libav. x264 and mplayer ship with the .rc files in the source tree and don't generate them either.
OK. How about adding this function as a standalone tool to tool/?
Why do you want the .rc files to be generated at configure/compile time? Every library specific value that is not hardcoded can be taken from C headers unlike with pkg-config files (Which is why they get generated). And regarding a standalone script, we currently don't include any scripts in configure, so i think it's better to have this function in configure as well if it comes to it. Does anyone else have an opinion about all this?
participants (6)
-
Alexander Strasser -
jamal -
James Almer -
Michael Niedermayer -
Stefano Sabatini -
Timothy Gu