diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-13 08:07:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-13 08:14:00 +0200 |
commit | 3a705ab40597f7cb584bdeaef06701b289f911f1 (patch) | |
tree | 70d0b6bbf26c8ad07d8f1ced8e06c9eef02b6dc9 /avmedia/source/macavf | |
parent | c3586b684c58e06cd80dea87d7681354acfec80b (diff) |
OSL_TRACE->SAL in avmedia..canvas
Change-Id: Id9077ea29e7028c12f40abfd4c57756c863e3cd9
Diffstat (limited to 'avmedia/source/macavf')
-rw-r--r-- | avmedia/source/macavf/framegrabber.mm | 5 | ||||
-rw-r--r-- | avmedia/source/macavf/manager.mm | 3 | ||||
-rw-r--r-- | avmedia/source/macavf/player.mm | 29 | ||||
-rw-r--r-- | avmedia/source/macavf/window.mm | 7 |
4 files changed, 5 insertions, 39 deletions
diff --git a/avmedia/source/macavf/framegrabber.mm b/avmedia/source/macavf/framegrabber.mm index d95120990823..b4022caf360e 100644 --- a/avmedia/source/macavf/framegrabber.mm +++ b/avmedia/source/macavf/framegrabber.mm @@ -51,7 +51,7 @@ bool FrameGrabber::create( const ::rtl::OUString& rURL ) AVAsset* pMovie = [AVURLAsset URLAssetWithURL:pNSURL options:nil]; if( !pMovie ) { - OSL_TRACE( "AVGrabber::create() cannot load url=\"%s\"", [pNSStr UTF8String] ); + SAL_WARN("avmedia", "AVGrabber::create() cannot load url=" << [pNSStr UTF8String] ); return false; } @@ -63,7 +63,7 @@ bool FrameGrabber::create( AVAsset* pMovie ) { if( [[pMovie tracksWithMediaType:AVMediaTypeVideo] count] == 0) { - OSL_TRACE( "AVGrabber::create() found no video content!" ); + SAL_WARN("avmedia", "AVGrabber::create() found no video content!" ); return false; } @@ -79,7 +79,6 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe uno::Reference< graphic::XGraphic > xRet; if( !mpImageGen ) return xRet; - OSL_TRACE( "AVPlayer::grabFrame( %.3fsec)", fMediaTime ); // get the requested image from the movie CGImage* pCGImage = [mpImageGen copyCGImageAtTime:CMTimeMakeWithSeconds(fMediaTime,1000) actualTime:nullptr error:nullptr]; diff --git a/avmedia/source/macavf/manager.mm b/avmedia/source/macavf/manager.mm index a8ff2ec2928d..5df4af80c37b 100644 --- a/avmedia/source/macavf/manager.mm +++ b/avmedia/source/macavf/manager.mm @@ -29,7 +29,6 @@ namespace avmedia { namespace macavf { Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : mxMgr( rxMgr ) { - OSL_TRACE( "Constructing avmedia::macavf::Manager" ); } @@ -44,8 +43,6 @@ uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const ::rtl::OU uno::Reference< media::XPlayer > xRet( pPlayer ); INetURLObject aURL( rURL ); - OSL_TRACE( "avmediamacavf: Manager::createPlayer" ); - if( !pPlayer->create( aURL.GetMainURL( INetURLObject::DecodeMechanism::Unambiguous ) ) ) xRet.clear(); diff --git a/avmedia/source/macavf/player.mm b/avmedia/source/macavf/player.mm index 48be43937fd3..7bf749484a0d 100644 --- a/avmedia/source/macavf/player.mm +++ b/avmedia/source/macavf/player.mm @@ -31,7 +31,6 @@ using namespace ::com::sun::star; { (void) pObject; NSString* pDictStr = [NSString stringWithFormat:@"%@", pChangeDict]; - OSL_TRACE( "MacAVObserver::onKeyChange k=\"%s\" c=%s", [pKeyPath UTF8String], [pDictStr UTF8String]); avmedia::macavf::MacAVObserverHandler* pHandler = static_cast<avmedia::macavf::MacAVObserverHandler*>(pContext); pHandler->handleObservation( pKeyPath ); } @@ -39,7 +38,6 @@ using namespace ::com::sun::star; - (void)onNotification:(NSNotification*)pNotification { NSString* pNoteName = (NSString*)[pNotification name]; - OSL_TRACE( "MacAVObserver::onNotification key=\"%s\"", [pNoteName UTF8String]); HandlersForObject::iterator it = maHandlersForObject.find( [pNotification object]); if( it != maHandlersForObject.end() ) (*it).second->handleObservation( pNoteName ); @@ -101,10 +99,8 @@ Player::~Player() bool Player::handleObservation( NSString* pKeyPath ) { - OSL_TRACE( "AVPlayer::handleObservation key=\"%s\"", [pKeyPath UTF8String]); if( [pKeyPath isEqualToString:AVPlayerItemDidPlayToEndTimeNotification]) { - OSL_TRACE( "AVPlayer replay=%d", mbLooping); if( mbLooping ) setMediaTime( 0.0); } @@ -162,14 +158,8 @@ void SAL_CALL Player::start() { if( !mpPlayer ) return; -#if 0 - const AVPlayerStatus eStatus = [mpPlayer status]; - OSL_TRACE ("Player::start status=%d", (int)eStatus); - if( eStatus == AVPlayerStatusReadyToPlay) -#endif - { - [mpPlayer play]; - } + + [mpPlayer play]; // else // TODO: delay until it becomes ready } @@ -180,7 +170,6 @@ void SAL_CALL Player::stop() if( !mpPlayer ) return; const bool bPlaying = isPlaying(); - OSL_TRACE ("Player::stop() playing=%d", bPlaying); if( bPlaying ) [mpPlayer pause]; } @@ -218,7 +207,6 @@ double SAL_CALL Player::getDuration() void SAL_CALL Player::setMediaTime( double fTime ) throw (uno::RuntimeException) { - OSL_TRACE ("Player::setMediaTime( %.3fsec)", fTime); if( mpPlayer ) [mpPlayer seekToTime: CMTimeMakeWithSeconds(fTime,1000) ]; } @@ -231,7 +219,6 @@ double SAL_CALL Player::getMediaTime() return 0.0; const double position = CMTimeGetSeconds( [mpPlayer currentTime] ); - OSL_TRACE( "Player::getMediaTime() = %.3fsec", position); if( position >= mfStopTime ) if( isPlaying() ) stop(); @@ -243,7 +230,6 @@ double SAL_CALL Player::getMediaTime() void SAL_CALL Player::setStopTime( double fTime ) throw (uno::RuntimeException) { - OSL_TRACE ("Player::setStopTime( %.3fsec)", fTime); mfStopTime = fTime; } @@ -258,7 +244,6 @@ double SAL_CALL Player::getStopTime() void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) throw (uno::RuntimeException) { - OSL_TRACE ("Player::setPlaybackLoop( %d)", bSet ); mbLooping = bSet; } @@ -266,17 +251,13 @@ void SAL_CALL Player::setPlaybackLoop( sal_Bool bSet ) sal_Bool SAL_CALL Player::isPlaybackLoop() throw (uno::RuntimeException) { - const bool bRet = mbLooping; - OSL_TRACE ("Player::isPlaybackLoop() = %d", bRet ); - return bRet; + return mbLooping; } void SAL_CALL Player::setMute( sal_Bool bSet ) throw (uno::RuntimeException) { - OSL_TRACE( "Player::setMute(%d), was-muted: %d unmuted-volume: %.3f", bSet, mbMuted, mfUnmutedVolume ); - if( !mpPlayer ) return; @@ -288,7 +269,6 @@ void SAL_CALL Player::setMute( sal_Bool bSet ) sal_Bool SAL_CALL Player::isMute() throw (uno::RuntimeException) { - OSL_TRACE ("Player::isMuted() = %d", mbMuted); return mbMuted; } @@ -299,7 +279,6 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) // -40dB <-> AVPlayer volume 0.0 // 0dB <-> AVPlayer volume 1.0 mfUnmutedVolume = (nVolumeDB <= -40) ? 0.0 : pow( 10.0, nVolumeDB / 20.0 ); - OSL_TRACE( "Player::setVolume(%ddB), muted=%d, unmuted-volume: %.3f", nVolumeDB, mbMuted, mfUnmutedVolume ); // change volume if( !mbMuted && mpPlayer ) @@ -348,7 +327,6 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co { // get the preferred window size const awt::Size aSize( getPreferredPlayerWindowSize() ); - OSL_TRACE( "Player::createPlayerWindow %dx%d argsLength: %d", aSize.Width, aSize.Height, aArguments.getLength() ); // get the parent view sal_IntPtr nNSViewPtr = 0; @@ -371,7 +349,6 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() throw (uno::RuntimeException) { uno::Reference< media::XFrameGrabber > xRet; - OSL_TRACE ("Player::createFrameGrabber"); FrameGrabber* pGrabber = new FrameGrabber( mxMgr ); AVAsset* pMovie = [[mpPlayer currentItem] asset]; diff --git a/avmedia/source/macavf/window.mm b/avmedia/source/macavf/window.mm index ba97063a3ab0..6b3f3543c770 100644 --- a/avmedia/source/macavf/window.mm +++ b/avmedia/source/macavf/window.mm @@ -37,7 +37,6 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& i_rxMgr, Pla , mpView( i_pParentView ) , mpPlayerLayer( nullptr ) { - OSL_TRACE ("Constructing an avmedia::macavf::Window"); if( !mpView ) // sanity check return; @@ -46,7 +45,6 @@ Window::Window( const uno::Reference< lang::XMultiServiceFactory >& i_rxMgr, Pla AVAsset* pMovie = [[pAVPlayer currentItem] asset]; const int nVideoCount = [pMovie tracksWithMediaType:AVMediaTypeVideo].count; const int nAudioCount = [pMovie tracksWithMediaType:AVMediaTypeAudio].count; - OSL_TRACE( "Found %d video and %d audio tracks.", nVideoCount, nAudioCount ); (void)nAudioCount; if( nVideoCount <= 0 ) return; @@ -77,7 +75,6 @@ Window::~Window() bool Window::handleObservation( NSString* pKeyPath ) { - OSL_TRACE( "AVPlayer::handleObservation key=\"%s\"", [pKeyPath UTF8String]); const BOOL bReadyForDisplay = [mpPlayerLayer isReadyForDisplay]; [mpPlayerLayer setHidden:!bReadyForDisplay]; return true; @@ -115,7 +112,6 @@ void SAL_CALL Window::setPointerType( sal_Int32 nPointerType ) void SAL_CALL Window::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 /* Flags */ ) throw (uno::RuntimeException) { - OSL_TRACE( "AVWindow::setPosSize( %dx%d%+d%+d)", (int)Width,(int)Height,(int)X,(int)Y);//###### if( !mpView ) return; NSRect aRect = [mpView frame]; @@ -147,21 +143,18 @@ awt::Rectangle SAL_CALL Window::getPosSize() void SAL_CALL Window::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException) { - OSL_TRACE ("Window::setVisible(%d)", bVisible); } void SAL_CALL Window::setEnable( sal_Bool bEnable ) throw (uno::RuntimeException) { - OSL_TRACE ("Window::setEnable(%d)", bEnable); } void SAL_CALL Window::setFocus() throw (uno::RuntimeException) { - OSL_TRACE ("Window::setFocus"); } |