Using AVPlayerView (or AVPlayerLayer) to display in-memory video frames.

I have an app which receives video frames across a network using NDI. My app processes the frames and passes them to an output device (Blackmagic Ultrastudio Monitor 3G) ( which is not a video adapater.) this is all working.

I would like to include a video-preview in my app window. I know I can add AVPlayerView (or AVPlayerLayer) to the window.

But how can I pass video frames from my frame buffer to an AVPlayer instead of letting it ingest a file or URL?

In other words, I don't want the AVPlayer to ingest a URL or HTTP STREAM, I already have the video frames in a memory buffer, how do I feed them to AVPlayerView?

Using AVPlayerView (or AVPlayerLayer) to display in-memory video frames.
 
 
Q