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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/se6ciocco%
40gmail.com
This email sent to email@hidden