Bug 709721 - Move video and audio libraries in a gkmedias library on Windows. r=khuey
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 15 Dec 2011 06:40:20 +0100
changeset 82625 9123d35faa6cb445bf6f10eb38f57b0d6c76d0f7
parent 82624 719b47a9f052a8c6269a8c4dac2c4c3414bd8251
child 82626 9a591b2904316d6eff7b38556b5c83c9fac96a1c
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs709721
milestone11.0a1
Bug 709721 - Move video and audio libraries in a gkmedias library on Windows. r=khuey
browser/installer/package-manifest.in
config/system-headers
js/src/config/system-headers
layout/Makefile.in
layout/build/Makefile.in
layout/media/Makefile.in
layout/media/symbols.def
media/libnestegg/src/Makefile.in
media/libogg/src/Makefile.in
media/libsydneyaudio/src/Makefile.in
media/libtheora/lib/Makefile.in
media/libvorbis/lib/Makefile.in
media/libvpx/Makefile.in
mobile/xul/installer/package-manifest.in
toolkit/library/Makefile.in
xpcom/stub/Makefile.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -53,16 +53,17 @@
 #endif
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 @BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
 #else
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 #endif
 #ifdef XP_WIN32
+@BINPATH@/@DLL_PREFIX@gkmedias@DLL_SUFFIX@
 #if _MSC_VER == 1400
 @BINPATH@/Microsoft.VC80.CRT.manifest
 @BINPATH@/msvcm80.dll
 @BINPATH@/msvcp80.dll
 @BINPATH@/msvcr80.dll
 #elif _MSC_VER == 1500
 @BINPATH@/Microsoft.VC90.CRT.manifest
 @BINPATH@/msvcm90.dll
--- a/config/system-headers
+++ b/config/system-headers
@@ -1032,8 +1032,19 @@ pixman.h
 #endif
 #if MOZ_ENABLE_MEEGOTOUCHSHARE
 shareuiinterface.h
 #endif
 #if MOZ_NATIVE_LIBVPX==1
 vpx/vpx_decoder.h
 vpx/vp8dx.h
 #endif
+#ifdef XP_WIN
+vpx/vpx_decoder.h
+vpx/vp8dx.h
+sydneyaudio/sydney_audio.h
+vorbis/codec.h
+theora/theoradec.h
+tremor/ivorbiscodec.h
+ogg/ogg.h
+ogg/os_types.h
+nestegg/nestegg.h
+#endif
--- a/js/src/config/system-headers
+++ b/js/src/config/system-headers
@@ -1032,8 +1032,19 @@ pixman.h
 #endif
 #if MOZ_ENABLE_MEEGOTOUCHSHARE
 shareuiinterface.h
 #endif
 #if MOZ_NATIVE_LIBVPX==1
 vpx/vpx_decoder.h
 vpx/vp8dx.h
 #endif
+#ifdef XP_WIN
+vpx/vpx_decoder.h
+vpx/vp8dx.h
+sydneyaudio/sydney_audio.h
+vorbis/codec.h
+theora/theoradec.h
+tremor/ivorbiscodec.h
+ogg/ogg.h
+ogg/os_types.h
+nestegg/nestegg.h
+#endif
--- a/layout/Makefile.in
+++ b/layout/Makefile.in
@@ -62,16 +62,17 @@ PARALLEL_DIRS += printing
 endif
 
 PARALLEL_DIRS += inspector/public inspector/src
 ifdef ENABLE_TESTS
 PARALLEL_DIRS += inspector/tests inspector/tests/chrome
 endif
 
 DIRS           += build
+DIRS           += media
 
 ifdef ENABLE_TESTS
 PARALLEL_DIRS += \
   mathml/tests \
   xul/test \
   xul/base/test \
   $(NULL)
 
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -145,69 +145,47 @@ LOCAL_INCLUDES	+= \
 	-I$(topsrcdir)/dom/system \
 	$(NULL)
 endif
 
 ifdef MOZ_B2G_RIL #{
 SHARED_LIBRARY_LIBS	+= $(DEPTH)/dom/system/b2g/$(LIB_PREFIX)domsystemb2g_s.$(LIB_SUFFIX)
 endif #}
 
-ifdef MOZ_VORBIS
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libvorbis/lib/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \
-	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
-ifdef MOZ_TREMOR
-SHARED_LIBRARY_LIBS	+= \
-	$(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \
-	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
-	$(NULL)
-endif
-
 ifdef MOZ_MEDIA
 SHARED_LIBRARY_LIBS 	+= \
 	$(DEPTH)/content/media/$(LIB_PREFIX)gkconmedia_s.$(LIB_SUFFIX) \
 	$(NULL)
 endif
 
 ifdef MOZ_OGG
 SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \
 	$(DEPTH)/content/media/ogg/$(LIB_PREFIX)gkconogg_s.$(LIB_SUFFIX) \
 	$(NULL)
 endif
 
 ifdef MOZ_RAW
 SHARED_LIBRARY_LIBS     += \
        $(DEPTH)/content/media/raw/$(LIB_PREFIX)gkconraw_s.$(LIB_SUFFIX)\
        $(NULL)
 endif
 
 ifdef MOZ_WEBM
 SHARED_LIBRARY_LIBS 	+= \
 	$(DEPTH)/content/media/webm/$(LIB_PREFIX)gkconwebm_s.$(LIB_SUFFIX) \
-	$(DEPTH)/media/libnestegg/src/$(LIB_PREFIX)nestegg.$(LIB_SUFFIX) \
 	$(NULL)
-ifndef MOZ_NATIVE_LIBVPX
-SHARED_LIBRARY_LIBS 	+= $(DEPTH)/media/libvpx/$(LIB_PREFIX)vpx.$(LIB_SUFFIX)
-endif
 endif
 
 ifdef MOZ_WAVE
 SHARED_LIBRARY_LIBS 	+= \
 	$(DEPTH)/content/media/wave/$(LIB_PREFIX)gkconwave_s.$(LIB_SUFFIX) \
 	$(NULL)
 endif
 
 ifdef MOZ_SYDNEYAUDIO
-SHARED_LIBRARY_LIBS 	+= \
-	$(DEPTH)/media/libsydneyaudio/src/$(LIB_PREFIX)sydneyaudio.$(LIB_SUFFIX) \
-	$(NULL)
 LOCAL_INCLUDES += -I$(DEPTH)/content/html/content/src
 endif
 
 ifdef NS_PRINTING
 SHARED_LIBRARY_LIBS += \
 		../printing/$(LIB_PREFIX)gkprinting_s.$(LIB_SUFFIX) \
 		$(NULL)
 endif
new file mode 100644
--- /dev/null
+++ b/layout/media/Makefile.in
@@ -0,0 +1,93 @@
+#
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is mozilla.org code.
+#
+# The Initial Developer of the Original Code is
+# Mozilla Foundation.
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either of the GNU General Public License Version 2 or later (the "GPL"),
+# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH		= ../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE		= layout
+LIBRARY_NAME	= gkmedias
+EXPORT_LIBRARY	= $(DIST)/lib
+ifeq (WINNT,$(OS_TARGET))
+FORCE_SHARED_LIB = 1
+endif
+
+SHARED_LIBRARY_LIBS =
+
+ifdef MOZ_VORBIS
+SHARED_LIBRARY_LIBS 	+= \
+	$(DEPTH)/media/libvorbis/lib/$(LIB_PREFIX)vorbis.$(LIB_SUFFIX) \
+	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+	$(NULL)
+endif
+
+ifdef MOZ_TREMOR
+SHARED_LIBRARY_LIBS	+= \
+	$(DEPTH)/media/libtremor/lib/$(LIB_PREFIX)tremor.$(LIB_SUFFIX) \
+	$(DEPTH)/media/libogg/src/$(LIB_PREFIX)ogg.$(LIB_SUFFIX) \
+	$(NULL)
+endif
+
+ifdef MOZ_OGG
+SHARED_LIBRARY_LIBS 	+= \
+	$(DEPTH)/media/libtheora/lib/$(LIB_PREFIX)theora.$(LIB_SUFFIX) \
+	$(NULL)
+endif
+
+ifdef MOZ_WEBM
+SHARED_LIBRARY_LIBS 	+= \
+	$(DEPTH)/media/libnestegg/src/$(LIB_PREFIX)nestegg.$(LIB_SUFFIX) \
+	$(NULL)
+ifndef MOZ_NATIVE_LIBVPX
+SHARED_LIBRARY_LIBS 	+= $(DEPTH)/media/libvpx/$(LIB_PREFIX)vpx.$(LIB_SUFFIX)
+endif
+endif
+
+ifdef MOZ_SYDNEYAUDIO
+SHARED_LIBRARY_LIBS 	+= \
+	$(DEPTH)/media/libsydneyaudio/src/$(LIB_PREFIX)sydneyaudio.$(LIB_SUFFIX) \
+	$(NULL)
+endif
+
+ifeq (WINNT,$(OS_TARGET))
+DEFFILE = $(srcdir)/symbols.def
+endif
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/layout/media/symbols.def
@@ -0,0 +1,79 @@
+LIBRARY gkmedias.dll
+EXPORTS
+nestegg_destroy
+nestegg_duration
+nestegg_free_packet
+nestegg_init
+nestegg_packet_count
+nestegg_packet_data
+nestegg_packet_track
+nestegg_packet_tstamp
+nestegg_read_packet
+nestegg_track_audio_params
+nestegg_track_codec_data
+nestegg_track_codec_data_count
+nestegg_track_codec_id
+nestegg_track_count
+nestegg_track_seek
+nestegg_track_type
+nestegg_track_video_params
+nestegg_tstamp_scale
+ogg_page_bos
+ogg_page_granulepos
+ogg_page_serialno
+ogg_stream_check
+ogg_stream_clear
+ogg_stream_init
+ogg_stream_packetout
+ogg_stream_pagein
+ogg_stream_reset
+ogg_sync_buffer
+ogg_sync_clear
+ogg_sync_init
+ogg_sync_pageseek
+ogg_sync_reset
+ogg_sync_wrote
+sa_stream_create_pcm
+sa_stream_destroy
+sa_stream_drain
+sa_stream_get_min_write
+sa_stream_get_position
+sa_stream_get_write_size
+sa_stream_open
+sa_stream_pause
+sa_stream_resume
+sa_stream_write
+th_comment_clear
+th_comment_init
+th_decode_alloc
+th_decode_free
+th_decode_headerin
+th_decode_packetin
+th_decode_ycbcr_out
+th_granule_frame
+th_info_clear
+th_info_init
+th_packet_isheader
+th_packet_iskeyframe
+th_setup_free
+vorbis_block_clear
+vorbis_block_init
+vorbis_comment_clear
+vorbis_comment_init
+vorbis_dsp_clear
+vorbis_info_clear
+vorbis_info_init
+vorbis_packet_blocksize
+vorbis_synthesis
+vorbis_synthesis_blockin
+vorbis_synthesis_headerin
+vorbis_synthesis_init
+vorbis_synthesis_pcmout
+vorbis_synthesis_read
+vorbis_synthesis_restart
+vpx_codec_dec_init_ver
+vpx_codec_decode
+vpx_codec_destroy
+vpx_codec_get_frame
+vpx_codec_peek_stream_info
+vpx_codec_vp8_dx_algo
--- a/media/libnestegg/src/Makefile.in
+++ b/media/libnestegg/src/Makefile.in
@@ -40,15 +40,18 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= nestegg
 LIBRARY_NAME	= nestegg
 FORCE_STATIC_LIB= 1
+ifeq (WINNT,$(OS_TARGET))
+VISIBILITY_FLAGS =
+endif
 
 CSRCS		= \
 		nestegg.c \
 		halloc.c \
 		$(NULL)
 		
 include $(topsrcdir)/config/rules.mk
--- a/media/libogg/src/Makefile.in
+++ b/media/libogg/src/Makefile.in
@@ -39,15 +39,18 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= ogg
 LIBRARY_NAME	= ogg
 FORCE_STATIC_LIB= 1
+ifeq (WINNT,$(OS_TARGET))
+VISIBILITY_FLAGS =
+endif
 
 CSRCS		= \
 		ogg_bitwise.c \
 		ogg_framing.c \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/media/libsydneyaudio/src/Makefile.in
+++ b/media/libsydneyaudio/src/Makefile.in
@@ -39,16 +39,19 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= sydneyaudio
 LIBRARY_NAME	= sydneyaudio
 FORCE_STATIC_LIB= 1
+ifeq (WINNT,$(OS_TARGET))
+VISIBILITY_FLAGS =
+endif
 
 ifneq (,$(filter DragonFly FreeBSD GNU GNU_% NetBSD OpenBSD,$(OS_ARCH)))
 CSRCS		= \
 		sydney_audio_oss.c \
 		$(NULL)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
--- a/media/libtheora/lib/Makefile.in
+++ b/media/libtheora/lib/Makefile.in
@@ -38,16 +38,19 @@ DEPTH     = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE           = theora
 LIBRARY_NAME     = theora
 FORCE_STATIC_LIB = 1
+ifeq (WINNT,$(OS_TARGET))
+VISIBILITY_FLAGS =
+endif
 
 # The encoder is currently not included.
 DEFINES += -DTHEORA_DISABLE_ENCODE
 
 ifeq ($(findstring 86,$(OS_TEST)), 86)
 ifneq ($(OS_ARCH),SunOS)
 ifneq ($(OS_ARCH)$(OS_TEST),WINNTx86_64)
 ifndef MOZ_NO_THEORA_ASM
--- a/media/libvorbis/lib/Makefile.in
+++ b/media/libvorbis/lib/Makefile.in
@@ -39,16 +39,19 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= vorbis
 LIBRARY_NAME	= vorbis
 FORCE_STATIC_LIB= 1
+ifeq (WINNT,$(OS_TARGET))
+VISIBILITY_FLAGS =
+endif
 
 CSRCS		= \
 		vorbis_mdct.c \
 		vorbis_smallft.c \
 		vorbis_block.c \
 		vorbis_info.c \
 		vorbis_envelope.c \
 		vorbis_window.c \
--- a/media/libvpx/Makefile.in
+++ b/media/libvpx/Makefile.in
@@ -42,16 +42,19 @@ VPATH = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 DEFINES += -DHAVE_CONFIG_H=vpx_config.h
 
 MODULE = vpx
 LIBRARY_NAME = vpx
 FORCE_STATIC_LIB= 1
+ifeq (WINNT,$(OS_TARGET))
+VISIBILITY_FLAGS =
+endif
 
 LOCAL_INCLUDES += \
   -I. \
   -I$(topsrcdir)/media/libvpx \
   -I$(topsrcdir)/media/libvpx/vp8/ \
   -I$(topsrcdir)/media/libvpx/vp8/common/ \
   -I$(topsrcdir)/media/libvpx/vp8/common/arm \
   -I$(topsrcdir)/media/libvpx/vp8/common/x86 \
--- a/mobile/xul/installer/package-manifest.in
+++ b/mobile/xul/installer/package-manifest.in
@@ -54,16 +54,17 @@
 @BINPATH@/@DLL_PREFIX@xul@DLL_SUFFIX@
 #endif
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 #else
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 #endif
 #ifdef XP_WIN32
+@BINPATH@/@DLL_PREFIX@gkmedias@DLL_SUFFIX@
 #if _MSC_VER == 1400
 @BINPATH@/Microsoft.VC80.CRT.manifest
 @BINPATH@/msvcm80.dll
 @BINPATH@/msvcp80.dll
 @BINPATH@/msvcr80.dll
 #elif _MSC_VER == 1500
 @BINPATH@/Microsoft.VC90.CRT.manifest
 @BINPATH@/msvcm90.dll
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -398,16 +398,18 @@ endif
 ifdef MOZ_NATIVE_LIBEVENT
 EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
 endif
 
 ifdef MOZ_NATIVE_LIBVPX
 EXTRA_DSO_LDOPTS += $(MOZ_LIBVPX_LIBS)
 endif
 
+EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,gkmedias,$(DIST)/lib) 
+
 ifdef MOZ_SYDNEYAUDIO
 ifeq ($(OS_ARCH),Linux)
 EXTRA_DSO_LDOPTS += $(MOZ_ALSA_LIBS)
 endif
 endif
 
 ifdef HAVE_CLOCK_MONOTONIC
 EXTRA_DSO_LDOPTS += $(REALTIME_LIBS)
--- a/xpcom/stub/Makefile.in
+++ b/xpcom/stub/Makefile.in
@@ -98,16 +98,22 @@ DEPENDENT_LIBS_LIST += \
 ifdef JS_SHARED_LIBRARY
 DEPENDENT_LIBS_LIST += $(DLL_PREFIX)mozjs$(DLL_SUFFIX)
 endif
 
 ifdef MOZ_JPROF
 DEPENDENT_LIBS_LIST += $(DLL_PREFIX)jprof$(DLL_SUFFIX)
 endif
 
+ifeq (WINNT,$(OS_TARGET))
+ifneq (,$(MOZ_SYDNEYAUDIO)$(MOZ_WEBM)$(MOZ_OGG)$(MOZ_TREMOR)$(MOZ_VORBIS))
+DEPENDENT_LIBS_LIST += $(DLL_PREFIX)gkmedias$(DLL_SUFFIX)
+endif
+endif
+
 ifeq (bundle,$(MOZ_FS_LAYOUT))
 EXTRA_DSO_LDOPTS += $(DIST)/bin/XUL
 DEPENDENT_LIBS_LIST += XUL
 else
 EXTRA_DSO_LIBS = xul
 DEPENDENT_LIBS_LIST += $(DLL_PREFIX)xul$(DLL_SUFFIX)
 endif