avformat_open_input() 개인적인 메소드

private avformat_open_input ( [ pFormatContext, [ filename, IntPtr fmt, IntPtr options ) : Int32
pFormatContext [
filename [
fmt IntPtr
options IntPtr
리턴 System.Int32
예제 #1
0
        public IAVStream GetAVStream(string fileName)
        {
            if (fileName == string.Empty)
            {
                throw new Exception("No Input file");
            }

            FileInfo info        = new FileInfo(fileName);
            string   file        = info.FullName;
            IntPtr   fileContext = IntPtr.Zero;
            int      ret         = AV.avformat_open_input(out fileContext, file, IntPtr.Zero, IntPtr.Zero);

            if (ret < 0)
            {
                throw new InvalidOperationException("can not open input file");
            }

            ret = AV.avformat_find_stream_info(fileContext, IntPtr.Zero);
            if (ret < 0)
            {
                throw new InvalidOperationException("can not find stream info");
            }

            return(new AVStream(fileContext));
        }