Ejemplo n.º 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);
        }
Ejemplo n.º 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));
                }
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
        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));
                }
            }
        }