[FFmpeg-cvslog] r23610 - in branches/0.6: configure libavformat/utils.c

siretart subversion
Tue Jun 15 14:29:19 CEST 2010


Author: siretart
Date: Tue Jun 15 14:29:19 2010
New Revision: 23610

Log:
add symver hacks for gnu linkers

this patch restores binary compatibility for the av_*_packet symbols that have
been moved from libavformat to libavcodec.  This patch works for gnu toolchains
only; support for ARM RCVT will be handed in for a later point release as soon
as the patch is ready and approved by the ARM maintainer(s).

Modified:
   branches/0.6/configure
   branches/0.6/libavformat/utils.c

Modified: branches/0.6/configure
==============================================================================
--- branches/0.6/configure	Tue Jun 15 12:14:19 2010	(r23609)
+++ branches/0.6/configure	Tue Jun 15 14:29:19 2010	(r23610)
@@ -1086,6 +1086,7 @@ HAVE_LIST="
     struct_sockaddr_in6
     struct_sockaddr_sa_len
     struct_sockaddr_storage
+    gnu_symbol_versioning
     sys_mman_h
     sys_resource_h
     sys_select_h
@@ -2733,7 +2734,12 @@ check_ldflags -Wl,-Bsymbolic
 
 echo "X{};" > $TMPV
 test_ldflags -Wl,--version-script,$TMPV &&
-    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
+    append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' &&
+    check_cc <<EOF && enable gnu_symbol_versioning
+int ff_foo();
+int ff_foo() {}
+__asm__(".symver foo,av_foo at SOME_TAG");
+EOF
 
 if enabled small; then
     add_cflags $size_cflags

Modified: branches/0.6/libavformat/utils.c
==============================================================================
--- branches/0.6/libavformat/utils.c	Tue Jun 15 12:14:19 2010	(r23609)
+++ branches/0.6/libavformat/utils.c	Tue Jun 15 14:29:19 2010	(r23610)
@@ -282,8 +282,54 @@ AVInputFormat *av_find_input_format(cons
     return NULL;
 }
 
-/* memory handling */
+#if HAVE_GNU_SYMBOL_VERSIONING && LIBAVFORMAT_VERSION_MAJOR < 53
+/* compatibility trampolines for packet functions */
+
+void ff_av_destruct_packet_nofree(AVPacket *pkt);
+void ff_av_destruct_packet(AVPacket *pkt);
+int ff_av_new_packet(AVPacket *pkt, int size);
+int ff_av_dup_packet(AVPacket *pkt);
+void ff_av_free_packet(AVPacket *pkt);
+void ff_av_init_packet(AVPacket *pkt);
+
+__asm__(".symver ff_av_destruct_packet_nofree,av_destruct_packet_nofree at LIBAVFORMAT_52");
+__asm__(".symver ff_av_destruct_packet,av_destruct_packet at LIBAVFORMAT_52");
+__asm__(".symver ff_av_new_packet,av_new_packet at LIBAVFORMAT_52");
+__asm__(".symver ff_av_dup_packet,av_dup_packet at LIBAVFORMAT_52");
+__asm__(".symver ff_av_free_packet,av_free_packet at LIBAVFORMAT_52");
+__asm__(".symver ff_av_init_packet,av_init_packet at LIBAVFORMAT_52");
+
+void ff_av_destruct_packet_nofree(AVPacket *pkt)
+{
+    av_destruct_packet_nofree(pkt);
+}
+
+void ff_av_destruct_packet(AVPacket *pkt)
+{
+    av_destruct_packet(pkt);
+}
+
+int ff_av_new_packet(AVPacket *pkt, int size)
+{
+    return av_new_packet(pkt, size);
+}
+
+int ff_av_dup_packet(AVPacket *pkt)
+{
+    return av_dup_packet(pkt);
+}
+
+void ff_av_free_packet(AVPacket *pkt)
+{
+    av_free_packet(pkt);
+}
 
+void ff_av_init_packet(AVPacket *pkt)
+{
+    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)
 {



More information about the ffmpeg-cvslog mailing list