Beispiel #1
0
        private static NativeHandle CreateHandle(Camera camera)
        {
            if (camera == null)
            {
                throw new ArgumentNullException(nameof(camera));
            }

            Native.CreateVideo(camera.Handle, out var handle).
            ThrowIfError("Failed to create video recorder.");

            return(handle);
        }
Beispiel #2
0
        private static IEnumerable <Size> LoadVideoResolutions(CameraDevice device)
        {
            using (var camera = new Camera(device))
            {
                Native.CreateVideo(camera.Handle, out var handle).ThrowIfError("Failed to get the resolutions");

                using (handle)
                {
                    return(GetVideoResolutions(handle));
                }
            }
        }
Beispiel #3
0
        private static NativeHandle CreateHandle(Camera camera)
        {
            if (camera == null)
            {
                throw new ArgumentNullException(nameof(camera));
            }

            if (!Features.IsSupported(RecorderFeatures.VideoRecorder))
            {
                throw new NotSupportedException("Video Recorder is not supported.");
            }

            Native.CreateVideo(camera.Handle, out var handle).
            ThrowIfError("Failed to create video recorder.");

            return(handle);
        }
        private static IEnumerable <Size> LoadVideoResolutions(CameraDevice device)
        {
            if (!Features.IsSupported(RecorderFeatures.VideoRecorder))
            {
                throw new NotSupportedException("Video Recorder is not supported.");
            }

            using (var camera = new Camera(device))
            {
                Native.CreateVideo(camera.Handle, out var handle).ThrowIfError("Failed to get the resolutions");

                using (handle)
                {
                    return(GetVideoResolutions(handle));
                }
            }
        }