Quicktime player

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Quicktime player

Chris Cunnington
The stack: 


OK, just subclass SophieMovie from Object. Semaphores ensure better timing. 

Alright, then I'm not pulling Sophie's engine apart, but extracting it in its entirety. 

Chris 


Reply | Threaded
Open this post in threaded view
|

Re: Quicktime player

johnmci
That would be via 
error = 0 ifFalse: [SophieMovieError signal: 'Movie failed NewMovieFromDataRef'].

It's decided to use the SophieQuickTimeAudio class because it thinks it is supported. 
You will need to put a halt in and see why the apiNewMovieFromDataRef fails.  
Likely there is an error code from quicktime 

On 2010-09-02, at 9:08 PM, Chris Cunnington wrote:

The stack: 


OK, just subclass SophieMovie from Object. Semaphores ensure better timing. 

Alright, then I'm not pulling Sophie's engine apart, but extracting it in its entirety. 

Chris 



SophieQuickTimeAudio>>openMovieFromURI: aURI
| results movieDataReference osType movieResId error cachedQTClass macRect |
cachedQTClass := CPlatform current quicktimeInterfaceClass.
SophieLog log: aURI.
results _ cachedQTClass callQTNewDataReferenceFromCFURL: aURI flags: 0.
(results at: 3) = 0 ifFalse: [SophieMovieError signal: 'Movie open error'].
movieDataReference _ results at: 1.
osType _ results at: 2.
ensureCloseSema critical: [
movie _ MacMovie new.
movieResId _ MacShort new.
SophieLog log: 'apiNewMovieFromDataRef:'.
error _ cachedQTClass apiNewMovieFromDataRef: movie flags: ((cachedQTClass kNewMovieActive) bitOr: (cachedQTClass kNewMovieAsyncOK)) id: movieResId handle: movieDataReference osType: osType.
SophieLog log: 'after apiNewMovieFromDataRef:'.
error = 0 ifFalse: [SophieMovieError signal: 'Movie failed NewMovieFromDataRef'].
movieIndex _ Smalltalk registerExternalObject: movie.
movie movieHandle = 0 ifTrue:[
cachedQTClass apiQTDisposeDataReference: movieDataReference.
movieDataReference _ nil.
SophieMovieError signal: 'unable to open movie'].
"Do not touch the movie object before this call"
SophieLog log: 'preroll'.
self preroll.

"now we can toss the data reference"
cachedQTClass apiQTDisposeDataReference: movieDataReference.
movieDataReference _ nil.

SophieLog log: 'rectangle'.
self naturalRectangle: self rectangle.
macRect := (MacRect new)
left:  self naturalRectangle left;
right: self naturalRectangle right;
bottom: self naturalRectangle bottom;
top: self naturalRectangle top;
yourself.

self newMovieController: macRect.

self validMovie: true.
self register.
SophieLog log: 'super'.
super openMovieFromURI: aURI.
SophieLog log: 'done'.


--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================







smime.p7s (5K) Download Attachment