Just guessing:
Move
myErr = QTVideoOutputBegin(_displayComponent);
if (myErr != noErr) goto bail;
Just before setMovieVideoOutputBegin
Also, why do you need a movie? Try throwing away all the commands from
setMovieMasterClock and on to see if it helps
----------------
George Birbilis (email@hidden)
Microsoft MVP J# for 2004-2006
* QuickTime, QTVR, ActiveX, VCL, .NET
http://www.kagi.com/birbilis
* Robotics PhD student
http://www.mech.upatras.gr/~Robotics
http://www.mech.upatras.gr/~robgroup
Hi!
I'm trying to play .dv files through firewire from Cocoa.
I can get the screen on the DV-cam connected to the computer to
turn black,
so it seams I have managed to choose the correct output component.
But when I start to play a movie I doesn't show up on the screen.
I know the movie is playing because I can hear the audio from the
computer's
speakers.
I'm quite new to Quicktime and Cocoa development so maybe I'm doing
something wrong.
Here is my code:
----------------------------------------------------------------------
--
-------------------------------
#import "Orama.h"
@implementation Orama
-(void)awakeFromNib {
EnterMovies();
Movie myMovie = OpenMovie((CFStringRef)@"/Users/xxx/Movies/
Untitled3-1.dv");
GWorldPtr displayGWorld;
OSErr myErr;
ComponentInstance _displayComponent;
ComponentInstance
mVideoOutputClockInstance;
ComponentDescription cd;
Component c;
_displayComponent = NULL;
cd.componentType = QTVideoOutputComponentType;
cd.componentSubType = 'fire';
cd.componentManufacturer = 'appl';
cd.componentFlags = 0;
cd.componentFlagsMask = QTVideoOutputSetDisplayMode;
c = FindNextComponent(c, &cd);
if (c == NULL) {
goto bail;
}
_displayComponent = OpenComponent(c);
if (_displayComponent == NULL) {
myErr = internalComponentErr;
goto bail;
}
QTVideoOutputSetClientName(_displayComponent, "DV Exporter");
myErr = QTVideoOutputSetDisplayMode(_displayComponent,2); //NOTE: 1 =
NTSC and 2 = PAL
if (myErr != noErr) goto bail;
myErr = QTVideoOutputBegin(_displayComponent);
if (myErr != noErr) goto bail;
myErr = QTVideoOutputGetGWorld(_displayComponent, &displayGWorld);
if (myErr != noErr) goto bail;
myErr = QTVideoOutputGetClock( _displayComponent,
&mVideoOutputClockInstance );
if (myErr != noErr) goto bail;
SetMovieMasterClock( myMovie, (Component)mVideoOutputClockInstance,
(TimeRecord*)NULL );
SetMovieVideoOutput(myMovie, _displayComponent);
SetMovieGWorld(myMovie, displayGWorld, nil);
StartMovie (myMovie);
return;
bail: {
NSLog(@"bail!");
}
}
Movie OpenMovie(CFStringRef inPath) {
Movie myMovie = NULL;
OSType myDataRefType;
Handle myDataRef = NULL;
short myResID = 0;
OSErr myErr = noErr;
// create the data reference
myErr = QTNewDataReferenceFromFullPathCFString(inPath,
kQTNativeDefaultPathStyle, 0, &myDataRef, &myDataRefType);
if (myErr != noErr) goto bail;
// get the Movie
myErr = NewMovieFromDataRef(&myMovie, newMovieActive |
newMovieAsyncOK, &myResID, myDataRef, myDataRefType);
if (myErr != noErr) goto bail;
// dispose of the data reference handle - we no longer need it
DisposeHandle(myDataRef);
return myMovie;
bail: {
NSLog(@"bail!");
return nil;
}
}
@end
_____
avast! Antivirus <http://www.avast.com> : Outbound message clean.
Virus Database (VPS): 0608-0, 20/02/2006
Tested on: 23/2/2006 2:25:44 p?
avast! - copyright (c) 1988-2005 ALWIL Software.