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
AVCa
Thanks for looking into it, basically the solution is, orientation of connection should be set, and i was playing with the preview layer, so its affecting the preview layer but not the orientation.
here goes the code snippet
-(void) orientationChanged
{
// get the new orientation from device
AVCaptureVideoOrientation newOrientation = [self videoOrientationFromDeviceOrientation];
// set the orientation of preview layer :( which will be displayed in the device )
[previewLayer.connection setVideoOrientation:newOrientation];
// set the orientation of the connection: which will take care of capture
[pCaptureConnection setVideoOrientation:newOrientation];
}