Esempio n. 1
0
        public FFmpegCodec(FFmpegFuncs ffmpeg, AVCodec *codec)
        {
            this.ffmpeg = ffmpeg;

            Pointer = codec;
            SupportedHwDeviceTypes = new Lazy <IReadOnlyList <AVHWDeviceType> >(() =>
            {
                var list = new List <AVHWDeviceType>();

                int i = 0;

                while (true)
                {
                    var hwCfg = ffmpeg.avcodec_get_hw_config(codec, i);
                    if (hwCfg == null)
                    {
                        break;
                    }

                    list.Add(hwCfg->device_type);

                    i++;
                }

                return(list);
            });
        }