I am working on an application that captures a live video stream from front camera and sends it to the remote end (using RTP). Essentially the data flow is: AVCaptureSession -> AVCaptureVideoDataOutput -> callback -> RTP -> Display at remote end
When I use landscape mode the image on the remote end is upside down. In portrait mode it is rotated to the left.
How can I rotate the pixel buffer in the following callback so the image at remote end has the right orientation? Appreciate any pointers.
void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection