Пример #1
0
        private void MediaCapture_ExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
        {
            switch (args.Status)
            {
            case MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable:
                InitializeMediaCaptureWithExclusiveControl();
                break;

            case MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable:
                ShowMessageToUser("The app can use the camera, but can't currently update the camera settings.");
                break;
            }
        }
Пример #2
0
        private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender,
                                                                                    MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
        {
            switch (args.Status)
            {
            case MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable:
                ShowMessageToUser("The camera preview can't be displayed because another app has exclusive access");
                break;

            case MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable when !isPreviewing:
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
                                          async() => { await StartPreviewAsync(); });

                break;
            }
        }
Пример #3
0
        async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
        {
            if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
            {
            }

            else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                {
                    await StartPreviewAsync();
                });
            }
        }
Пример #4
0
        private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
        {
            if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
            {
                var messageDialog = ShowMessageToUser("The camera preview can't be displayed because another app has exclusive access");
                // Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
                messageDialog.Commands.Add(new UICommand("Close", new UICommandInvokedHandler(this.CommandInvokedHandler)));

                // Set the command to be invoked when escape is pressed
                messageDialog.CancelCommandIndex = 0;

                // Show the message dialog
                await messageDialog.ShowAsync();
            }
            else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
                {
                    await StartPreviewAsync();
                });
            }
        }
Пример #5
0
 private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         MsgBox("Access denined", "Check Second Catch", "OK");
         //ShowMessageToUser("The camera preview can't be displayed because another app has exclusive access");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
     {
         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreviewAsync().ConfigureAwait(true);
         });
     }
 }
Пример #6
0
 private async void MediaCaptureOnCaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         await new MessageDialog("The camera preview can't be displayed because another app has exclusive access").ShowAsync();
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
     {
         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreviewAsync();
         });
     }
 }
 private void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
 }
Пример #8
0
 private void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         Debug.WriteLine("The camera preview can't be displayed because another app has exclusive access");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
     {
         RunOnMainThread(() =>
         {
             StartPreviewAsync();
         });
     }
 }
Пример #9
0
        private void MediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
        {
            switch (args.Status)
            {
            case MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable:
                break;

            case MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable:
                break;

            default:
                break;
            }
        }
Пример #10
0
 private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         new MessageDialog("The app was denied access to the camera");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
     {
         await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreviewAsync();
         });
     }
 }
 private void MediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     CaptureDeviceExclusiveControlStatusChanged?.Invoke(sender, args);
 }
Пример #12
0
 private void CameraMediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     this.Log.Debug(() => $"CameraMediaCapture exclusive controle state changed to {args.Status}");
 }
 private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         MyMessageDialogHelper.ShowWebcamErrorMessageAsync("摄像头初始化失败,摄像头正在被其他应用使用");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !_isPreviewing)
     {
         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreViewAsync();
         });
     }
 }
 private async void MediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         MainPage.ShowMessage("The camera preview can't be displayed because another app has exclusive access");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
     {
         await MainPage.runOnUIThread(async() => { await startPreviewAsync(); });
     }
 }
Пример #15
0
 private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         feedback.Text = "Caméra déjà en utilisation";
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !isPreviewing)
     {
         await(Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreviewAsync();
         }));
     }
 }
 private async void MediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         await ShowMessageToUser("CaptureDeviceExclusiveControlStatusChanged", "SharedReadOnlyAvailable");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !IsMediaCapturePreviewing)
     {
         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreviewAsync();
         });
     }
 }
Пример #17
0
 private async void MediaCapture_CaptureDeviceExclusiveControlStatusChangedAsync(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         _vm.Output = "The camera preview can't be displayed because another app has exclusive access.";
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !_isPreviewing)
     {
         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await InitializePreviewAsync();
         });
     }
 }
Пример #18
0
 private async void _mediaCapture_CaptureDeviceExclusiveControlStatusChanged(MediaCapture sender, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs args)
 {
     if (args.Status == MediaCaptureDeviceExclusiveControlStatus.SharedReadOnlyAvailable)
     {
         System.Diagnostics.Debug.WriteLine("The camera preview can't be displayed because another app has exclusive access");
     }
     else if (args.Status == MediaCaptureDeviceExclusiveControlStatus.ExclusiveControlAvailable && !_isPreviewing)
     {
         await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
         {
             await StartPreviewAsync();
         });
     }
 }