summaryrefslogtreecommitdiff
path: root/src/libreal
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-07-10 22:08:12 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2006-07-10 22:08:12 +0000
commite70c5600f5653c6915931717bdd52f9a6a2f2d9d (patch)
treea0d5282f9deb660def1026701c8e68a273099ede /src/libreal
parent32ad3ca6265c8cbac584dd3510109b920415a8e1 (diff)
downloadxine-lib-e70c5600f5653c6915931717bdd52f9a6a2f2d9d.tar.gz
xine-lib-e70c5600f5653c6915931717bdd52f9a6a2f2d9d.tar.bz2
Implement visibility support, available on GCC 4.0 and later and on some 3.4 (through backports), to avoid exporting unneeded internal symbols, making plugins' loading faster and use of internal copies of libraries more solid. It should automatically fall back to the old way in GCCs that does not support -fvisibility=hidden, but has to be tested carefully. No issues were found in the months of testing in Gentoo, but this requires special attention anyway.
CVS patchset: 8101 CVS date: 2006/07/10 22:08:12
Diffstat (limited to 'src/libreal')
-rw-r--r--src/libreal/Makefile.am6
-rw-r--r--src/libreal/audio_decoder.c8
-rw-r--r--src/libreal/xine_decoder.c8
3 files changed, 16 insertions, 6 deletions
diff --git a/src/libreal/Makefile.am b/src/libreal/Makefile.am
index bf6adc19e..72dac45a1 100644
--- a/src/libreal/Makefile.am
+++ b/src/libreal/Makefile.am
@@ -6,8 +6,10 @@ lib_LTLIBRARIES = xineplug_decode_real.la xineplug_decode_real_audio.la
xineplug_decode_real_la_SOURCES = xine_decoder.c
xineplug_decode_real_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS)
-xineplug_decode_real_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
+xineplug_decode_real_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_decode_real_la_LDFLAGS = -avoid-version -module
xineplug_decode_real_audio_la_SOURCES = audio_decoder.c
xineplug_decode_real_audio_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS)
-xineplug_decode_real_audio_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
+xineplug_decode_real_audio_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_decode_real_audio_la_LDFLAGS = -avoid-version -module
diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c
index 852512105..d5b2b2d26 100644
--- a/src/libreal/audio_decoder.c
+++ b/src/libreal/audio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_decoder.c,v 1.48 2006/06/17 12:28:31 dgp85 Exp $
+ * $Id: audio_decoder.c,v 1.49 2006/07/10 22:08:30 dgp85 Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -681,6 +681,10 @@ static void dispose_class (audio_decoder_class_t *this) {
/*
* some fake functions to make real codecs happy
*/
+void *__builtin_vec_new(unsigned long size) EXPORTED;
+void __builtin_vec_delete(void *mem) EXPORTED;
+void __pure_virtual(void) EXPORTED;
+
void *__builtin_vec_new(unsigned long size) {
return malloc(size);
}
@@ -766,7 +770,7 @@ static const decoder_info_t dec_info_audio = {
5 /* priority */
};
-const plugin_info_t xine_plugin_info[] = {
+const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
{ PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "realadec", XINE_VERSION_CODE, &dec_info_audio, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c
index 4dcf61250..0ed7f12d8 100644
--- a/src/libreal/xine_decoder.c
+++ b/src/libreal/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.82 2006/06/17 12:28:31 dgp85 Exp $
+ * $Id: xine_decoder.c,v 1.83 2006/07/10 22:08:30 dgp85 Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -577,6 +577,10 @@ static void dispose_class (video_decoder_class_t *this) {
/*
* some fake functions to make real codecs happy
*/
+void *__builtin_vec_new(uint32_t size) EXPORTED;
+void __builtin_vec_delete(void *mem) EXPORTED;
+void __pure_virtual(void) EXPORTED;
+
void *__builtin_vec_new(uint32_t size) {
return malloc(size);
}
@@ -660,7 +664,7 @@ static const decoder_info_t dec_info_real = {
7 /* priority */
};
-const plugin_info_t xine_plugin_info[] = {
+const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
{ PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "real", XINE_VERSION_CODE, &dec_info_real, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }