mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(meancoot/iOS) Add workaround for flickering with camera - still
some problems when Cocoa interface is brought up during camera core and then we go back to the camera core
This commit is contained in:
parent
61d66b7f19
commit
4ab33d5b3b
@ -219,12 +219,13 @@ static bool g_is_syncing = true;
|
||||
[self viewWillLayoutSubviews];
|
||||
}
|
||||
|
||||
-(void)processFrame:(CMSampleBufferRef)sampleBuffer
|
||||
void event_process_camera_frame(void* pixelBufferPtr)
|
||||
{
|
||||
CVPixelBufferRef pixelBuffer = (CVPixelBufferRef)pixelBufferPtr;
|
||||
|
||||
int width, height;
|
||||
CVReturn ret;
|
||||
|
||||
CVImageBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
|
||||
width = CVPixelBufferGetWidth(pixelBuffer);
|
||||
height = CVPixelBufferGetHeight(pixelBuffer);
|
||||
|
||||
@ -258,14 +259,18 @@ static bool g_is_syncing = true;
|
||||
|
||||
CVOpenGLESTextureCacheFlush(textureCache, 0);
|
||||
CFRelease(renderTexture);
|
||||
|
||||
CFRelease(pixelBuffer);
|
||||
pixelBuffer = 0;
|
||||
}
|
||||
|
||||
- (void)captureOutput:(AVCaptureOutput *)captureOutput
|
||||
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||||
fromConnection:(AVCaptureConnection *)connection
|
||||
{
|
||||
[self processFrame:sampleBuffer];
|
||||
}
|
||||
// TODO: Don't post if event queue is full
|
||||
CVPixelBufferRef pixelBuffer = CVPixelBufferRetain(CMSampleBufferGetImageBuffer(sampleBuffer));
|
||||
apple_frontend_post_event(event_process_camera_frame, pixelBuffer);}
|
||||
|
||||
- (void) onCameraInit
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user