I am developing video streaming application, in which i need to capture front camera video frame and encode then transfer to other end, a typical flow is like this
AVCaptureSession -> AVCaptureDeviceInput -> AVCaptureVideoDataOutput -> capture frame --> encode frame --> send frame to other end,
it works fine, i have setup the kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange as a frame format.
also preview layer being used to show the preview,
the problem comes when device orientation gets changes, if device moved from portrait to landscape, then on the other end frames gets rotate by 90, i was expecting since orientation being supported in the preview layer so i will automatically received rotated buffer in the Capture callback, but it looks like, preview layer just show me the preview of the buffer captured and UI orates the buffer, while on the other end i would get the roared buffer,
So i want to know, Are there any configuration to make it change , or do i need to rotate/transform buffer in the Capture buffer callback.