Пример #1
0
 private VideoCompressor(VideoCompressorHandle hic, VideoCompressorInfo info)
 {
     _hic          = hic;
     Info          = info;
     IsCompressing = false;
     FrameIndex    = -1;
 }
Пример #2
0
        public static VideoCompressor Open(VideoCompressorInfo info)
        {
            var compressor = TryOpen(info);

            if (compressor == null)
            {
                throw new VideoCompressorException("Failed to open video compressor.");
            }

            return(compressor);
        }
Пример #3
0
        public static VideoCompressor TryOpen(VideoCompressorInfo info)
        {
            if (info == null)
            {
                throw new ArgumentNullException(nameof(info));
            }

            var hic = ICOpen(FourCC.VIDC, info.FccHandler, IcMode.Compress);

            if (hic.IsInvalid)
            {
                return(null);
            }

            return(new VideoCompressor(hic, info));
        }