Re: QuickTime, Cocoa, et al
Re: QuickTime, Cocoa, et al
- Subject: Re: QuickTime, Cocoa, et al
- From: Ricky Sharp <email@hidden>
- Date: Wed, 7 Jun 2006 18:37:29 -0500
On Jun 7, 2006, at 5:58 PM, Joseph Kelly wrote:
I am considering migrating an application to Cocoa (or maybe Carbon
HIView), and I need some information about how well they play with
QuickTime.
In particular, I draw some trace information on top of each frame
of a Quicktime movie as it plays, and to that end we've had great
success with SetMovieDrawingCompleteProc(). I've tried this same
approach with QTKit with no luck -- for instance, I've got a custom
view that contains a QTMovieView, and when I attach a drawing
complete procedure on the Movie, and attempt to draw a big green X
through the view, it draws over everything but the movie content:
[self lockFocus];
NSGraphicsContext* pCtx = [NSGraphicsContext
graphicsContextWithWindow:[self window]];
NSRect bounds = [self bounds];
NSBezierPath* clip = [NSBezierPath bezierPathWithRect:bounds];
[clip addClip];
[[NSColor greenColor] setStroke];
NSBezierPath* path = [NSBezierPath bezierPath];
[path moveToPoint:NSMakePoint(bounds.origin.x, bounds.origin.y)];
[path lineToPoint:NSMakePoint(bounds.origin.x + bounds.size.width,
bounds.origin.y + bounds.size.height)];
[path moveToPoint:NSMakePoint(bounds.origin.x +
bounds.size.width, bounds.origin.y)];
[path lineToPoint:NSMakePoint(bounds.origin.x, bounds.origin.y +
bounds.size.height)];
[path stroke];
[pCtx flushGraphics];
[self unlockFocus];
Question 1: So is this even possible, or am I doing something the
wrong way in my drawing code? I've seen a samplecode example that
uses an overlay window, but that won't work for me, which is my
segue into:
Why doesn't an overlay window work for you?
It's been a while, but I seem to recall that if you do end up drawing
on a movie, that can ruin your performance. You should definitely
ask these questions first on quicktime-dev; I believe there's a
recommended method for drawing on a movie.
Question 2: we've got a UI that lets users layer view "objects" on
top of each other (including QuickTime movies!) I've read that
NSView is absolutely not up to this task -- that it has some z-
ordering issues etc. So far, however, I've got a screen full of
overlapping NSViews, and they seems to work okay (outside of the
quicktime issues) and an occasional z-order glitch. So what's the
final verdict on overlapping NSViews? And has anyone found any
alternatives to this?
Having overlapping NSViews is very bad. z-order is never guaranteed
for overlapping views. Furthermore, you won't be able to set up
optimized drawing on your window (see useOptimizedDrawing:)
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden