summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-11-11 14:21:16 +0000
committerOliver Bolte <obo@openoffice.org>2009-11-11 14:21:16 +0000
commit15d255a9ec6ad45779ce63dcc101b2287036c8c5 (patch)
treed1c204e40bccf6dbb005443bae99dc747fe0d8c8 /avmedia
parentf97e860a31ffb3535002e5cd31f37eb20eddc620 (diff)
CWS-TOOLING: integrate CWS ooo32gsl03
2009-11-04 20:19:30 +0100 hdu r277364 : #i105769# final cleanup of the trapezoid converter for OOO320 2009-11-04 18:54:50 +0100 hdu r277363 : #i105769# force intersection point to be bit-identical on each involved segment 2009-11-03 08:04:26 +0100 hdu r277308 : #i105769# remove elimination of horizontal segments out of intersection solver again 2009-11-02 19:06:32 +0100 hdu r277304 : #i105769# adjust my intersection-solver for the needs of the trapezoid converter 2009-11-02 11:03:31 +0100 hdu r277291 : #i105769# start integrating my intersection-solver 2009-10-28 17:04:53 +0100 cl r277246 : #i106369# only hide placeholder on master page not all text shapes 2009-10-28 17:00:22 +0100 aw r277245 : #i106183# added fix as described tin task 2009-10-27 18:08:07 +0100 pl r277229 : #i106351# avoid early exits when changing state 2009-10-27 16:25:59 +0100 aw r277217 : #i103454# need to set all PaperSizes (three) at the Outliner to get the right layout 2009-10-27 13:29:43 +0100 pl r277201 : #i106261# do not confuse stop with start 2009-10-27 12:48:36 +0100 pl r277199 : #i106261# avoid duplicate initialization
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/quicktime/player.cxx81
-rw-r--r--avmedia/source/quicktime/player.hxx2
-rw-r--r--avmedia/source/viewer/mediawindowbase_impl.cxx4
3 files changed, 47 insertions, 40 deletions
diff --git a/avmedia/source/quicktime/player.cxx b/avmedia/source/quicktime/player.cxx
index a66c77e3f4..aa2d86d340 100644
--- a/avmedia/source/quicktime/player.cxx
+++ b/avmedia/source/quicktime/player.cxx
@@ -100,8 +100,6 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
if ((result == noErr) && (mnVersion >= QT701))
{
// we have version 7.01 or later, initialize
- mpMovie = [QTMovie movie];
- [mpMovie retain];
mbInitialized = true;
}
[pool release];
@@ -111,43 +109,57 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) :
Player::~Player()
{
- if( mbInitialized )
+ if( mpMovie )
{
- if( mpMovie )
- {
- [mpMovie release];
- mpMovie = nil;
- }
-
+ [mpMovie release];
+ mpMovie = nil;
}
}
+// ------------------------------------------------------------------------------
+QTMovie* Player::getMovie()
+{
+ OSL_ASSERT( mpMovie );
+ return mpMovie;
+}
// ------------------------------------------------------------------------------
bool Player::create( const ::rtl::OUString& rURL )
{
bool bRet = false;
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSString* aNSStr = [[[NSString alloc] initWithCharacters: rURL.getStr() length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
-// NSString * aNSStringEscaped = [aNSStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- NSURL* aURL = [NSURL URLWithString:aNSStr ];
-
- // create the Movie
-
+ // create the Movie
if( mbInitialized )
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ if( mpMovie )
+ {
+ [mpMovie release];
+ mpMovie = nil;
+ }
+
+ NSString* aNSStr = [[[NSString alloc] initWithCharacters: rURL.getStr() length: rURL.getLength()]stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] ;
+ NSURL* aURL = [NSURL URLWithString:aNSStr ];
- mpMovie = [mpMovie initWithURL:aURL error:nil];
+
+ NSError* pErr = nil;
+ mpMovie = [QTMovie movieWithURL:aURL error:&pErr];
if(mpMovie)
{
[mpMovie retain];
maURL = rURL;
bRet = true;
}
+ if( pErr )
+ {
+ OSL_TRACE( "NSMovie create failed with error %ld (%s)",
+ (long)[pErr code],
+ [[pErr localizedDescription] cString]
+ );
+ }
+ [pool release];
}
-
- [pool release];
return bRet;
}
@@ -159,10 +171,10 @@ void SAL_CALL Player::start( )
{
OSL_TRACE ("Player::start");
- if ( mbInitialized && mpMovie )
- {
+ if( mpMovie )
+ {
[mpMovie play];
- }
+ }
}
// ------------------------------------------------------------------------------
@@ -171,11 +183,10 @@ void SAL_CALL Player::stop( )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::stop");
- if ( mpMovie )
+ if( mpMovie )
{
- [mpMovie stop];
+ [mpMovie stop];
}
-
}
// ------------------------------------------------------------------------------
@@ -185,7 +196,7 @@ sal_Bool SAL_CALL Player::isPlaying()
{
bool bRet = false;
- if ( mbInitialized )
+ if ( mpMovie )
{
if ([mpMovie rate] != 0)
{
@@ -219,11 +230,11 @@ void SAL_CALL Player::setMediaTime( double fTime )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::setMediaTime");
-
- if ( mpMovie )
- {
- [mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
- }
+
+ if ( mpMovie )
+ {
+ [mpMovie setCurrentTime: QTMakeTimeWithTimeInterval(fTime)];
+ }
}
// ------------------------------------------------------------------------------
@@ -243,7 +254,6 @@ double SAL_CALL Player::getMediaTime( )
{
stop();
}
-
return position;
}
@@ -256,7 +266,6 @@ void SAL_CALL Player::setStopTime( double fTime )
OSL_TRACE ("Player::setStopTime %f", fTime);
mnStopTime = fTime;
-
}
// ------------------------------------------------------------------------------
@@ -264,9 +273,7 @@ void SAL_CALL Player::setStopTime( double fTime )
double SAL_CALL Player::getStopTime( )
throw (uno::RuntimeException)
{
- double fRet = 0.0;
-
- fRet = mnStopTime;
+ double fRet = mnStopTime;
return fRet;
}
@@ -277,7 +284,7 @@ void SAL_CALL Player::setRate( double fRate )
throw (uno::RuntimeException)
{
OSL_TRACE ("Player::setRate");
-
+
// Quicktime: 0 = stop, 1 = normal speed, 2 = double speed, -1 = normal speed backwards
if ( mpMovie )
{
diff --git a/avmedia/source/quicktime/player.hxx b/avmedia/source/quicktime/player.hxx
index 6698381e23..ccc360e5ef 100644
--- a/avmedia/source/quicktime/player.hxx
+++ b/avmedia/source/quicktime/player.hxx
@@ -83,7 +83,7 @@ public:
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
- QTMovie* getMovie() { return mpMovie; }
+ QTMovie* getMovie();
private:
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index d7b42104ed..8fb63bdfc5 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -147,9 +147,9 @@ void MediaWindowBaseImpl::stopPlayingInternal( bool bStop )
if( isPlaying() )
{
if( bStop )
- mxPlayer->start();
- else
mxPlayer->stop();
+ else
+ mxPlayer->start();
}
}