示例#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));
        }