Mailing Lists: Apple Mailing Lists

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

Handing pixel aspect ratios from Core Video to an output image via outputImageProviderFromTextureWithPixelFormat



Hello.

In attempting to fix a bug in my movie player for handling pixel aspect ratios, Ive noticed that outputImageProviderFromTextureWithPixelFormat does not respect the bounds I hand it for the texture. For example, if I pass it the named texture of CVOpenGLBufferRef from a DVCProHD 1080 movie which has a raw pixel size of 1280x1080, but that has display size of 1920x1080 (which is the bounds rect I pass to outputImageProviderFromTextureWithPixelFormat that I get from QTs aperture mode information), the image output via outputImageProviderFromTextureWithPixelFormat is properly 1920x1080, but the texture within it is displayed at 1280x1080 squished to the left hand side of the screen with a large black rect on the right. I cant seem to tell outputImageProviderFromTextureWithPixelFormat that I want the textures pixel aspect ratio not to be 1:1 within the bounds rect I pass it.

Im not sure how I feel outputImageProviderFromTextureWithPixelFormat mapping the texture to its exact pixel size, but I can also potentialy foresee issues if it does do some interpolation on the pixels when handling crop and whatnot patches that mess with the bounds rect.

Ive somewhat overcome this issue by implementing my own image provider subclass using renderWithCGLContext, however performance is drastically lower if I choose to keep color accuracy enabled. (shouldColorMatch returning true more than halves my framerate), so it seems like there should be some better way of doing this, but I cant seem to find it.

Ive also attempted to get copyRenderedTextureForCGLContext implemented, but I have issues getting this method to actually get called. Reading the appropriate header states it should be called if I do implement supportedRenderedTexturePixelFormats, copyRenderedTextureForCGLContext, releaseRenderedTexture and not implement canRenderWithCGLContext and renderWithCGLContext, (GLImage does it this way), however the methods do not get called at all...

What is the exact way that an OutputImageProvider is expected to choose which method to fire for image output?

Thanks for any advice regarding this issues, I appreciate it. I would love to get the convenience method outputImageProviderFromTextureWithPixelFormat working for images with pixels aspect ratios non 1:1, since it seems the fastest and most color accurate way to output an image from QC...


_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/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.