Hello friends. Please pardon this short reprise, but I really need help - maybe 
someone can shed some light on my problem.

I’m capturing video using AVFoundation APIs for preview only (OS-X app) 
following an old sample-code from Apple (AVRecorder).  My view hierarchy is 
simple. An NSView (WantsLayer=YES) with a AVCaptureVideoPreviewLayer as 
sublayer. This worked for several years now.

Recently I added modest CoreImage CIFilter (CISharpenLuminance) to the video 
preview like so:

1. I call setLayerUsesCoreImageFilters:YES on the NSView hosting the video 
capture.
2. I programmatically create and  apply the filter to the  
AVCaptureVideoPreviewLayer.

From that moment on - I see strange warnings in the console: "Fallingback to 
pbuffer. FBO status is 36054” for every captured video frame (30 a sec…). 

In other mailing list, someone claims the problem only happens with OS-X.11, 
and only with YUV pixel formats. He found the problem in another Apple sample 
code -AVGreenScreenPlayer.

Unfortunately the video devices I use only provide YUV pixel formats, and my 
client Macs only run OS-X 10.11.
Can someone tell me what is the source of this error line? what is FBO, and 
what has fallen-back? where is a documentation of the error, and is there a 
workaround the problem?

Any hint will be greatly appreciated. Here’s my code with the new additions 
marked with // <— new code


    // Get our videoView and its CALayer, to draw video and other stuff on it.
   CALayer *videoViewLayer = [[delegate videoView] layer];      // here the 
delegate is an NSWindowController.
   NSRect bounds = [videoViewLayer bounds];
   [[delegate videoView] setLayerUsesCoreImageFilters:YES];                     
                                   // <— new code 

   // Create and Add videoCapture layer to our videoView.
   AVCaptureVideoPreviewLayer *videoPreviewLayer = [[AVCaptureVideoPreviewLayer 
alloc] initWithSession:[self session]];
   [videoPreviewLayer 
setBackgroundColor:CGColorGetConstantColor(kCGColorClear)];
   [videoPreviewLayer setVideoGravity:AVLayerVideoGravityResize];
   [videoPreviewLayer setFrame:bounds];
   [videoPreviewLayer setAutoresizingMask:kCALayerWidthSizable | 
kCALayerHeightSizable];

   CIFilter *sharpenLuminance = [CIFilter 
filterWithName:@"CISharpenLuminance"];        // <— new code
   [sharpenLuminance setValue:@0.5 forKey:kCIInputSharpnessKey];                
        // <—new code
   [videoPreviewLayer setFilters:@[sharpenLuminance]];                          
        // <— new code

   [videoViewLayer addSublayer:videoPreviewLayer];


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to