Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficient decoding - replace GetMoviePict?



I'll just keep talking to myself here. Perhaps I'll save someone from the same incredible frustration later.

Turns out that my problems with mangled and out-of-order frames can occur on all platforms and operating systems --- just because you have CVBufferRetain'd a buffer and then called CVPixelBufferLockBaseAddress on it doesn't mean that you own it or that nothing bad will happen to it. No, that would be too logical....  I just added a sleep into my code so that I hold on to the retained and locked buffer from a single frame (say frame 20) for a while before copying the data out of it. Meanwhile I continue to read the rest of the movie, then come back to read out the data from frame 20. Surprise! I get a completely different much later frame.

Further study of the headers in CoreVideo shows that there is a kCVPixelBufferPoolMaximumBufferAgeKey --- it seems that after a while, the buffer pool just assumes you're done with a frame and "takes it back" !!!!!!! I'm sure this sounded like a helpful feature to somebody late one night after a few beers, but this has absolutely no place in a complex multithreaded system. None. But it is on by default. 

So, for the trick question of the day-----how can I get to the BufferPool setup to turn it off. Again, I'm working mainly from the QTPixelBufferVCTToCGImage sample. The CreatePixelBufferContext seems to be in the right area but I need to talk to the POOL creation and the value type is a bit dicey looking (perhaps a 0.0, not a CFNumber?)

Still waiting for someone to tell me why my callback can get called with no movie time at all, for some movies.

Russ



      
 _______________________________________________
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/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.