Kaydet (Commit) 801cc955 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Remove Library_avmediaQuickTime, which is dead

...as a consequence of a4e81b7c "No QuickTime in
the 10.12 SDK" and <https://gerrit.libreoffice.org/#/c/60375/> "Support for
building with macOS SDK < 10.12 is long gone"

Change-Id: Ida690370aea5b9559bb2c112dc73f26738facfd0
Reviewed-on: https://gerrit.libreoffice.org/60376
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst dd7b96ee
...@@ -329,9 +329,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ...@@ -329,9 +329,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
$(call gb_Helper_optional,AVMEDIA,avmedia) \ $(call gb_Helper_optional,AVMEDIA,avmedia) \
$(if $(filter MACOSX,$(OS)),\ $(if $(filter MACOSX,$(OS)),\
avmediaMacAVF \ avmediaMacAVF \
$(if $(ENABLE_MACOSX_SANDBOX),,\
$(if $(shell test $(MACOSX_SDK_VERSION) -ge 101200 || echo not),avmediaQuickTime) \
) \
) \ ) \
$(call gb_Helper_optional,SCRIPTING, \ $(call gb_Helper_optional,SCRIPTING, \
basctl \ basctl \
......
...@@ -36,16 +36,6 @@ $(eval $(call gb_Module_add_targets,avmedia,\ ...@@ -36,16 +36,6 @@ $(eval $(call gb_Module_add_targets,avmedia,\
)) ))
endif endif
ifeq ($(OS),MACOSX)
ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE)
ifneq ($(shell test $(MACOSX_SDK_VERSION) -ge 101200; echo $$?),0)
$(eval $(call gb_Module_add_targets,avmedia,\
Library_avmediaQuickTime \
))
endif
endif
endif
ifeq ($(OS),MACOSX) ifeq ($(OS),MACOSX)
$(eval $(call gb_Module_add_targets,avmedia,\ $(eval $(call gb_Module_add_targets,avmedia,\
Library_avmediaMacAVF \ Library_avmediaMacAVF \
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX" #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX"
#else #else
#ifdef MACOSX #ifdef MACOSX
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime" #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_MacAVF"
#define AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1 "com.sun.star.comp.avmedia.Manager_MacAVF"
#else #else
#define AVMEDIA_MANAGER_SERVICE_NAME_OLD "com.sun.star.comp.avmedia.Manager_GStreamer_0_10" #define AVMEDIA_MANAGER_SERVICE_NAME_OLD "com.sun.star.comp.avmedia.Manager_GStreamer_0_10"
#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer" #define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer"
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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 .
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="avmediaQuickTime" xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.avmedia.Manager_QuickTime">
<service name="com.sun.star.media.Manager_QuickTime"/>
</implementation>
</component>
/* -*- 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 .
*/
#ifndef INCLUDED_AVMEDIA_SOURCE_QUICKTIME_FRAMEGRABBER_HXX
#define INCLUDED_AVMEDIA_SOURCE_QUICKTIME_FRAMEGRABBER_HXX
#include "quicktimecommon.hxx"
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/media/XFrameGrabber.hpp>
namespace avmedia { namespace quicktime {
class FrameGrabber : public ::cppu::WeakImplHelper< css::media::XFrameGrabber,
css::lang::XServiceInfo >
{
public:
FrameGrabber( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
virtual ~FrameGrabber();
bool create( const OUString& rURL );
// XFrameGrabber
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
private:
css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
OUString maURL;
QTMovie* mpMovie;
bool mbInitialized;
};
} // namespace quicktime
} // namespace avmedia
#endif // INCLUDED_AVMEDIA_SOURCE_QUICKTIME_FRAMEGRABBER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "framegrabber.hxx"
#include "player.hxx"
#include <tools/stream.hxx>
#include <vcl/graph.hxx>
#include <vcl/cvtgrf.hxx>
#include <unotools/localfilehelper.hxx>
#define AVMEDIA_QUICKTIME_FRAMEGRABBER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.FrameGrabber_Quicktime"
#define AVMEDIA_QUICKTIME_FRAMEGRABBER_SERVICENAME "com.sun.star.media.FrameGrabber_Quicktime"
using namespace ::com::sun::star;
SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.9
namespace avmedia { namespace quicktime {
FrameGrabber::FrameGrabber( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
mxMgr( rxMgr )
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
mpMovie = [QTMovie movie];
[mpMovie retain];
mbInitialized = true;
[pool release];
}
FrameGrabber::~FrameGrabber()
{
if( mbInitialized )
{
if( mpMovie )
{
[mpMovie release];
mpMovie = nil;
}
}
}
bool FrameGrabber::create( const ::rtl::OUString& rURL )
{
bool bRet = false;
maURL = rURL;
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSString* aNSStr = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rURL.getStr()) length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
NSURL* aURL = [NSURL URLWithString:aNSStr ];
// create the Movie
mpMovie = [mpMovie initWithURL:aURL error:nil];
if(mpMovie)
{
[mpMovie retain];
bRet = true;
}
[pool release];
return bRet;
}
uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMediaTime )
{
uno::Reference< graphic::XGraphic > xRet;
NSImage* pImage = [mpMovie frameImageAtTime: QTMakeTimeWithTimeInterval(fMediaTime)];
NSData *pBitmap = [pImage TIFFRepresentation];
long nSize = [pBitmap length];
const void* pBitmapData = [pBitmap bytes];
SvMemoryStream aMemStm( const_cast<void *>(pBitmapData), nSize, StreamMode::READ | StreamMode::WRITE );
Graphic aGraphic;
if ( GraphicConverter::Import( aMemStm, aGraphic, ConvertDataFormat::TIF ) == ERRCODE_NONE )
{
xRet = aGraphic.GetXGraphic();
}
return xRet;
}
::rtl::OUString SAL_CALL FrameGrabber::getImplementationName( )
{
return ::rtl::OUString( AVMEDIA_QUICKTIME_FRAMEGRABBER_IMPLEMENTATIONNAME );
}
sal_Bool SAL_CALL FrameGrabber::supportsService( const ::rtl::OUString& ServiceName )
{
return ( ServiceName == AVMEDIA_QUICKTIME_FRAMEGRABBER_SERVICENAME );
}
uno::Sequence< ::rtl::OUString > SAL_CALL FrameGrabber::getSupportedServiceNames( )
{
return { AVMEDIA_QUICKTIME_FRAMEGRABBER_SERVICENAME };
}
} // namespace quicktime
} // namespace avmedia
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_AVMEDIA_SOURCE_QUICKTIME_MANAGER_HXX
#define INCLUDED_AVMEDIA_SOURCE_QUICKTIME_MANAGER_HXX
#include "quicktimecommon.hxx"
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/media/XManager.hpp>
namespace avmedia { namespace quicktime {
class Manager : public ::cppu::WeakImplHelper< css::media::XManager,
css::lang::XServiceInfo >
{
public:
Manager( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
virtual ~Manager();
// XManager
virtual css::uno::Reference< css::media::XPlayer > SAL_CALL createPlayer( const OUString& aURL ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
private:
css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
};
} // namespace quicktime
} // namespace avmedia
#endif // INCLUDED_AVMEDIA_SOURCE_QUICKTIME_MANAGER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "manager.hxx"
#include "player.hxx"
#include <tools/urlobj.hxx>
#include <osl/diagnose.h>
#include <sal/log.hxx>
using namespace ::com::sun::star;
namespace avmedia { namespace quicktime {
Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
mxMgr( rxMgr )
{
SAL_INFO( "avmedia.quicktime", "Manager::Manager" );
}
Manager::~Manager()
{
}
uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OUString& rURL )
{
Player* pPlayer( new Player( mxMgr ) );
uno::Reference< media::XPlayer > xRet( pPlayer );
INetURLObject aURL( rURL );
SAL_INFO( "avmedia.quicktime", "Manager::createPlayer" );
if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) ) )
xRet.clear();
return xRet;
}
::rtl::OUString SAL_CALL Manager::getImplementationName( )
{
return ::rtl::OUString( AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME );
}
sal_Bool SAL_CALL Manager::supportsService( const ::rtl::OUString& ServiceName )
{
return ( ServiceName == AVMEDIA_QUICKTIME_MANAGER_SERVICENAME );
}
uno::Sequence< ::rtl::OUString > SAL_CALL Manager::getSupportedServiceNames( )
{
return { AVMEDIA_QUICKTIME_MANAGER_SERVICENAME };
}
} // namespace quicktime
} // namespace avmedia
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_AVMEDIA_SOURCE_QUICKTIME_PLAYER_HXX
#define INCLUDED_AVMEDIA_SOURCE_QUICKTIME_PLAYER_HXX
#include "quicktimecommon.hxx"
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/media/XPlayer.hpp>
namespace avmedia { namespace quicktime {
class Player : public ::cppu::WeakImplHelper< css::media::XPlayer,
css::lang::XServiceInfo >
{
public:
Player( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxMgr );
virtual ~Player();
bool create( const OUString& rURL );
// XPlayer
virtual void SAL_CALL start( ) override;
virtual void SAL_CALL stop( ) override;
virtual sal_Bool SAL_CALL isPlaying( ) override;
virtual double SAL_CALL getDuration( ) override;
virtual void SAL_CALL setMediaTime( double fTime ) override;
virtual double SAL_CALL getMediaTime( ) override;
virtual void SAL_CALL setPlaybackLoop( sal_Bool bSet ) override;
virtual sal_Bool SAL_CALL isPlaybackLoop( ) override;
virtual void SAL_CALL setMute( sal_Bool bSet ) override;
virtual sal_Bool SAL_CALL isMute( ) override;
virtual void SAL_CALL setVolumeDB( sal_Int16 nVolumeDB ) override;
virtual sal_Int16 SAL_CALL getVolumeDB( ) override;
virtual css::awt::Size SAL_CALL getPreferredPlayerWindowSize( ) override;
virtual css::uno::Reference< css::media::XPlayerWindow > SAL_CALL createPlayerWindow( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
virtual css::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber( ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
QTMovie* getMovie();
private:
css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
OUString maURL;
QTMovie *mpMovie; // the Movie object
float mnUnmutedVolume;
double mnStopTime;
bool mbMuted;
bool mbInitialized;
};
} // namespace quicktime
} // namespace avmedia
#endif // INCLUDED_AVMEDIA_SOURCE_QUICKTIME_PLAYER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <math.h>
#include "player.hxx"
#include "framegrabber.hxx"
#include "window.hxx"
#include <sal/log.hxx>
using namespace ::com::sun::star;
SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.9
namespace avmedia { namespace quicktime {
Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
mxMgr( rxMgr ),
mpMovie( nil ),
mnUnmutedVolume( 0 ),
mnStopTime( DBL_MAX ), //max double
mbMuted( false ),
mbInitialized( false )
{
NSApplicationLoad();
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
mbInitialized = true;
[pool release];
}
Player::~Player()
{
if( mpMovie )
{
[mpMovie release];
mpMovie = nil;
}
}
QTMovie* Player::getMovie()
{
OSL_ASSERT( mpMovie );
return mpMovie;
}
bool Player::create( const ::rtl::OUString& rURL )
{
bool bRet = false;
// create the Movie
if( mbInitialized )
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
if( mpMovie )
{
[mpMovie release];
mpMovie = nil;
}
NSString* aNSStr = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rURL.getStr()) length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
NSURL* aURL = [NSURL URLWithString:aNSStr ];
NSError* pErr = nil;
mpMovie = [QTMovie movieWithURL:aURL error:&pErr];
if(mpMovie)
{
[mpMovie retain];
maURL = rURL;
bRet = true;
}
if( pErr )
{
SAL_INFO ( "avmedia.quicktime",
"NSMovie create failed with error " << (long)[pErr code] <<
" (" << [[pErr localizedDescription] UTF8String] << ")"
);
}
[pool release];
}
return bRet;
}
void SAL_CALL Player::start( )
{
SAL_INFO ( "avmedia.quicktime", "Player::start" );
if( mpMovie )
{
[mpMovie play];
}
}
void SAL_CALL Player::stop( )
{
SAL_INFO ( "avmedia.quicktime", "Player::stop" );
if( mpMovie )
{
[mpMovie stop];
}
}
sal_Bool SAL_CALL Player::isPlaying()
{
bool bRet = false;
if ( mpMovie )
{
if ([mpMovie rate] != 0)
{
bRet = true;
}
}
return bRet;
}
double SAL_CALL Player::getDuration( )
{
// slideshow checks for non-zero duration, so cheat here
double duration = 0.01;
if ( mpMovie ) // && mnDuration > 0 ) {
{
QTTime structDuration = [mpMovie duration] ;
duration = (double)structDuration.timeValue / (double)structDuration.timeScale;
}
return duration;
}
void SAL_CALL Player::setMediaTime( double fTime )
{
SAL_INFO ( "avmedia.quicktime", "Player::setMediaTime" );
if ( mpMovie )
{
[mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
}
}
double SAL_CALL Player::getMediaTime( )
{
double position = 0.0;
if ( mpMovie )
{
QTTime structDuration = [mpMovie currentTime] ;
position = (double)structDuration.timeValue / (double)structDuration.timeScale;
}
if(isPlaying() && position>mnStopTime)
{
stop();
}
return position;
}
void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet )
{
SAL_INFO ( "avmedia.quicktime",
"Player::setPlaybackLoop ? " << ( bSet?"True":"False" ) );
if(bSet)
{
[mpMovie setAttribute:[NSNumber numberWithBool:YES] forKey: QTMovieLoopsAttribute] ;
}
else
{
[mpMovie setAttribute:[NSNumber numberWithBool:NO] forKey: QTMovieLoopsAttribute] ;
}
}
sal_Bool SAL_CALL Player::isPlaybackLoop( )
{
bool bRet = [[mpMovie attributeForKey:QTMovieLoopsAttribute] boolValue];
SAL_INFO ( "avmedia.quicktime",
"Player::isPlaybackLoop ? " << ( bRet?"True":"False" ) );
return bRet;
}
void SAL_CALL Player::setMute( sal_Bool bSet )
{
SAL_INFO ( "avmedia.quicktime",
"set mute: " << bSet <<
" muted: " << mbMuted <<
" unmuted volume: " << mnUnmutedVolume );
// change the volume to 0 or the unmuted volume
if( mpMovie && mbMuted != bool(bSet) )
{
[mpMovie setMuted: bSet ];
mbMuted = bSet;
}
}
sal_Bool SAL_CALL Player::isMute( )
{
SAL_INFO ( "avmedia.quicktime", "Player::isMuted" );
return mbMuted;
}
void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB )
{
// OOo db volume -40 = QTVolume 0
// OOo db volume 0 = QTvolume 1
if(nVolumeDB==-40)
{
mnUnmutedVolume = 0;
}
else
{
mnUnmutedVolume = pow( 10.0, nVolumeDB / 20.0 );
}
SAL_INFO ( "avmedia.quicktime",
"set volume: " << nVolumeDB <<
" gst volume: " << mnUnmutedVolume );
// change volume
if( !mbMuted && mpMovie )
{
[mpMovie setVolume: mnUnmutedVolume ];
}
}
sal_Int16 SAL_CALL Player::getVolumeDB( )
{
sal_Int16 nVolumeDB = 0.0;
if( mpMovie )
{
float volume = 0.0;
volume = [mpMovie volume];
if(volume>0) //protect from log10(0)
{
nVolumeDB = (sal_Int16) ( 20.0*log10 ( volume ) );
}
else
{
nVolumeDB = -40 ; // QT zero volume is no volume, -40db
}
}
return nVolumeDB;
}
awt::Size SAL_CALL Player::getPreferredPlayerWindowSize( )
{
NSSize nsSize = [[mpMovie attributeForKey:QTMovieNaturalSizeAttribute] sizeValue];
awt::Size aSize( nsSize.width, nsSize.height );
return aSize;
}
uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
{
uno::Reference< ::media::XPlayerWindow > xRet;
awt::Size aSize( getPreferredPlayerWindowSize() );
SAL_INFO ( "avmedia.quicktime",
"Player::createPlayerWindow " << aSize.Width << " x " << aSize.Height <<
" length: " << aArguments.getLength() );
if( aSize.Width > 0 && aSize.Height > 0 )
{
sal_IntPtr nPtr = 0;
aArguments[0] >>= nPtr;
NSView* pParentView = reinterpret_cast< NSView * >(nPtr);
::avmedia::quicktime::Window* pWindow = new ::avmedia::quicktime::Window( mxMgr, *this, pParentView );
xRet = pWindow;
}
return xRet;
}
uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber( )
{
uno::Reference< media::XFrameGrabber > xRet;
SAL_INFO ( "avmedia.quicktime", "Player::createFrameGrabber" );
if( !maURL.isEmpty() )
{
FrameGrabber* pGrabber = new FrameGrabber( mxMgr );
xRet = pGrabber;
if( !pGrabber->create( maURL ) )
{
xRet.clear();
}
}
return xRet;
}
::rtl::OUString SAL_CALL Player::getImplementationName( )
{
return ::rtl::OUString( AVMEDIA_QUICKTIME_PLAYER_IMPLEMENTATIONNAME );
}
sal_Bool SAL_CALL Player::supportsService( const ::rtl::OUString& ServiceName )
{
return ( ServiceName == AVMEDIA_QUICKTIME_PLAYER_SERVICENAME );
}
uno::Sequence< ::rtl::OUString > SAL_CALL Player::getSupportedServiceNames( )
{
return { AVMEDIA_QUICKTIME_PLAYER_SERVICENAME };
}
} // namespace quicktime
} // namespace avmedia
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_AVMEDIA_SOURCE_QUICKTIME_QUICKTIMECOMMON_HXX
#define INCLUDED_AVMEDIA_SOURCE_QUICKTIME_QUICKTIMECOMMON_HXX
#ifdef MACOSX
#include <premac.h>
#import <Cocoa/Cocoa.h>
#import <QTKit/QTKit.h>
#include <postmac.h>
#endif
#include <osl/mutex.hxx>
#include <rtl/ustring.hxx>
#include <tools/stream.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/KeyModifier.hpp>
#include <com/sun/star/awt/MouseButton.hpp>
#include <com/sun/star/media/XManager.hpp>
#define AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Manager_QuickTime"
#define AVMEDIA_QUICKTIME_MANAGER_SERVICENAME "com.sun.star.media.Manager_QuickTime"
#define AVMEDIA_QUICKTIME_PLAYER_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Player_QuickTime"
#define AVMEDIA_QUICKTIME_PLAYER_SERVICENAME "com.sun.star.media.Player_QuickTime"
#define AVMEDIA_QUICKTIME_WINDOW_IMPLEMENTATIONNAME "com.sun.star.comp.avmedia.Window_QuickTime"
#define AVMEDIA_QUICKTIME_WINDOW_SERVICENAME "com.sun.star.media.Window_QuickTime"
#endif // INCLUDED_AVMEDIA_SOURCE_QUICKTIME_QUICKTIMECOMMON_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 "quicktimecommon.hxx"
#include "manager.hxx"
using namespace ::com::sun::star;
// - factory methods -
static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
{
return uno::Reference< uno::XInterface >( *new ::avmedia::quicktime::Manager( rxFact ) );
}
extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediaQuickTime_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
{
uno::Reference< lang::XSingleServiceFactory > xFactory;
void* pRet = nullptr;
if( rtl_str_compare( pImplName, AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME ) == 0 )
{
const ::rtl::OUString aServiceName( AVMEDIA_QUICKTIME_MANAGER_SERVICENAME );
xFactory.set( ::cppu::createSingleFactory(
static_cast< lang::XMultiServiceFactory* >( pServiceManager ),
AVMEDIA_QUICKTIME_MANAGER_IMPLEMENTATIONNAME,
create_MediaPlayer, uno::Sequence< OUString >( &aServiceName, 1 ) ) );
}
if( xFactory.is() )
{
xFactory->acquire();
pRet = xFactory.get();
}
return pRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 .
*/
#ifndef INCLUDED_AVMEDIA_SOURCE_QUICKTIME_WINDOW_HXX
#define INCLUDED_AVMEDIA_SOURCE_QUICKTIME_WINDOW_HXX
#include "quicktimecommon.hxx"
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/interfacecontainer.h>
#include <com/sun/star/media/XPlayerWindow.hpp>
namespace avmedia { namespace quicktime {
class Player;
class Window : public ::cppu::WeakImplHelper< css::media::XPlayerWindow,
css::lang::XServiceInfo >
{
public:
Window( const css::uno::Reference< css::lang::XMultiServiceFactory >& i_rxMgr,
Player& i_rPlayer,
NSView* i_pParentView
);
virtual ~Window();
void processGraphEvent();
void updatePointer();
// XPlayerWindow
virtual void SAL_CALL update( ) override;
virtual sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ) override;
virtual css::media::ZoomLevel SAL_CALL getZoomLevel( ) override;
virtual void SAL_CALL setPointerType( sal_Int32 nPointerType ) override;
// XWindow
virtual void SAL_CALL setPosSize( sal_Int32 , sal_Int32 , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) override;
virtual css::awt::Rectangle SAL_CALL getPosSize( ) override;
virtual void SAL_CALL setVisible( sal_Bool ) override;
virtual void SAL_CALL setEnable( sal_Bool ) override;
virtual void SAL_CALL setFocus( ) override;
virtual void SAL_CALL addWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) override;
virtual void SAL_CALL removeWindowListener( const css::uno::Reference< css::awt::XWindowListener >& xListener ) override;
virtual void SAL_CALL addFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) override;
virtual void SAL_CALL removeFocusListener( const css::uno::Reference< css::awt::XFocusListener >& xListener ) override;
virtual void SAL_CALL addKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) override;
virtual void SAL_CALL removeKeyListener( const css::uno::Reference< css::awt::XKeyListener >& xListener ) override;
virtual void SAL_CALL addMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
virtual void SAL_CALL removeMouseListener( const css::uno::Reference< css::awt::XMouseListener >& xListener ) override;
virtual void SAL_CALL addMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
virtual void SAL_CALL removeMouseMotionListener( const css::uno::Reference< css::awt::XMouseMotionListener >& xListener ) override;
virtual void SAL_CALL addPaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
virtual void SAL_CALL removePaintListener( const css::uno::Reference< css::awt::XPaintListener >& xListener ) override;
// XComponent
virtual void SAL_CALL dispose( ) override;
virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
private:
css::uno::Reference< css::lang::XMultiServiceFactory > mxMgr;
::osl::Mutex maMutex;
::cppu::OMultiTypeInterfaceContainerHelper maListeners;
css::media::ZoomLevel meZoomLevel;
Player& mrPlayer;
int mnPointerType;
NSView* mpParentView; // parent view for our own private movie view
QTMovieView* mpMovieView; // the view containing the movie object, output target and controller
void ImplLayoutVideoWindow();
};
} // namespace quicktime
} // namespace avmedia
#endif // INCLUDED_AVMEDIA_SOURCE_QUICKTIME_WINDOW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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 <com/sun/star/awt/SystemPointer.hpp>
#include <com/sun/star/awt/PosSize.hpp>
#include "window.hxx"
#include "player.hxx"
#include <sal/log.hxx>
using namespace ::com::sun::star;
SAL_WNODEPRECATED_DECLARATIONS_PUSH //TODO: 10.9
namespace avmedia { namespace quicktime {
static ::osl::Mutex& ImplGetOwnStaticMutex()
{
static ::osl::Mutex* pMutex = nullptr;
if( pMutex == nullptr )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( pMutex == nullptr )
{
static ::osl::Mutex aMutex;
pMutex = &aMutex;
}
}
return *pMutex;
}
Window::Window( const uno::Reference< lang::XMultiServiceFactory >& i_rxMgr, Player& i_rPlayer, NSView* i_pParentView ) :
mxMgr( i_rxMgr ),
maListeners( maMutex ),
meZoomLevel( media::ZoomLevel_NOT_AVAILABLE ),
mrPlayer( i_rPlayer ),
mnPointerType( awt::SystemPointer::ARROW ),
mpParentView( i_pParentView ),
mpMovieView( nil )
{
::osl::MutexGuard aGuard( ImplGetOwnStaticMutex() );
if( mpParentView ) // sanity check
{
NSRect aViewRect = [mpParentView frame];
aViewRect.origin.x = aViewRect.origin.y = 0;
mpMovieView = [[QTMovieView alloc] initWithFrame: aViewRect];
[mpMovieView setMovie: mrPlayer.getMovie() ];
[mpMovieView setControllerVisible: NO];
[mpMovieView setPreservesAspectRatio: YES];
[mpMovieView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[mpParentView addSubview: mpMovieView];
[mpParentView setAutoresizesSubviews: YES];
}
SAL_INFO ( "avmedia.quicktime", "Window::Window" );
}
Window::~Window()
{
if( mpMovieView )
{
[mpMovieView removeFromSuperview];
[mpMovieView setMovie:nil];
[mpMovieView release];
mpMovieView = nil;
}
}
// XPlayerWindow
void SAL_CALL Window::update( )
{
;
}
sal_Bool SAL_CALL Window::setZoomLevel( media::ZoomLevel )
{
return false;
}
media::ZoomLevel SAL_CALL Window::getZoomLevel( )
{
return meZoomLevel;
}
void SAL_CALL Window::setPointerType( sal_Int32 nPointerType )
{
mnPointerType = nPointerType;
}
// XWindow
void SAL_CALL Window::setPosSize( sal_Int32 , sal_Int32 , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
{
if( mpParentView && mpMovieView )
{
NSRect aRect = [mpMovieView frame];
if( (Flags & awt::PosSize::WIDTH) )
aRect.size.width = Width;
if( (Flags & awt::PosSize::HEIGHT) )
aRect.size.height = Height;
}
}
awt::Rectangle SAL_CALL Window::getPosSize()
{
awt::Rectangle aRet;
NSRect aRect = [mpMovieView frame];
aRet.X = aRet.Y = 0;
aRet.Width = aRect.size.width;
aRet.Height = aRect.size.height;
return aRet;
}
void SAL_CALL Window::setVisible( sal_Bool )
{
SAL_INFO ( "avmedia.quicktime", "Window::setVisible" );
}
void SAL_CALL Window::setEnable( sal_Bool )
{
;
}
void SAL_CALL Window::setFocus( )
{
SAL_INFO ( "avmedia.quicktime", "Window::setFocus" );
}
void SAL_CALL Window::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
// XComponent
void SAL_CALL Window::dispose( )
{
}
void SAL_CALL Window::addEventListener( const uno::Reference< lang::XEventListener >& xListener )
{
maListeners.addInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
void SAL_CALL Window::removeEventListener( const uno::Reference< lang::XEventListener >& xListener )
{
maListeners.removeInterface( cppu::UnoType<decltype(xListener)>::get(), xListener );
}
// XServiceInfo
::rtl::OUString SAL_CALL Window::getImplementationName( )
{
return ::rtl::OUString( AVMEDIA_QUICKTIME_WINDOW_IMPLEMENTATIONNAME );
}
sal_Bool SAL_CALL Window::supportsService( const ::rtl::OUString& ServiceName )
{
return ( ServiceName == AVMEDIA_QUICKTIME_WINDOW_SERVICENAME );
}
uno::Sequence< ::rtl::OUString > SAL_CALL Window::getSupportedServiceNames( )
{
return { AVMEDIA_QUICKTIME_WINDOW_SERVICENAME };
}
} // namespace quicktime
} // namespace avmedia
SAL_WNODEPRECATED_DECLARATIONS_POP
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -195,10 +195,6 @@ uno::Reference<media::XPlayer> MediaWindowImpl::createPlayer(const OUString& rUR ...@@ -195,10 +195,6 @@ uno::Reference<media::XPlayer> MediaWindowImpl::createPlayer(const OUString& rUR
// two significant versions deployed at once ... // two significant versions deployed at once ...
#ifdef AVMEDIA_MANAGER_SERVICE_NAME_OLD #ifdef AVMEDIA_MANAGER_SERVICE_NAME_OLD
AVMEDIA_MANAGER_SERVICE_NAME_OLD AVMEDIA_MANAGER_SERVICE_NAME_OLD
#endif
// fallback to AVMedia framework on OS X
#ifdef AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1
AVMEDIA_MANAGER_SERVICE_NAME_FALLBACK1
#endif #endif
}; };
......
...@@ -128,11 +128,6 @@ $(eval $(call gb_Rdb_add_components,services,\ ...@@ -128,11 +128,6 @@ $(eval $(call gb_Rdb_add_components,services,\
writerperfect/source/calc/wpftcalc \ writerperfect/source/calc/wpftcalc \
$(if $(filter MACOSX,$(OS)), \ $(if $(filter MACOSX,$(OS)), \
$(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \ $(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \
$(if $(filter TRUE,$(ENABLE_MACOSX_SANDBOX)),, \
$(if $(shell test $(MACOSX_SDK_VERSION) -ge 101200 || echo nope), \
$(call gb_Helper_optional,AVMEDIA,avmedia/source/quicktime/avmediaQuickTime) \
) \
) \
lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \ lingucomponent/source/spellcheck/macosxspell/MacOSXSpell \
fpicker/source/aqua/fps_aqua \ fpicker/source/aqua/fps_aqua \
shell/source/backends/macbe/macbe1 \ shell/source/backends/macbe/macbe1 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment