diff options
Diffstat (limited to 'avmedia/source')
-rw-r--r-- | avmedia/source/macavf/macavfcommon.hxx | 14 | ||||
-rw-r--r-- | avmedia/source/macavf/player.mm | 16 | ||||
-rw-r--r-- | avmedia/source/macavf/window.mm | 6 |
3 files changed, 19 insertions, 17 deletions
diff --git a/avmedia/source/macavf/macavfcommon.hxx b/avmedia/source/macavf/macavfcommon.hxx index 7082724ac27e..618a5667509f 100644 --- a/avmedia/source/macavf/macavfcommon.hxx +++ b/avmedia/source/macavf/macavfcommon.hxx @@ -20,12 +20,13 @@ #ifndef INCLUDED_AVMEDIA_SOURCE_MACAVF_MACAVFCOMMON_HXX #define INCLUDED_AVMEDIA_SOURCE_MACAVF_MACAVFCOMMON_HXX -#ifdef MACOSX #include <premac.h> #import <Cocoa/Cocoa.h> #import <AVFoundation/AVFoundation.h> #include <postmac.h> -#endif + +#include <boost/unordered_map.hpp> + #include <osl/mutex.hxx> #include <rtl/ustring.hxx> #include <tools/debug.hxx> @@ -64,7 +65,16 @@ // MacAVObserver handles the notifications used in the AVFoundation framework +namespace avmedia { namespace macavf { +class MacAVObserverHandler; +} } + +typedef boost::unordered_map<NSObject*,avmedia::macavf::MacAVObserverHandler*> HandlersForObject; + @interface MacAVObserverObject : NSObject +{ + HandlersForObject maHandlersForObject; +} - (void)observeValueForKeyPath:(NSString*)pKeyPath ofObject:(id)pObject change:(NSDictionary*)pChangeDict context:(void*)pContext; - (void)onNotification:(NSNotification*)pNotification; @end diff --git a/avmedia/source/macavf/player.mm b/avmedia/source/macavf/player.mm index 6c348e0ef4be..14f8a073336a 100644 --- a/avmedia/source/macavf/player.mm +++ b/avmedia/source/macavf/player.mm @@ -25,18 +25,8 @@ using namespace ::com::sun::star; -#ifdef _LIBCPP_VERSION -#include <unordered_map> -typedef std::unordered_map<NSObject*,avmedia::macavf::MacAVObserverHandler*> HandlersForObject; -#else -#include <ext/hash_map> -typedef std::hash_map<NSObject*,avmedia::macavf::MacAVObserverHandler*> HandlersForObject; -#endif - @implementation MacAVObserverObject -{ - HandlersForObject maHandlersForObject; -} + - (void)observeValueForKeyPath:(NSString*)pKeyPath ofObject:(id)pObject change:(NSDictionary*)pChangeDict context:(void*)pContext { (void) pObject; @@ -387,7 +377,7 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() NSArray* pVideoTracks = [pMovie tracksWithMediaType:AVMediaTypeVideo]; if ([pVideoTracks count] > 0) { - AVAssetTrack* pFirstVideoTrack =(AVAssetTrack*)pVideoTracks[0]; + AVAssetTrack* pFirstVideoTrack = (AVAssetTrack*) [pVideoTracks objectAtIndex:0]; const CGSize aPrefSize = [pFirstVideoTrack naturalSize]; aSize = awt::Size( aPrefSize.width, aPrefSize.height ); } @@ -405,7 +395,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co OSL_TRACE( "Player::createPlayerWindow %dx%d argsLength: %d", aSize.Width, aSize.Height, aArguments.getLength() ); // get the parent view - sal_IntPtr nNSViewPtr = NULL; + sal_IntPtr nNSViewPtr = 0; aArguments[0] >>= nNSViewPtr; NSView* pParentView = reinterpret_cast<NSView*>(nNSViewPtr); diff --git a/avmedia/source/macavf/window.mm b/avmedia/source/macavf/window.mm index af54f0cad40a..ea1132bedba9 100644 --- a/avmedia/source/macavf/window.mm +++ b/avmedia/source/macavf/window.mm @@ -60,7 +60,8 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& i_rxMgr, Pla [pAVPlayer pause]; mpPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:pAVPlayer]; [mpPlayerLayer retain]; - [mpPlayerLayer setFrame:[mpView frame]]; + NSRect viewFrame = [mpView frame]; + [mpPlayerLayer setFrame:CGRectMake(viewFrame.origin.x, viewFrame.origin.y, viewFrame.size.width, viewFrame.size.height)]; [mpPlayerLayer setHidden:YES]; [mpPlayerLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill]; [mpPlayerLayer addObserver:getObserver() forKeyPath:@"readyForDisplay" options:0 context:this]; @@ -142,7 +143,8 @@ void SAL_CALL Window::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal aRect.size.height = Height; [mpView setFrameSize: aRect.size]; - [mpPlayerLayer setFrame: [mpView frame]]; + NSRect viewFrame = [mpView frame]; + [mpPlayerLayer setFrame:CGRectMake(viewFrame.origin.x, viewFrame.origin.y, viewFrame.size.width, viewFrame.size.height)]; } // ------------------------------------------------------------------------------ |