Skip to content

Instantly share code, notes, and snippets.

@unktomi
Last active September 5, 2017 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unktomi/434cb971da6db1b4e0b5f7ad89c73fe2 to your computer and use it in GitHub Desktop.
Save unktomi/434cb971da6db1b4e0b5f7ad89c73fe2 to your computer and use it in GitHub Desktop.
#pragma once
#include "CoreMinimal.h"
#include "MediaTexture.h"
#include "AVFoundation/AVFoundation.h"
#include "CoreMedia/CoreMedia.h"
#include <Metal/Metal.h>
@class FSampleBufferDelegate;
class FIOSCamera
{
private:
CVMetalTextureCacheRef TextureCache;
AVCaptureSession* AVSession;
AVCaptureDevice* VideoDevice;
dispatch_queue_t DispatchQueue;
FSampleBufferDelegate* SampleBufferDelegate;
UMediaTexture* VideoSink;
public:
void HandleSampleBuffer(CMSampleBufferRef sampleBuffer);
public:
FIOSCamera(UMediaTexture* InSink);
virtual ~FIOSCamera();
float GetFieldOfView();
FVector2D GetVideoSize();
void SetupCamera();
void TeardownCamera();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment