Bug 1808 - CIImage.FromImageBuffer uses wrong selector imageWithCVImageBuffer, should be imageWithCVPixelBuffer
Summary: CIImage.FromImageBuffer uses wrong selector imageWithCVImageBuffer, should be...
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-11-01 08:43 UTC by Jochen Hansmeyer
Modified: 2011-11-03 10:01 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

updated monotouch.dll (for testing) (2.96 MB, application/octet-stream)
2011-11-02 20:32 UTC, Sebastien Pouliot

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jochen Hansmeyer 2011-11-01 08:43:01 UTC

CIImage image = CIImage.FromImageBuffer ( sampleBuffer.GetImageBuffer () );

results in:

<Error>: +[CIImage imageWithCVImageBuffer:options:]: unrecognized selector sent to class 0x3f4944d0

IOS 5.0 Documentation:


Creates and returns an image object from the contents of CVPixelBuffer object.
+ (CIImage *)imageWithCVPixelBuffer:(CVPixelBufferRef)buffer


    A CVPixelBuffer object. 

Return Value

An image object initialized with the contents of the image buffer object.

    Available in iOS 5.0 and later.

See Also

    + imageWithCVPixelBuffer:options:
    – initWithCVPixelBuffer:

Declared In
Comment 1 Sebastien Pouliot 2011-11-01 20:57:55 UTC
It looks like 'imageWithCVImageBuffer' exists in Mac OSX, while 'imageWithCVPixelBuffer' exists in iOS5.
Comment 2 Sebastien Pouliot 2011-11-02 18:35:22 UTC
I have this fixed in 'master' but I can get you an updated monotouch.dll based on 5.0.1 if this can help you. Interested ?
Comment 3 Sebastien Pouliot 2011-11-02 20:32:50 UTC
Created attachment 813 [details]
updated monotouch.dll (for testing)

To use the attached assembly (on top of MonoTouch 5.0.1) do:

1) backup your /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll and /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll.mdb files

2) copy the attached file to /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll

3) remove the /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll.mdb symbols (they won't match anymore)

4) clean, rebuild and test your application
Comment 4 Sebastien Pouliot 2011-11-02 20:34:12 UTC
If you test it please let me know if it solved your issue :)
Comment 5 Jochen Hansmeyer 2011-11-03 09:30:56 UTC
Thank you for the fast support, this works now, but please have a look at the cast:

CIImage image = CIImage.FromImageBuffer ( (CVPixelBuffer)sampleBuffer.GetImageBuffer() );

GetImageBuffer obviously returns an instance of CVPixelBuffer. IMHO the following would be more elegant for IOS:

CIImage image = CIImage.FromPixelBuffer ( sampleBuffer.GetPixelBuffer() );
Comment 6 Sebastien Pouliot 2011-11-03 10:01:30 UTC
I had doubts, naming-wise. According to Apple iOS documentation CMSampleBuffer can return a CVImageBuffer (or a CVPixelBuffer) under iOS too - so renaming that part would not be right. 

It also makes it harder to share code between OSX and iOS.

I have considered renaming them to GetBuffer and FromBuffer... maybe I could do that and mark the old (OSX) ones as [Obsolete]