flightphase / ofxqtkitvideoplayer Goto Github PK
View Code? Open in Web Editor NEWaddon for fast HD video playback on OS X using CoreVieo and QTKit
addon for fast HD video playback on OS X using CoreVieo and QTKit
should read
Allo again. I'm poking around with Quicktime X. If I left it the way it was, my app would crash.
For quicktime X support, I had to comment the following:
// frameCount = movieDuration.timeValue / frameStep;
// NSLog(@" movie has %d frames ", frameCount);
and
// self.volume = 1.0;
// self.loops = YES;
to get Quicktime X to load my movie files properly.
this is probably because (i'm assuming, anyway...) quicktime X wants you to perform these tasks in a callback once the movie is sufficiently loaded. I am working on a fix for those at the moment which involves NSNotifications that call movieLoadStateChanged. Also, to get quicktime X to load properly on Lion with the QTMovieOpenForPlaybackAttribute attribute, i had to declare it in the movieAttributes dictionary as soon as it is created. I'm not sure why this is. My current hacky workaround for Quicktime X support is as follows:
#ifdef MAC_OS_X_VERSION_10_6 || MAC_OS_X_VERSION_10_7
if(self.useTexture && !self.usePixels){
NSLog(@"osx 10.6 or 10.7 texture only, so loading quicktime X");
NSMutableDictionary* movieAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSURL fileURLWithPath:[moviePath stringByStandardizingPath]], QTMovieURLAttribute,
[NSNumber numberWithBool:NO], QTMovieOpenAsyncOKAttribute,
//[NSNumber numberWithBool:NO], QTMovieOpenAsyncRequiredAttribute,
[NSNumber numberWithBool:YES], QTMovieOpenForPlaybackAttribute,
nil];
_movie = [[QTMovie alloc] initWithAttributes:movieAttributes
error: &error];
}
else{
NSLog(@"osx 10.6 or 10.7, pixel buffer requested so no quicktime X");
NSMutableDictionary* movieAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSURL fileURLWithPath:[moviePath stringByStandardizingPath]], QTMovieURLAttribute,
[NSNumber numberWithBool:NO], QTMovieOpenAsyncOKAttribute,
// [NSNumber numberWithBool:NO], QTMovieOpenAsyncRequiredAttribute,
[NSNumber numberWithBool:NO], QTMovieOpenForPlaybackAttribute,
nil];
_movie = [[QTMovie alloc] initWithAttributes:movieAttributes
error: &error];
}
#endif
#ifndef MAC_OS_X_VERSION_10_7
#ifndef MAC_OS_X_VERSION_10_6
NSLog(@"osx 10.x, no quicktime X");
NSMutableDictionary* movieAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSURL fileURLWithPath:[moviePath stringByStandardizingPath]], QTMovieURLAttribute,
[NSNumber numberWithBool:NO], QTMovieOpenAsyncOKAttribute,
//[NSNumber numberWithBool:NO], QTMovieOpenAsyncRequiredAttribute,
[NSNumber numberWithBool:NO], QTMovieOpenForPlaybackAttribute,
nil];
_movie = [[QTMovie alloc] initWithAttributes:movieAttributes
error: &error];
#endif
#endif
I should also mention that #ifdef MAC_OS_X_VERSION_10_7 does not get called on my Lion system.
EDIT: i had to change my OF deployment target in Xcode, now it does.
My next step includes asynchronous loading support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.