[Libreoffice-commits] core.git: 2 commits - avmedia/Module_avmedia.mk avmedia/source postprocess/Rdb_services.mk scp2/source

Tor Lillqvist tml at collabora.com
Fri May 16 02:59:51 PDT 2014


 avmedia/Module_avmedia.mk              |    3 ---
 avmedia/source/macavf/macavfcommon.hxx |   16 +++++++++++++---
 avmedia/source/macavf/player.mm        |   16 +++-------------
 avmedia/source/macavf/window.mm        |    6 ++++--
 postprocess/Rdb_services.mk            |    4 +---
 scp2/source/ooo/file_library_ooo.scp   |    2 --
 6 files changed, 21 insertions(+), 26 deletions(-)

New commits:
commit d2397ab0ad61b6331d41880ba896e28fa8fcb98d
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri May 16 11:36:25 2014 +0300

    Use correct header guard name in comment at #endif
    
    Change-Id: I2df05054c4108cb173f80ce6fa66f30c713b70cd

diff --git a/avmedia/source/macavf/macavfcommon.hxx b/avmedia/source/macavf/macavfcommon.hxx
index 618a566..78bd6d1 100644
--- a/avmedia/source/macavf/macavfcommon.hxx
+++ b/avmedia/source/macavf/macavfcommon.hxx
@@ -92,6 +92,6 @@ public:
 
 }}
 
-#endif // MACAVF_COMMON_HXX
+#endif // INCLUDED_AVMEDIA_SOURCE_MACAVF_MACAVFCOMMON_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7822b5535cccc68e5b454d04a66a6b4f27675ec6
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri May 16 10:59:13 2014 +0300

    Make the MacAVF code build also as 32-bit
    
    When compiling 32-bit OS X code, the code will use the "legacy
    Objective-C runtime", which means that instance variables of an
    Objective-C class must be declared in the @interface block, not in the
    @implementation.
    
    CGRect and NSRect are not the same for 32-bit code.
    
    Also, use boost::unordered_map.
    
    Change-Id: Icc56ff298203565a7568714b0e9f42c7c6b89737

diff --git a/avmedia/Module_avmedia.mk b/avmedia/Module_avmedia.mk
index 06bbef7..bd0382d 100644
--- a/avmedia/Module_avmedia.mk
+++ b/avmedia/Module_avmedia.mk
@@ -44,15 +44,12 @@ endif
 endif
 
 ifeq ($(OS),MACOSX)
-ifeq ($(CPUNAME),X86_64)
-# The macavf code is a bit x86_64 dependent...
 ifneq (1060,$(MACOSX_SDK_VERSION))
 $(eval $(call gb_Module_add_targets,avmedia,\
 	Library_avmediaMacAVF \
 ))
 endif
 endif
-endif
 
 ifneq ($(ENABLE_DIRECTX),)
 $(eval $(call gb_Module_add_targets,avmedia,\
diff --git a/avmedia/source/macavf/macavfcommon.hxx b/avmedia/source/macavf/macavfcommon.hxx
index 7082724..618a566 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 6c348e0..14f8a07 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 af54f0c..ea1132b 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)];
 }
 
 // ------------------------------------------------------------------------------
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 750fafe..9ebe6d2 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -122,9 +122,7 @@ $(eval $(call gb_Rdb_add_components,services,\
 	writerperfect/source/writer/wpftwriter \
 	$(if $(filter MACOSX,$(OS)), \
 		$(if $(filter 1060,$(MACOSX_SDK_VERSION)),, \
-			$(if $(filter X86_64,$(CPUNAME)), \
-				$(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \
-			) \
+			$(call gb_Helper_optional,AVMEDIA,avmedia/source/macavf/avmediaMacAVF) \
 		) \
 		$(if $(filter TRUE,$(ENABLE_MACOSX_SANDBOX)),, \
 			$(call gb_Helper_optional,AVMEDIA,avmedia/source/quicktime/avmediaQuickTime) \
diff --git a/scp2/source/ooo/file_library_ooo.scp b/scp2/source/ooo/file_library_ooo.scp
index fa61087..6c27cf2 100644
--- a/scp2/source/ooo/file_library_ooo.scp
+++ b/scp2/source/ooo/file_library_ooo.scp
@@ -108,13 +108,11 @@ File gid_File_Lib_avmediaQuickTime
 End
 
 #if MAXOSX_SDK_VERSION >= 1070
-#ifdef X86_64
 File gid_File_Lib_avmediaMacAVF
 	PACKED_LIB_FILE_BODY;
 	Name = LIBNAME(avmediaMacAVF);
 End
 #endif
-#endif
 
 #endif
 


More information about the Libreoffice-commits mailing list