Make a particular function asychronous so it can run on a different thread

Hi guys.

I am using UE5 c++ application. I use a class which inherits the MediaCapture framework and more specifically its OnFrameCaptured_RenderingThread( ) function to do some stuff with it.

Every time I run the application everything is fine, but when I enable the capturing I experience a big frame drop. I want to make that function running on a different thread so I can improve the performance.

That function is called automatically, so I just define its body. Any ideas how to make it runnable on a different thread?