Ejemplo n.º 1
0
        private async void InitMediaCapture()
        {
            mediaCapture = null;
            mediaCapture = new Windows.Media.Capture.MediaCapture();

            // for dispose purpose
            (App.Current as App).MediaCapture   = mediaCapture;
            (App.Current as App).PreviewElement = capturePreview;

            await mediaCapture.InitializeAsync(captureInitSettings);

            // Add video stabilization effect during Live Capture
            //await _mediaCapture.AddEffectAsync(MediaStreamType.VideoRecord, Windows.Media.VideoEffects.VideoStabilization, null); //this will be deprecated soon
            Windows.Media.Effects.VideoEffectDefinition def = new Windows.Media.Effects.VideoEffectDefinition(Windows.Media.VideoEffects.VideoStabilization);
            await mediaCapture.AddVideoEffectAsync(def, MediaStreamType.VideoRecord);

            CreateProfile();

            // start preview

            capturePreview.Source = mediaCapture;

            DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;

            //// set the video Rotation
            //    _mediaCapture.SetPreviewRotation(VideoRotation.Clockwise90Degrees);
            //    _mediaCapture.SetRecordRotation(VideoRotation.Clockwise90Degrees);
        }
Ejemplo n.º 2
0
        private async void InitMediaCapture()
        {
            mediaCapture = null;
            mediaCapture = new Windows.Media.Capture.MediaCapture();

            // for dispose purpose
            (App.Current as App).MediaCapture = mediaCapture;
            (App.Current as App).PreviewElement = capturePreview;

            await mediaCapture.InitializeAsync(captureInitSettings);

            // Add video stabilization effect during Live Capture
            //await _mediaCapture.AddEffectAsync(MediaStreamType.VideoRecord, Windows.Media.VideoEffects.VideoStabilization, null); //this will be deprecated soon
            Windows.Media.Effects.VideoEffectDefinition def = new Windows.Media.Effects.VideoEffectDefinition(Windows.Media.VideoEffects.VideoStabilization);
            await mediaCapture.AddVideoEffectAsync(def, MediaStreamType.VideoRecord);

           CreateProfile();

            // start preview

            capturePreview.Source = mediaCapture;
            
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.None;

        //// set the video Rotation
        //    _mediaCapture.SetPreviewRotation(VideoRotation.Clockwise90Degrees);
        //    _mediaCapture.SetRecordRotation(VideoRotation.Clockwise90Degrees);
        }