Open markmark1 opened 9 years ago
Switch the camera asynchronously? I did something like this:
- (IBAction)changeBroadcasterCamera:(id)sender {
switch (_session.cameraState) {
case VCCameraStateFront:
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
_session.cameraState = VCCameraStateBack;
});
break;
}
case VCCameraStateBack:
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
_session.cameraState = VCCameraStateFront;
});
break;
}
default:
break;
}
}
Thanks a lot josh :) trying it
On Mon, Jul 6, 2015 at 11:59 AM, Josh Lieberman notifications@github.com wrote:
Switch the camera asynchronously? I did something like this:
- (IBAction)changeBroadcasterCamera:(id)sender { switch (_session.cameraState) { case VCCameraStateFront: { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ _session.cameraState = VCCameraStateBack; }); break; } case VCCameraStateBack: { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ _session.cameraState = VCCameraStateFront; }); break; } default: break; } }
Reply to this email directly or view it on GitHub: https://github.com/jgh-/VideoCore/issues/165#issuecomment-118959225
Josh it becomes very responsive but the view flips to horizontal orientation for a second before going back to portrait looks bad
Is there any alternative to fix that thanks
On Mon, Jul 6, 2015 at 12:09 PM, null write2mark1@gmail.com wrote:
Thanks a lot josh :) trying it On Mon, Jul 6, 2015 at 11:59 AM, Josh Lieberman notifications@github.com wrote:
Switch the camera asynchronously? I did something like this:
- (IBAction)changeBroadcasterCamera:(id)sender { switch (_session.cameraState) { case VCCameraStateFront: { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ _session.cameraState = VCCameraStateBack; }); break; } case VCCameraStateBack: { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{ _session.cameraState = VCCameraStateFront; }); break; } default: break; } }
Reply to this email directly or view it on GitHub: https://github.com/jgh-/VideoCore/issues/165#issuecomment-118959225
I know of that issue, thought there was an open bug for it. Search around, otherwise feel free to open a new issue. Are you using the latest version of classes in the repo?
Ui gets slowed down a bit noticeably while the camera is toggled what is the solution to this as uiviews cant be manipulated in the background thread? thanks a lot for an amazing library