Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common option

2017-11-16 Thread Li, Zhong
> From: libav-devel [mailto:libav-devel-boun...@libav.org] On Behalf Of
> Maxym Dmytrychenko
> Sent: Thursday, November 16, 2017 6:23 AM
> To: libav development 
> Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of common
> option
> 
> I would leave it as it is now

Yeah, it is not high priority since FF_API_CODER_TYPE hasn't been removed now.

> 
> On Wed, Nov 15, 2017 at 4:09 PM, Li, Zhong  wrote:
> 
> > > From: libav-devel [mailto:libav-devel-boun...@libav.org] On Behalf
> > > Of Maxym Dmytrychenko
> > > Sent: Monday, November 13, 2017 9:04 PM
> > > To: libav development 
> > > Subject: Re: [libav-devel] [PATCH 1/2] qsvenc: move cavlc out of
> > > common option
> > >
> > > correct fix
> >
> > I have an idea to rename the "calvc" option to be "coder", which can
> > be aligned with x264. But I am not sure it will have any compatibility
> > issues or not for old version.
> > Any comment?

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] makedef: Pass EXTERN_PREFIX from configure to makedef

2017-11-16 Thread James Almer
On 11/16/2017 5:00 AM, Martin Storsjö wrote:
> This avoids having to use either "dumpbin -headers" to find out
> the current architecture, or pass $ARCH from configure to deduce it.
> 
> When configuring with --disable-asm, ARCH is equal to "c", which doesn't
> give any indication of what symbol prefix is to be used.
> ---
>  compat/windows/makedef | 28 +---
>  configure  |  5 +++--
>  2 files changed, 4 insertions(+), 29 deletions(-)
> 
> diff --git a/compat/windows/makedef b/compat/windows/makedef
> index 0cd169c..7258b94 100755
> --- a/compat/windows/makedef
> +++ b/compat/windows/makedef
> @@ -58,33 +58,7 @@ fi
>  IFS='
>  '
>  
> -# Determine if we're building for x86 or x86_64 and
> -# set the symbol prefix accordingly.
> -prefix=""
> -if [ -n "$NM" ]; then
> -case $ARCH in
> -*86)
> -prefix="_"
> -;;
> -*)
> -;;
> -esac
> -else
> -arch=$(dumpbin -headers ${libname} |
> -   tr '\t' ' ' |
> -   grep '^ \+.\+machine \+(.\+)' |
> -   head -1 |
> -   sed -e 's/^ \{1,\}.\{1,\} \{1,\}machine 
> \{1,\}(\(.\{3,5\}\)).*/\1/')
> -
> -if [ "${arch}" = "x86" ]; then
> -prefix="_"
> -else
> -if [ "${arch}" != "ARM" ] && [ "${arch}" != "x64" ] && [ "${arch}" 
> != "ARM64" ]; then
> -echo "Unknown machine type." >&2
> -exit 1
> -fi
> -fi
> -fi
> +prefix="$EXTERN_PREFIX"
>  
>  started=0
>  regex="none"
> diff --git a/configure b/configure
> index 3bad7fb..fcffbce 100755
> --- a/configure
> +++ b/configure
> @@ -3898,7 +3898,7 @@ case $target_os in
>  SLIB_INSTALL_LINKS=
>  SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
>  SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
> $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
> -SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" 
> $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > 
> $$(@:$(SLIBSUF)=.def)'
> +SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" 
> NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver 
> $(OBJS) > $$(@:$(SLIBSUF)=.def)'
>  SHFLAGS='-shared 
> -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
> -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
>  enabled x86_64 && objformat="win64" || objformat="win32"
>  ranlib=:
> @@ -3918,7 +3918,7 @@ case $target_os in
>  SLIBSUF=".dll"
>  SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
>  SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
> -SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef 
> $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
> +SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" 
> $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > 
> $$(@:$(SLIBSUF)=.def)'
>  SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
>  SLIB_INSTALL_LINKS=
>  SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
> @@ -5210,6 +5210,7 @@ SRC_PATH=$source_path
>  CC_IDENT=$cc_ident
>  ARCH=$arch
>  INTRINSICS=$intrinsics
> +EXTERN_PREFIX=$extern_prefix
>  CC=$cc
>  AS=$as
>  OBJCC=$objcc

LGTM.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] configure: export extern_prefix to use with makedef

2017-11-16 Thread James Almer
On 11/16/2017 11:17 AM, James Almer wrote:
> No point in trying to guess it from within makedef when configure
> already did it before.
> 
> Fixes linking failures on x86_32 when "arch" isn't one of the values
> makedef was expecting.
> 
> Signed-off-by: James Almer 
> ---
>  compat/windows/makedef | 29 ++---
>  configure  |  3 ++-
>  2 files changed, 4 insertions(+), 28 deletions(-)

Right, i should remember to look at existing patches in the ML before
writing and sending stuff myself.

Patch obviously dropped for being a duplicate of one sent hours ago.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] configure: export extern_prefix to use with makedef

2017-11-16 Thread James Almer
No point in trying to guess it from within makedef when configure
already did it before.

Fixes linking failures on x86_32 when "arch" isn't one of the values
makedef was expecting.

Signed-off-by: James Almer 
---
 compat/windows/makedef | 29 ++---
 configure  |  3 ++-
 2 files changed, 4 insertions(+), 28 deletions(-)

diff --git a/compat/windows/makedef b/compat/windows/makedef
index 0cd169c15c..e4eeb56877 100755
--- a/compat/windows/makedef
+++ b/compat/windows/makedef
@@ -58,33 +58,8 @@ fi
 IFS='
 '
 
-# Determine if we're building for x86 or x86_64 and
-# set the symbol prefix accordingly.
-prefix=""
-if [ -n "$NM" ]; then
-case $ARCH in
-*86)
-prefix="_"
-;;
-*)
-;;
-esac
-else
-arch=$(dumpbin -headers ${libname} |
-   tr '\t' ' ' |
-   grep '^ \+.\+machine \+(.\+)' |
-   head -1 |
-   sed -e 's/^ \{1,\}.\{1,\} \{1,\}machine \{1,\}(\(.\{3,5\}\)).*/\1/')
-
-if [ "${arch}" = "x86" ]; then
-prefix="_"
-else
-if [ "${arch}" != "ARM" ] && [ "${arch}" != "x64" ] && [ "${arch}" != 
"ARM64" ]; then
-echo "Unknown machine type." >&2
-exit 1
-fi
-fi
-fi
+# Symbol prefix, guessed by configure
+prefix=$EXTERN_PREFIX
 
 started=0
 regex="none"
diff --git a/configure b/configure
index 3bad7fb72c..221f9fd127 100755
--- a/configure
+++ b/configure
@@ -3898,7 +3898,7 @@ case $target_os in
 SLIB_INSTALL_LINKS=
 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
 SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
-SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" 
$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > 
$$(@:$(SLIBSUF)=.def)'
+SLIB_CREATE_DEF_CMD='AR="$(AR_CMD)" NM="$(NM_CMD)" 
EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef 
$(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
 SHFLAGS='-shared 
-Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
-Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
 enabled x86_64 && objformat="win64" || objformat="win32"
 ranlib=:
@@ -5257,6 +5257,7 @@ LIBNAME=$LIBNAME
 SLIBPREF=$SLIBPREF
 SLIBSUF=$SLIBSUF
 EXESUF=$EXESUF
+EXTERN_PREFIX=$extern_prefix
 EXTRA_VERSION=$extra_version
 CCDEP=$CCDEP
 CCDEP_FLAGS=$CCDEP_FLAGS
-- 
2.14.2

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] libavcodec: Don't use dllexport, only dllimport when building DLLs

2017-11-16 Thread Martin Storsjö
The only purpose of dllexport (which is set while building the library
that exports the symbols) is to have the linker automatically
export such symbols into a DLL without using a def file - it doesn't
affect the generated code.

For MSVC builds, this isn't essential since we override what symbols
to export via an autogenerated def file instead.

Update a comment in configure to refer to the right concept.

With lld, this avoids warnings about duplicate export directives,
when some symbols are requested to be exported both via dllexport
attributes and via the autogenerated def file.

This also reduces the number of lines of code marginally.
---
 configure | 2 +-
 libavcodec/internal.h | 6 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 3bad7fb..62dffd4 100755
--- a/configure
+++ b/configure
@@ -3883,7 +3883,7 @@ case $target_os in
 mingw32*|mingw64*)
 target_os=mingw32
 if enabled shared; then
-# Cannot build both shared and static libs when using dllexport.
+# Cannot build both shared and static libs when using dllimport.
 disable static
 fi
 check_ldflags -Wl,--nxcompat
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index da1b2fa..868e3df 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -285,12 +285,8 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame 
*frame);
  */
 AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx);
 
-#if defined(_WIN32) && CONFIG_SHARED
-#ifdef BUILDING_avcodec
-#define av_export_avcodec __declspec(dllexport)
-#else
+#if defined(_WIN32) && CONFIG_SHARED && !defined(BUILDING_avcodec)
 #define av_export_avcodec __declspec(dllimport)
-#endif
 #else
 #define av_export_avcodec
 #endif
-- 
2.7.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] makedef: Pass EXTERN_PREFIX from configure to makedef

2017-11-16 Thread Martin Storsjö
This avoids having to use either "dumpbin -headers" to find out
the current architecture, or pass $ARCH from configure to deduce it.

When configuring with --disable-asm, ARCH is equal to "c", which doesn't
give any indication of what symbol prefix is to be used.
---
 compat/windows/makedef | 28 +---
 configure  |  5 +++--
 2 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/compat/windows/makedef b/compat/windows/makedef
index 0cd169c..7258b94 100755
--- a/compat/windows/makedef
+++ b/compat/windows/makedef
@@ -58,33 +58,7 @@ fi
 IFS='
 '
 
-# Determine if we're building for x86 or x86_64 and
-# set the symbol prefix accordingly.
-prefix=""
-if [ -n "$NM" ]; then
-case $ARCH in
-*86)
-prefix="_"
-;;
-*)
-;;
-esac
-else
-arch=$(dumpbin -headers ${libname} |
-   tr '\t' ' ' |
-   grep '^ \+.\+machine \+(.\+)' |
-   head -1 |
-   sed -e 's/^ \{1,\}.\{1,\} \{1,\}machine \{1,\}(\(.\{3,5\}\)).*/\1/')
-
-if [ "${arch}" = "x86" ]; then
-prefix="_"
-else
-if [ "${arch}" != "ARM" ] && [ "${arch}" != "x64" ] && [ "${arch}" != 
"ARM64" ]; then
-echo "Unknown machine type." >&2
-exit 1
-fi
-fi
-fi
+prefix="$EXTERN_PREFIX"
 
 started=0
 regex="none"
diff --git a/configure b/configure
index 3bad7fb..fcffbce 100755
--- a/configure
+++ b/configure
@@ -3898,7 +3898,7 @@ case $target_os in
 SLIB_INSTALL_LINKS=
 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
 SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
-SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" 
$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > 
$$(@:$(SLIBSUF)=.def)'
+SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" 
NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver 
$(OBJS) > $$(@:$(SLIBSUF)=.def)'
 SHFLAGS='-shared 
-Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) 
-Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
 enabled x86_64 && objformat="win64" || objformat="win32"
 ranlib=:
@@ -3918,7 +3918,7 @@ case $target_os in
 SLIBSUF=".dll"
 SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
 SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
-SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef 
$(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
+SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" 
$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > 
$$(@:$(SLIBSUF)=.def)'
 SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
 SLIB_INSTALL_LINKS=
 SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
@@ -5210,6 +5210,7 @@ SRC_PATH=$source_path
 CC_IDENT=$cc_ident
 ARCH=$arch
 INTRINSICS=$intrinsics
+EXTERN_PREFIX=$extern_prefix
 CC=$cc
 AS=$as
 OBJCC=$objcc
-- 
2.7.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel