예제 #1
0
 protected override void Dispose(bool disposing)
 {
     if (codecContext == null)
     {
         return;
     }
     FF.avcodec_close(codecContext);
     codecContext = null;
 }
예제 #2
0
        internal static AVCodec *GetEncoder(AVCodecID codecID)
        {
            AVCodec *codec = FF.avcodec_find_encoder(codecID);

            if (codec == null)
            {
                throw new ArgumentException($"未能找到编码器:{codecID}", nameof(codecID));
            }
            return(codec);
        }
예제 #3
0
        public static IReadOnlyList <CodecDescription> GetAllCodecs()
        {
            var      list  = new List <CodecDescription>();
            AVCodec *codec = FF.av_codec_next(null);

            while (codec != null)
            {
                list.Add(new CodecDescription(codec));
                codec = FF.av_codec_next(codec);
            }
            return(list);
        }