Fix --disable-avmedia for DESKTOP build

Probably additional bits can be removed, but this now passes.

Change-Id: I366bec43cfd6fb02e914c85c711b3b19586d534d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126161
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
This commit is contained in:
Jan-Marek Glogowski
2021-05-18 01:11:41 +02:00
parent b8084b0dee
commit f9e79a91f1
19 changed files with 89 additions and 146 deletions

View File

@@ -324,10 +324,12 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ogltrans, \
$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
acc \
$(call gb_Helper_optional,AVMEDIA,avmedia) \
avmedia \
$(call gb_Helper_optional,AVMEDIA, \
$(if $(filter MACOSX,$(OS)),\
avmediaMacAVF \
) \
) \
$(call gb_Helper_optional,SCRIPTING, \
basctl \
basprov \
@@ -593,8 +595,10 @@ $(eval $(call gb_Helper_register_libraries_for_install,PRIVATELIBS_URE,ure, \
))
$(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
$(if $(ENABLE_GSTREAMER_1_0),avmediagst) \
$(if $(filter WNT,$(OS)),avmediawin) \
$(call gb_Helper_optional,AVMEDIA, \
$(if $(ENABLE_GSTREAMER_1_0),avmediagst) \
$(if $(filter WNT,$(OS)),avmediawin) \
) \
cached1 \
collator_data \
comphelper \
@@ -1108,7 +1112,7 @@ $(eval $(call gb_ExternalExecutable_register_executables,\
# Resources
$(eval $(call gb_Helper_register_mos,\
acc \
avmedia \
$(call gb_Helper_optional,AVMEDIA,avmedia) \
$(call gb_Helper_optional,SCRIPTING,basctl) \
chart \
cnr \

View File

@@ -25,7 +25,7 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
android \
animations \
apple_remote \
$(call gb_Helper_optional,AVMEDIA,avmedia) \
avmedia \
basctl \
basegfx \
basic \

View File

@@ -9,15 +9,16 @@
$(eval $(call gb_Library_Library,avmedia))
$(eval $(call gb_Library_set_componentfile,avmedia,avmedia/util/avmedia))
$(eval $(call gb_Library_set_include,avmedia,\
$$(INCLUDE) \
-I$(SRCDIR)/avmedia/inc \
-I$(SRCDIR)/avmedia/source/inc \
))
$(eval $(call gb_Library_set_componentfile,avmedia,avmedia/util/avmedia))
$(eval $(call gb_Library_use_libraries,avmedia,\
sal \
svl \
))
$(eval $(call gb_Library_use_sdk_api,avmedia,))
@@ -25,35 +26,30 @@ $(eval $(call gb_Library_use_externals,avmedia,\
boost_headers \
))
ifeq ($(USE_AVMEDIA_DUMMY),TRUE)
$(eval $(call gb_Library_add_exception_objects,avmedia,\
avmedia/source/avmediadummy \
))
else
$(eval $(call gb_Library_add_defs,avmedia,\
-DAVMEDIA_DLLIMPLEMENTATION \
-DAVMEDIA_DLLIMPLEMENTATION \
))
$(eval $(call gb_Library_add_exception_objects,avmedia,\
avmedia/source/framework/mediaitem \
))
ifneq (,$(filter AVMEDIA,$(BUILD_TYPE)))
ifeq ($(DISABLE_GUI),)
$(eval $(call gb_Library_use_externals,avmedia,\
epoxy \
))
endif
$(eval $(call gb_Library_set_componentfile,avmedia,avmedia/util/avmedia))
$(eval $(call gb_Library_use_libraries,avmedia,\
comphelper \
ucbhelper \
cppu \
cppuhelper \
sal \
i18nlangtag \
sfx \
svl \
svt \
tl \
utl \
@@ -63,7 +59,6 @@ $(eval $(call gb_Library_use_libraries,avmedia,\
$(eval $(call gb_Library_add_exception_objects,avmedia,\
avmedia/source/framework/mediacontrol \
avmedia/source/framework/MediaControlBase \
avmedia/source/framework/mediaitem \
avmedia/source/framework/mediaplayer \
avmedia/source/framework/mediatoolbox \
avmedia/source/framework/soundhandler \
@@ -71,6 +66,8 @@ $(eval $(call gb_Library_add_exception_objects,avmedia,\
avmedia/source/viewer/mediawindow \
avmedia/source/viewer/mediawindow_impl \
))
endif
endif # !DISABLE_GUI
endif # AVMEDIA
# vim: set noet sw=4 ts=4:

View File

@@ -13,7 +13,8 @@ $(eval $(call gb_Module_add_targets,avmedia,\
Library_avmedia \
))
ifneq ($(USE_AVMEDIA_DUMMY),TRUE)
ifneq (,$(filter AVMEDIA,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_l10n_targets,avmedia,\
AllLangMoTarget_avmedia \
))
@@ -36,6 +37,6 @@ $(eval $(call gb_Module_add_targets,avmedia,\
))
endif
endif
endif # AVMEDIA
# vim: set noet sw=4 ts=4:

View File

@@ -1,93 +0,0 @@
/* -*- Mode: C++; 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
*/
#include <avmedia/mediaitem.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
using namespace ::com::sun::star;
namespace avmedia
{
MediaItem::MediaItem( sal_uInt16 i_nWhich, AVMediaSetMask )
: SfxPoolItem( i_nWhich )
{
}
MediaItem::MediaItem( const MediaItem& rItem )
: SfxPoolItem( rItem )
{
}
MediaItem::~MediaItem()
{
}
struct MediaItem::Impl
{
};
bool MediaItem::QueryValue( css::uno::Any&, sal_uInt8 ) const
{
return false;
}
bool MediaItem::GetPresentation( SfxItemPresentation, MapUnit, MapUnit, OUString&, const IntlWrapper& ) const
{
return false;
}
bool MediaItem::PutValue( const css::uno::Any&, sal_uInt8 )
{
return false;
}
AVMediaSetMask MediaItem::getMaskSet() const
{
(void) this; // Silence loplugin:staticmethods
return AVMediaSetMask::NONE;
}
SfxPoolItem* MediaItem::CreateDefault()
{
return new MediaItem;
}
MediaItem* MediaItem::Clone( SfxItemPool*) const
{
return nullptr;
}
bool MediaItem::operator==( const SfxPoolItem& rItem ) const
{
assert(SfxPoolItem::operator==(rItem)); (void)rItem;
return false;
}
} // namespace avmedia
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
com_sun_star_comp_framework_SoundHandler_get_implementation(css::uno::XComponentContext*,
css::uno::Sequence<css::uno::Any> const &)
{
return nullptr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -730,7 +730,6 @@ export ZLIB_CFLAGS=$(gb_SPACE)@ZLIB_CFLAGS@
export ZLIB_LIBS=$(gb_SPACE)@ZLIB_LIBS@
export ZMF_CFLAGS=$(gb_SPACE)@ZMF_CFLAGS@
export ZMF_LIBS=$(gb_SPACE)@ZMF_LIBS@
export USE_AVMEDIA_DUMMY=@USE_AVMEDIA_DUMMY@
# lang-related stuff
include $(BUILDDIR)/config_$(gb_Side)_lang.mk

View File

@@ -1381,8 +1381,8 @@ libo_FUZZ_ARG_ENABLE(extension-integration,
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.])
)
[Disable displaying and inserting AV media in documents. Work in progress, use only if you are hacking on it.]),
,test "${enable_avmedia+set}" = set || enable_avmedia=yes)
AC_ARG_ENABLE(database-connectivity,
AS_HELP_STRING([--disable-database-connectivity],
@@ -2944,17 +2944,12 @@ fi
# Whether to build "avmedia" functionality or not.
if test -z "$enable_avmedia"; then
enable_avmedia=yes
fi
BUILD_TYPE="$BUILD_TYPE AVMEDIA"
if test "$enable_avmedia" = yes; then
BUILD_TYPE="$BUILD_TYPE AVMEDIA"
AC_DEFINE(HAVE_FEATURE_AVMEDIA)
else
USE_AVMEDIA_DUMMY='TRUE'
test_gstreamer_1_0=no
fi
AC_SUBST(USE_AVMEDIA_DUMMY)
# Decide whether to build database connectivity stuff (including Base) or not.
if test "$enable_database_connectivity" != no; then

View File

@@ -35,7 +35,7 @@ endif
endif
$(eval $(call gb_CppunitTest_use_libraries,oox_tokenmap,\
avmedia \
$(call gb_Helper_optional,AVMEDIA,avmedia) \
basegfx \
comphelper \
cppu \

View File

@@ -158,21 +158,19 @@ $(eval $(call gb_Rdb_add_components,services,\
lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \
) \
$(if $(filter WNT,$(OS)), \
avmedia/source/win/avmediawin \
$(call gb_Helper_optional,AVMEDIA,avmedia/source/win/avmediawin) \
embeddedobj/source/msole/emboleobj.windows \
embedserv/util/emser \
extensions/source/ole/oleautobridge \
fpicker/source/win32/fps \
shell/source/backends/wininetbe/wininetbe1 \
shell/source/win32/simplemail/smplmail \
shell/source/win32/syssh \
winaccessibility/source/service/winaccessibility \
) \
$(if $(filter-out WNT,$(OS)), \
embeddedobj/source/msole/emboleobj \
) \
$(if $(filter WNT,$(OS)), \
embeddedobj/source/msole/emboleobj.windows \
embedserv/util/emser \
extensions/source/ole/oleautobridge \
winaccessibility/source/service/winaccessibility \
) \
$(if $(filter neon,$(WITH_WEBDAV)), \
ucb/source/ucp/webdav-neon/ucpdav1 \
) \
@@ -205,7 +203,7 @@ $(eval $(call gb_Rdb_add_components,services,\
ucb/source/ucp/gio/ucpgio \
) \
$(if $(ENABLE_GSTREAMER_1_0), \
avmedia/source/gstreamer/avmediagstreamer \
$(call gb_Helper_optional,AVMEDIA,avmedia/source/gstreamer/avmediagstreamer) \
) \
$(if $(ENABLE_KF5), \
shell/source/backends/kf5be/kf5be1 \

View File

@@ -64,7 +64,7 @@ $(eval $(call gb_Library_use_externals,sc,orcus-parser))
endif
$(eval $(call gb_Library_use_libraries,sc,\
$(call gb_Helper_optional,AVMEDIA,avmedia) \
avmedia \
basegfx \
comphelper \
cppu \

View File

@@ -67,7 +67,7 @@ $(eval $(call gb_Library_use_custom_headers,sd,\
$(eval $(call gb_Library_use_sdk_api,sd))
$(eval $(call gb_Library_use_libraries,sd,\
$(call gb_Helper_optional,AVMEDIA,avmedia) \
avmedia \
basegfx \
canvastools \
comphelper \

View File

@@ -18,6 +18,7 @@
*/
#include <config_features.h>
#include <tools/diagnose_ex.h>
#include <cppuhelper/basemutex.hxx>
@@ -2350,6 +2351,9 @@ std::shared_ptr<avmedia::MediaTempFile> SlideShowImpl::getMediaTempFile(const OU
{
std::shared_ptr<avmedia::MediaTempFile> aRet;
#if !HAVE_FEATURE_AVMEDIA
(void)aUrl;
#else
if (!mxSBD.is())
return aRet;
@@ -2373,6 +2377,7 @@ std::shared_ptr<avmedia::MediaTempFile> SlideShowImpl::getMediaTempFile(const OU
xInStream->closeInput();
}
#endif
return aRet;
}

View File

@@ -18,6 +18,7 @@
*/
#include <config_features.h>
#include <tools/diagnose_ex.h>
#include <com/sun/star/lang/NoSupportException.hpp>
@@ -90,6 +91,9 @@ namespace slideshow::internal
ENSURE_OR_THROW( rComponentContext.is(),
"SoundPlayer::SoundPlayer(): Invalid component context" );
#if !HAVE_FEATURE_AVMEDIA
(void) rMediaFileManager;
#else
try
{
if (rSoundURL.startsWithIgnoreAsciiCase("vnd.sun.star.Package:"))
@@ -107,6 +111,7 @@ namespace slideshow::internal
catch( uno::Exception& )
{
}
#endif
if( !mxPlayer.is() )
throw lang::NoSupportException(

View File

@@ -49,7 +49,7 @@ $(eval $(call gb_Library_add_defs,svxcore,\
))
$(eval $(call gb_Library_use_libraries,svxcore,\
$(call gb_Helper_optional,AVMEDIA,avmedia) \
avmedia \
basegfx \
sb \
comphelper \
@@ -257,7 +257,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/sdr/contact/viewobjectcontactofsdrole2obj \
svx/source/sdr/contact/viewobjectcontactofunocontrol \
svx/source/sdr/contact/viewobjectcontactofgraphic \
svx/source/sdr/contact/sdrmediawindow \
$(call gb_Helper_optional,AVMEDIA,svx/source/sdr/contact/sdrmediawindow) \
svx/source/sdr/contact/viewobjectcontactofsdrmediaobj \
svx/source/sdr/contact/viewcontactofsdrcaptionobj \
svx/source/sdr/contact/viewcontactofvirtobj \

View File

@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <svx/MediaShellHelpers.hxx>
#include <avmedia/mediaitem.hxx>
#include <sfx2/request.hxx>
@@ -41,6 +42,7 @@ void GetState(const SdrMarkView* pSdrView, SfxItemSet& rSet)
if (SID_AVMEDIA_TOOLBOX != nWhich)
continue;
#if HAVE_FEATURE_AVMEDIA
const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
bool bDisable = true;
@@ -60,12 +62,18 @@ void GetState(const SdrMarkView* pSdrView, SfxItemSet& rSet)
}
if (bDisable)
#endif
rSet.DisableItem(SID_AVMEDIA_TOOLBOX);
}
}
const ::avmedia::MediaItem* Execute(const SdrMarkView* pSdrView, SfxRequest const& rReq)
{
#if !HAVE_FEATURE_AVMEDIA
(void)pSdrView;
(void)rReq;
return nullptr;
#else
if (!pSdrView)
return nullptr;
@@ -96,6 +104,7 @@ const ::avmedia::MediaItem* Execute(const SdrMarkView* pSdrView, SfxRequest cons
.executeMediaItem(*pMediaItem);
return pMediaItem;
#endif
}
} // end of namespace svx::MediaShellHelpers

View File

@@ -44,10 +44,12 @@ using namespace ::com::sun::star;
struct SdrMediaObj::Impl
{
::avmedia::MediaItem m_MediaProperties;
#if HAVE_FEATURE_AVMEDIA
// Note: the temp file is read only, until it is deleted!
// It may be shared between multiple documents in case of copy/paste,
// hence the shared_ptr.
std::shared_ptr< ::avmedia::MediaTempFile > m_pTempFile;
#endif
uno::Reference< graphic::XGraphic > m_xCachedSnapshot;
OUString m_LastFailedPkgURL;
};
@@ -62,7 +64,9 @@ SdrMediaObj::SdrMediaObj(SdrModel& rSdrModel, SdrMediaObj const & rSource)
: SdrRectObj(rSdrModel, rSource)
,m_xImpl( new Impl )
{
#if HAVE_FEATURE_AVMEDIA
m_xImpl->m_pTempFile = rSource.m_xImpl->m_pTempFile; // before props
#endif
setMediaProperties( rSource.getMediaProperties() );
m_xImpl->m_xCachedSnapshot = rSource.m_xImpl->m_xCachedSnapshot;
}
@@ -218,7 +222,7 @@ const OUString& SdrMediaObj::getURL() const
#if HAVE_FEATURE_AVMEDIA
return m_xImpl->m_MediaProperties.getURL();
#else
static OUString ret;
static OUString ret;
return ret;
#endif
}
@@ -236,6 +240,7 @@ const ::avmedia::MediaItem& SdrMediaObj::getMediaProperties() const
uno::Reference<io::XInputStream> SdrMediaObj::GetInputStream() const
{
#if HAVE_FEATURE_AVMEDIA
if (!m_xImpl->m_pTempFile)
{
SAL_WARN("svx", "this is only intended for embedded media");
@@ -245,10 +250,16 @@ uno::Reference<io::XInputStream> SdrMediaObj::GetInputStream() const
uno::Reference<ucb::XCommandEnvironment>(),
comphelper::getProcessComponentContext());
return tempFile.openStream();
#else
return nullptr;
#endif
}
void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream)
{
#if !HAVE_FEATURE_AVMEDIA
(void) xStream;
#else
if (m_xImpl->m_pTempFile || m_xImpl->m_LastFailedPkgURL.isEmpty())
{
SAL_WARN("svx", "this is only intended for embedded media");
@@ -265,12 +276,11 @@ void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream
if (bSuccess)
{
m_xImpl->m_pTempFile = std::make_shared<::avmedia::MediaTempFile>(tempFileURL);
#if HAVE_FEATURE_AVMEDIA
m_xImpl->m_MediaProperties.setURL(
m_xImpl->m_LastFailedPkgURL, tempFileURL, "");
#endif
}
m_xImpl->m_LastFailedPkgURL.clear(); // once only
#endif
}
/// copy a stream from XStorage to temp file

View File

@@ -785,9 +785,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr
|| (pProperty->nWID == OWN_ATTR_MEDIA_MIMETYPE)
|| (pProperty->nWID == OWN_ATTR_VALUE_GRAPHIC))
{
#if HAVE_FEATURE_AVMEDIA
SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( GetSdrObject() );
::avmedia::MediaItem aItem;
bool bOk = false;
#endif
switch( pProperty->nWID )
{
@@ -919,11 +921,13 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr
OSL_FAIL("SvxMediaShape::setPropertyValueImpl(), unknown argument!");
}
#if HAVE_FEATURE_AVMEDIA
if( bOk )
{
pMedia->setMediaProperties( aItem );
return true;
}
#endif
}
else
{
@@ -945,7 +949,9 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr
|| (pProperty->nWID == OWN_ATTR_VALUE_GRAPHIC))
{
SdrMediaObj* pMedia = static_cast< SdrMediaObj* >( GetSdrObject() );
#if HAVE_FEATURE_AVMEDIA
const ::avmedia::MediaItem aItem( pMedia->getMediaProperties() );
#endif
switch( pProperty->nWID )
{

View File

@@ -51,7 +51,7 @@ $(eval $(call gb_Library_add_defs,sw,\
))
$(eval $(call gb_Library_use_libraries,sw,\
$(call gb_Helper_optional,AVMEDIA,avmedia) \
avmedia \
basegfx \
comphelper \
cppu \

View File

@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <config_features.h>
#include <wrtsh.hxx>
#include <view.hxx>
#include <textsh.hxx>
@@ -38,10 +39,15 @@ using namespace ::sfx2;
bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq )
{
bool bRet = false;
#if !HAVE_FEATURE_AVMEDIA
(void) rReq;
#else
OUString aURL;
const SfxItemSet* pReqArgs = rReq.GetArgs();
vcl::Window& rWindow = GetView().GetViewFrame()->GetWindow();
bool bAPI = false, bRet = false;
bool bAPI = false;
if( pReqArgs )
{
@@ -115,6 +121,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq )
rWindow.LeaveWait();
}
}
#endif
return bRet;
}