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
This commit is contained in:
Tor Lillqvist 2014-04-17 22:09:44 +03:00
parent f5ccbfdc56
commit 262aa2c2e5
22 changed files with 84 additions and 19 deletions

View file

@ -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 \

View file

@ -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 \

View file

@ -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

View file

@ -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

View file

@ -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 \

View file

@ -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 \

View file

@ -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 \

View file

@ -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 \

View file

@ -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 \

View file

@ -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:

View file

@ -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 \

View file

@ -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 \

View file

@ -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;

View file

@ -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 )

View file

@ -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;

View file

@ -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;

View file

@ -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 \

View file

@ -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 );

View file

@ -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())

View file

@ -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;

View file

@ -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;

View file

@ -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);