LoadCamera() public method

public LoadCamera ( ICameraCaptureDevice camera ) : void
camera ICameraCaptureDevice
return void
        private async void StartInternal()
        {
            var locations = GetCameraSensorLocations();
            var location  = locations[0];

            if (CaptureArgs.DeviceNumber.HasValue && CaptureArgs.DeviceNumber.Value < locations.Length)
            {
                location = locations[CaptureArgs.DeviceNumber.Value];
            }
            else if (DesiredDeviceNumber.HasValue && DesiredDeviceNumber.Value < locations.Length)
            {
                location     = locations[DesiredDeviceNumber.Value];
                DeviceNumber = DesiredDeviceNumber.Value;
            }

            Label = GetCameraSensorLocationName(location);

            Capture = await AudioVideoCaptureDevice.OpenForVideoOnlyAsync(location, GetInitialResolution(location, CaptureArgs.Width, CaptureArgs.Height));

            Capture.SetProperty(KnownCameraAudioVideoProperties.VideoFrameRate, CaptureArgs.FrameRate);

            Capture.PreviewFrameAvailable += Capture_PreviewFrameAvailable;
            if (Preview != null)
            {
                Preview.LoadCamera(Capture);
                RunOnUIThread(() =>
                {
                    SetRotation(Page.Orientation);
                    Preview.Rotate(BufferRotate);
                });
            }

            RunOnUIThread(() =>
            {
                XnaTimer          = new DispatcherTimer();
                XnaTimer.Interval = TimeSpan.FromMilliseconds(10);
                XnaTimer.Tick    += XnaTimer_Tick;
                XnaTimer.Start();
            });
        }