summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-17 22:09:44 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-17 22:18:02 +0300
commit262aa2c2e540c803196d53779fb72226a8efeb5f (patch)
tree6e27c452faa73094b0590f493945b55ab3483f18
parentf5ccbfdc561c68099872d1abe07ac72fcddedd35 (diff)
More generic way to disable avmedia
Introduce a configure option --disable-avmedia. For non-desktop, avmedia is always disabled (for now), and for desktop enabled by default. Add AVMEDIA to BUILD_TYPE when enabled. Don't build avmedia when disabled. Add HAVE_FEATURE_AVMEDIA to <config_features.h>. Bypass avmedia-related code when disabled. Change-Id: I919c6e199bff87d9f142d55dff6373f0ed217f39
-rw-r--r--Repository.mk2
-rw-r--r--RepositoryModule_host.mk2
-rw-r--r--config_host/config_features.h.in6
-rw-r--r--configure.ac27
-rw-r--r--cui/Library_cui.mk2
-rw-r--r--postprocess/Rdb_services.mk4
-rw-r--r--sc/Library_sc.mk2
-rw-r--r--sd/Library_sd.mk2
-rw-r--r--sfx2/Library_sfx.mk1
-rw-r--r--sfx2/source/bastyp/dummytypes.cxx18
-rw-r--r--slideshow/Library_slideshow.mk2
-rw-r--r--svx/Library_svxcore.mk2
-rw-r--r--svx/source/gallery2/galtheme.cxx5
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx2
-rw-r--r--svx/source/svdraw/svdobj.cxx2
-rw-r--r--svx/source/unodraw/unopage.cxx2
-rw-r--r--sw/Library_sw.mk2
-rw-r--r--sw/source/core/uibase/dochdl/swdtflvr.cxx8
-rw-r--r--sw/source/core/uibase/shells/textdrw.cxx4
-rw-r--r--sw/source/core/uibase/shells/textsh.cxx2
-rw-r--r--sw/source/core/uibase/uiview/view.cxx2
-rw-r--r--sw/source/core/uibase/uiview/view0.cxx4
22 files changed, 84 insertions, 19 deletions
diff --git a/Repository.mk b/Repository.mk
index e3715d5d97fe..dd1928fb1e9c 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -211,7 +211,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,math, \
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
acc \
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
$(if $(DISABLE_SCRIPTING),,basctl) \
$(if $(DISABLE_SCRIPTING),,basprov) \
basegfx \
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 6e3b90bd9074..9b18d63628b9 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -16,7 +16,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
android \
animations \
apple_remote \
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basctl \
basebmp \
basegfx \
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 6a46e1c3dc09..612ceca03394 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -43,6 +43,12 @@
#define HAVE_FEATURE_X11 0
+/* AVMEDIA - Whether to have functionality to display and manipulate
+ * embedded AV media in documents
+ */
+
+#define HAVE_FEATURE_AVMEDIA 0
+
/* EXTENSIONS - Whether we have any extension mechanism at all
*
* Primarily intended for non-desktop platforms where supporting
diff --git a/configure.ac b/configure.ac
index eaa46b5c4e68..4e83ed6b5d92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -764,6 +764,11 @@ AC_ARG_ENABLE(export,
only for exporrt linked in. Work in progress, use only if you are hacking on it.])
)
+AC_ARG_ENABLE(avmedia,
+ AS_HELP_STRING([--disable-avmedia],
+ [Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.])
+)
+
AC_ARG_ENABLE(database-connectivity,
AS_HELP_STRING([--disable-database-connectivity],
[Disable various database connectivity. Work in progress, use only if you are hacking on it.])
@@ -2338,6 +2343,22 @@ else
fi
AC_SUBST(DISABLE_EXPORT)
+# Whether to build "avmedia" functionality or not.
+# We probably don't want it for non-desktop.
+
+if test -z "$enable_avmedia"; then
+ if test $_os != iOS -a $_os != Android; then
+ enable_avmedia=yes
+ fi
+fi
+
+if test "$enable_avmedia" = yes; then
+ BUILD_TYPE="$BUILD_TYPE AVMEDIA"
+ AC_DEFINE(HAVE_FEATURE_AVMEDIA)
+else
+ SCPDEFS="$SCPDEFS -DDISABLE_AVMEDIA"
+fi
+
dnl Decide whether to build database connectivity stuff (including
dnl Base) or not. We probably don't want to on non-desktop OSes.
@@ -10201,7 +10222,7 @@ ENABLE_GSTREAMER=""
if test "$build_gstreamer" = "yes"; then
AC_MSG_CHECKING([whether to enable the new GStreamer 1.0 avmedia backend])
- if test "x$enable_gstreamer" != "xno"; then
+ if test "$enable_avmedia" = yes -a "$enable_gstreamer" != no; then
ENABLE_GSTREAMER="TRUE"
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES( GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-video-1.0 )
@@ -10219,7 +10240,7 @@ ENABLE_GSTREAMER_0_10=""
if test "$build_gstreamer_0_10" = "yes"; then
AC_MSG_CHECKING([whether to enable the GStreamer avmedia backend])
- if test "x$enable_gstreamer_0_10" != "xno"; then
+ if test "$enable_avmedia" = yes -a "$enable_gstreamer_0_10" != no; then
ENABLE_GSTREAMER_0_10="TRUE"
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES( [GSTREAMER_0_10], [gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10],, [
@@ -10242,7 +10263,7 @@ dnl ===================================================================
ENABLE_VLC=""
AC_MSG_CHECKING([whether to enable the VLC avmedia backend])
-if test $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
+if test "$enable_avmedia" = yes -a $_os != iOS -a $_os != Android -a "$enable_vlc" = yes; then
ENABLE_VLC="TRUE"
AC_MSG_RESULT([yes])
else
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 28f4b64290c0..1ac0ed757ea0 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -32,7 +32,7 @@ $(eval $(call gb_Library_use_custom_headers,cui,\
$(eval $(call gb_Library_use_sdk_api,cui))
$(eval $(call gb_Library_use_libraries,cui,\
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
comphelper \
cppu \
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index cffd75b8cc6e..3e9424c8c26f 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -11,7 +11,7 @@ $(eval $(call gb_Rdb_Rdb_install,services))
$(eval $(call gb_Rdb_add_components,services,\
animations/source/animcore/animcore \
- avmedia/util/avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia/util/avmedia) \
chart2/source/controller/chartcontroller \
chart2/source/chartcore \
canvas/source/factory/canvasfactory \
@@ -122,7 +122,7 @@ $(eval $(call gb_Rdb_add_components,services,\
$(if $(filter MACOSX,$(OS)), \
$(if $(filter-out X86_64,$(CPUNAME)), \
$(if $(filter TRUE,$(ENABLE_MACOSX_SANDBOX)),, \
- avmedia/source/quicktime/avmediaQuickTime \
+ $(call gb_Helper_optional,AVMEDIA,avmedia/source/quicktime/avmediaQuickTime) \
) \
) \
lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index b4b74259de9e..3063b56a052c 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -60,7 +60,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
endif
$(eval $(call gb_Library_use_libraries,sc,\
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
comphelper \
cppu \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index deae271cd836..7ce290582147 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -65,7 +65,7 @@ $(eval $(call gb_Library_use_custom_headers,sd,\
$(eval $(call gb_Library_use_sdk_api,sd))
$(eval $(call gb_Library_use_libraries,sd,\
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
canvastools \
comphelper \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index f4eafa2f9483..9ff7a3775849 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -119,6 +119,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/appl/workwin \
sfx2/source/appl/xpackcreator \
sfx2/source/bastyp/bitset \
+ sfx2/source/bastyp/dummytypes \
sfx2/source/bastyp/fltfnc \
sfx2/source/bastyp/fltlst \
sfx2/source/bastyp/frmhtml \
diff --git a/sfx2/source/bastyp/dummytypes.cxx b/sfx2/source/bastyp/dummytypes.cxx
new file mode 100644
index 000000000000..e1ae0ad996cc
--- /dev/null
+++ b/sfx2/source/bastyp/dummytypes.cxx
@@ -0,0 +1,18 @@
+// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+//
+// This file is part of the LibreOffice project.
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config_features.h>
+
+#include <tools/rtti.hxx>
+#include <avmedia/mediaitem.hxx>
+
+#if !HAVE_FEATURE_AVMEDIA
+SAL_DLLPUBLIC_EXPORT TypeId avmedia::MediaItem::StaticType() { return 0; }
+#endif
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/slideshow/Library_slideshow.mk b/slideshow/Library_slideshow.mk
index fb5e93deb3f6..ccd3e9964a9d 100644
--- a/slideshow/Library_slideshow.mk
+++ b/slideshow/Library_slideshow.mk
@@ -32,7 +32,7 @@ $(eval $(call gb_Library_use_external,slideshow,boost_headers))
$(eval $(call gb_Library_use_sdk_api,slideshow))
$(eval $(call gb_Library_use_libraries,slideshow,\
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
canvastools \
comphelper \
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 8826d9f879d5..2b2d1945df64 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -50,7 +50,7 @@ $(eval $(call gb_Library_add_defs,svxcore,\
))
$(eval $(call gb_Library_use_libraries,svxcore,\
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
sb \
comphelper \
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 50ec15a2178a..7352b101ef49 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include "sal/config.h"
#include <algorithm>
@@ -1111,9 +1113,10 @@ bool GalleryTheme::InsertURL( const INetURLObject& rURL, sal_uIntPtr nInsertPos
else
pNewObj = (SgaObject*) new SgaObjectBmp( aGraphic, rURL, aFormat );
}
+#if HAVE_FEATURE_AVMEDIA
else if( ::avmedia::MediaWindow::isMediaURL( rURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ), ""/*TODO?*/ ) )
pNewObj = (SgaObject*) new SgaObjectSound( rURL );
-
+#endif
if( pNewObj && InsertObject( *pNewObj, nInsertPos ) )
bRet = true;
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
index 5fa946bb6b5d..81ccab37f8e7 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
@@ -38,7 +38,7 @@ ViewObjectContactOfSdrMediaObj::ViewObjectContactOfSdrMediaObj( ObjectContact& r
ViewObjectContactOfSdrObj( rObjectContact, rViewContact ),
mpMediaWindow( NULL )
{
-#if HAVE_FEATURE_DESKTOP
+#if HAVE_FEATURE_AVMEDIA
Window* pWindow = getWindow();
if( pWindow )
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 9b82f1089f4c..a2441761d1f3 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -3396,7 +3396,7 @@ SdrObject* SdrObjFactory::MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, S
case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj; break;
case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(OUString()); break;
case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(); break;
-#if HAVE_FEATURE_DESKTOP
+#if HAVE_FEATURE_AVMEDIA
case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(); break;
#endif
case sal_uInt16(OBJ_TABLE ): pObj=new ::sdr::table::SdrTableObj(pModel); break;
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index 52c1fc9752a4..cf8b8242dc2d 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -538,7 +538,7 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, sal_uInt32& rInventor,
rInventor = SdrInventor;
rType = OBJ_TABLE;
}
-#if HAVE_FEATURE_DESKTOP
+#if HAVE_FEATURE_AVMEDIA
else if ( aName == "com.sun.star.presentation.MediaShape" )
{
rInventor = SdrInventor;
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 6f91e282ba26..1f7d55a98d9b 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -45,7 +45,7 @@ $(eval $(call gb_Library_add_defs,sw,\
))
$(eval $(call gb_Library_use_libraries,sw,\
- avmedia \
+ $(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
comphelper \
cppu \
diff --git a/sw/source/core/uibase/dochdl/swdtflvr.cxx b/sw/source/core/uibase/dochdl/swdtflvr.cxx
index 4e53bfacc219..c8f1cd5b2e6f 100644
--- a/sw/source/core/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/core/uibase/dochdl/swdtflvr.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/Aspects.hpp>
@@ -2511,6 +2513,7 @@ bool SwTransferable::_PasteFileName( TransferableDataHelper& rData,
OUString sFile, sDesc;
if( rData.GetString( nFmt, sFile ) && !sFile.isEmpty() )
{
+#if HAVE_FEATURE_AVMEDIA
INetURLObject aMediaURL;
aMediaURL.SetSmartURL( sFile );
@@ -2523,6 +2526,11 @@ bool SwTransferable::_PasteFileName( TransferableDataHelper& rData,
SID_INSERT_AVMEDIA, SFX_CALLMODE_SYNCHRON,
&aMediaURLItem, 0L );
}
+#else
+ if (false)
+ {
+ }
+#endif
else
{
sal_Bool bIsURLFile = SwTransferable::_CheckForURLOrLNKFile( rData, sFile, &sDesc );
diff --git a/sw/source/core/uibase/shells/textdrw.cxx b/sw/source/core/uibase/shells/textdrw.cxx
index acc239b544b4..d6931e32e151 100644
--- a/sw/source/core/uibase/shells/textdrw.cxx
+++ b/sw/source/core/uibase/shells/textdrw.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include <svx/svdview.hxx>
#include <tools/urlobj.hxx>
#include <svx/fmglob.hxx>
@@ -102,12 +104,14 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget,
aTmp.setValue( &eButtonType, ::getCppuType((const form::FormButtonType*)0));
xPropSet->setPropertyValue( "ButtonType", aTmp );
+#if HAVE_FEATURE_AVMEDIA
if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
{
// #105638# OJ
aTmp <<= sal_True;
xPropSet->setPropertyValue("DispatchURLInternal", aTmp );
}
+#endif
}
if (rSh.IsObjSelected())
diff --git a/sw/source/core/uibase/shells/textsh.cxx b/sw/source/core/uibase/shells/textsh.cxx
index 8db56d3e13e5..a19bd352d24c 100644
--- a/sw/source/core/uibase/shells/textsh.cxx
+++ b/sw/source/core/uibase/shells/textsh.cxx
@@ -226,7 +226,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
rReq.Done();
break;
-#if HAVE_FEATURE_DESKTOP
+#if HAVE_FEATURE_AVMEDIA
case SID_INSERT_AVMEDIA:
rReq.SetReturnValue(SfxBoolItem(nSlot, InsertMediaDlg( rReq )));
break;
diff --git a/sw/source/core/uibase/uiview/view.cxx b/sw/source/core/uibase/uiview/view.cxx
index a95267130f63..92128722cab8 100644
--- a/sw/source/core/uibase/uiview/view.cxx
+++ b/sw/source/core/uibase/uiview/view.cxx
@@ -337,7 +337,7 @@ void SwView::SelectShell()
m_pShell = new SwBezierShell( *this );
rDispatcher.Push( *m_pShell );
}
-#if HAVE_FEATURE_DESKTOP
+#if HAVE_FEATURE_AVMEDIA
else if( m_nSelectionType & nsSelectionType::SEL_MEDIA )
{
eShellMode = SHELL_MODE_MEDIA;
diff --git a/sw/source/core/uibase/uiview/view0.cxx b/sw/source/core/uibase/uiview/view0.cxx
index 5363d04bebf9..a36b077cd1da 100644
--- a/sw/source/core/uibase/uiview/view0.cxx
+++ b/sw/source/core/uibase/uiview/view0.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include "hintids.hxx"
#include <vcl/graph.hxx>
#include <svx/galbrws.hxx>
@@ -98,7 +100,9 @@ SFX_IMPL_INTERFACE( SwView, SfxViewShell, SW_RES(RID_TOOLS_TOOLBOX) )
SFX_CHILDWINDOW_REGISTRATION(SID_HYPERLINK_DIALOG);
SFX_CHILDWINDOW_REGISTRATION(FN_WORDCOUNT_DIALOG);
SFX_CHILDWINDOW_REGISTRATION(GalleryChildWindow::GetChildWindowId());
+#if HAVE_FEATURE_AVMEDIA
SFX_CHILDWINDOW_REGISTRATION(::avmedia::MediaPlayer::GetChildWindowId());
+#endif
SFX_CHILDWINDOW_REGISTRATION(FN_INSERT_FIELD_DATA_ONLY);
SFX_FEATURED_CHILDWINDOW_REGISTRATION(FN_SYNC_LABELS, CHILDWIN_LABEL );
SFX_FEATURED_CHILDWINDOW_REGISTRATION(FN_MAILMERGE_CHILDWINDOW, CHILDWIN_MAILMERGE);