[FFmpeg-cvslog] r23613 - in branches/0.6: . configure libavformat/utils.c libavutil/internal.h

siretart subversion
Tue Jun 15 15:31:27 CEST 2010


Author: siretart
Date: Tue Jun 15 15:31:27 2010
New Revision: 23613

Log:
Add compatibility wrappers for functions moved from lavf to lavc

When symbol versioning is enabled, moving symbols from one library to
another breaks binary compatibility.  This adds wrappers with the old
version tag for the av_*packet functions recently moved to lavc.

backport r23611 by mru

Modified:
   branches/0.6/   (props changed)
   branches/0.6/configure
   branches/0.6/libavformat/utils.c
   branches/0.6/libavutil/internal.h

Modified: branches/0.6/configure
==============================================================================
--- branches/0.6/configure	Tue Jun 15 15:29:20 2010	(r23612)
+++ branches/0.6/configure	Tue Jun 15 15:31:27 2010	(r23613)
@@ -1086,6 +1086,9 @@ HAVE_LIST="
     struct_sockaddr_in6
     struct_sockaddr_sa_len
     struct_sockaddr_storage
+    symver
+    symver_gnu_asm
+    symver_asm_label
     sys_mman_h
     sys_resource_h
     sys_select_h
@@ -1200,6 +1203,8 @@ fast_unaligned_if_any="armv6 ppc x86"
 need_memalign="altivec neon sse"
 inline_asm_deps="!tms470"
 
+symver_if_any="symver_asm_label symver_gnu_asm"
+
 # subsystems
 mdct_select="fft"
 rdft_select="fft"
@@ -2732,8 +2737,17 @@ check_ldflags '-Wl,-rpath-link,\$(BUILD_
 check_ldflags -Wl,-Bsymbolic
 
 echo "X{};" > $TMPV
-test_ldflags -Wl,--version-script,$TMPV &&
+if test_ldflags -Wl,--version-script,$TMPV; then
     append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
+    check_cc <<EOF && enable symver_asm_label
+void ff_foo(void) __asm__ ("av_foo at VERSION");
+void ff_foo(void) {}
+EOF
+    check_cc <<EOF && enable symver_gnu_asm
+__asm__(".symver ff_foo,av_foo at VERSION");
+void ff_foo(void) {}
+EOF
+fi
 
 if enabled small; then
     add_cflags $size_cflags

Modified: branches/0.6/libavformat/utils.c
==============================================================================
--- branches/0.6/libavformat/utils.c	Tue Jun 15 15:29:20 2010	(r23612)
+++ branches/0.6/libavformat/utils.c	Tue Jun 15 15:31:27 2010	(r23613)
@@ -282,8 +282,38 @@ AVInputFormat *av_find_input_format(cons
     return NULL;
 }
 
-/* memory handling */
+#if LIBAVFORMAT_VERSION_MAJOR < 53 && CONFIG_SHARED && HAVE_SYMVER
+FF_SYMVER(void, av_destruct_packet_nofree, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+    av_destruct_packet_nofree(pkt);
+}
+
+FF_SYMVER(void, av_destruct_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+    av_destruct_packet(pkt);
+}
+
+FF_SYMVER(int, av_new_packet, (AVPacket *pkt, int size), "LIBAVFORMAT_52")
+{
+    return av_new_packet(pkt, size);
+}
 
+FF_SYMVER(int, av_dup_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+    return av_dup_packet(pkt);
+}
+
+FF_SYMVER(void, av_free_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+    av_free_packet(pkt);
+}
+
+FF_SYMVER(void, av_init_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
+{
+    av_log(NULL, AV_LOG_WARNING, "Diverting av_*_packet function calls to libavcodec. Recompile to improve performance\n");
+    av_init_packet(pkt);
+}
+#endif
 
 int av_get_packet(ByteIOContext *s, AVPacket *pkt, int size)
 {

Modified: branches/0.6/libavutil/internal.h
==============================================================================
--- branches/0.6/libavutil/internal.h	Tue Jun 15 15:29:20 2010	(r23612)
+++ branches/0.6/libavutil/internal.h	Tue Jun 15 15:31:27 2010	(r23613)
@@ -204,4 +204,15 @@
 #   define NULL_IF_CONFIG_SMALL(x) x
 #endif
 
+#if HAVE_SYMVER_ASM_LABEL
+#   define FF_SYMVER(type, name, args, ver)             \
+    type ff_##name args __asm__ (#name "@" ver);        \
+    type ff_##name args
+#elif HAVE_SYMVER_GNU_ASM
+#   define FF_SYMVER(type, name, args, ver)             \
+    __asm__ (".symver ff_" #name "," #name "@" ver);    \
+    type ff_##name args;                                \
+    type ff_##name args
+#endif
+
 #endif /* AVUTIL_INTERNAL_H */



More information about the ffmpeg-cvslog mailing list