예제 #1
0
        //private COMPVARS compvars = null;

        /// <summary>
        /// 初始化视频编解码器
        /// </summary>
        /// <param name="bitmapInfoHeader">图像头信息</param>
        /// <param name="isEncode">标识完成编码还是解码功能</param>
        public VideoEncoder(BITMAPINFO bitmapInfo, bool isEncode)
        {
            //BITMAPINFO bitmapInfo = new BITMAPINFO();
            //bitmapInfo.bmiHeader = bitmapInfoHeader;


            this.IsEncode = isEncode;
            if (isEncode)
            {
                COMPVARS compvars = new COMPVARS();
                compvars.cbSize     = Marshal.SizeOf(compvars);
                compvars.dwFlags    = 1;
                compvars.fccHandler = FOURCC.MP42;
                compvars.fccType    = FOURCC.ICTYPE_VIDEO;
                compvars.lDataRate  = 780; // 780;
                compvars.lKey       = 15;  // 15;
                compvars.lQ         = 500; // -1;
                //compvars.lQ = 500;

                this.Compressor = new ICCompressor(compvars, bitmapInfo, FOURCC.MP42);
                this.Compressor.Open();//打开编码器
            }
            else
            {
                bitmapInfo.bmiHeader.biCompression = FOURCC.MP42;
                this.Decompressor = new ICDecompressor(new COMPVARS(), bitmapInfo, FOURCC.MP42);
                this.Decompressor.Open();
            }
        }
예제 #2
0
       /// <summary>
       /// 初始化视频编解码器
       /// </summary>
        /// <param name="bitmapInfo">图像头信息</param>
       /// <param name="isEncode">标识完成编码还是解码功能</param>
        public VideoEncoder(BITMAPINFO bitmapInfo, bool isEncode)
        {
            this.IsEncode = isEncode;
            if (isEncode)
            {
                COMPVARS compvars = new COMPVARS();
                compvars.cbSize = Marshal.SizeOf(compvars);
                compvars.dwFlags = 1;
                compvars.fccHandler = FOURCC.MP42;
                compvars.fccType = FOURCC.ICTYPE_VIDEO;
                compvars.lDataRate = 780;// 780;
                compvars.lKey = 15;// 15;
                compvars.lQ = 500;// -1;
                //compvars.lQ = 500;

                this.Compressor = new ICCompressor(compvars, bitmapInfo, FOURCC.MP42);
                this.Compressor.Open();//打开编码器
            }
            else
            {
                bitmapInfo.bmiHeader.biCompression = FOURCC.MP42;
                this.Decompressor = new ICDecompressor(new COMPVARS(), bitmapInfo, FOURCC.MP42);
                this.Decompressor.Open();
            }
        }
예제 #3
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 public static extern int ICSeqCompressFrame(
     COMPVARS pc,
     int uiFlags,
     byte[] lpBits,
     ref bool pfKey,
     ref long plSize
     );
예제 #4
0
 public ICBase(COMPVARS cp,BITMAPINFO biIn,ICMODE mode,int fourcc)
 {
     this.pp=cp;
     this._in=biIn;
     this.mode=mode;
     this.fourcc=fourcc;
     _out=new BITMAPINFO();
 }
예제 #5
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 public ICBase(COMPVARS cp, BITMAPINFO biIn, ICMODE mode, int fourcc)
 {
     this.pp     = cp;
     this._in    = biIn;
     this.mode   = mode;
     this.fourcc = fourcc;
     _out        = new BITMAPINFO();
 }
예제 #6
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 public static extern bool ICCompressorChoose(
     IntPtr hwnd,
     int uiFlags,
     //ref BITMAPINFO pvIn,
     int pvIn,
     int lpData,
     COMPVARS pc,
     string lpszTitle
     );
예제 #7
0
 //ICMODE_DECOMPRESS
 /// <summary>
 /// ��ʼ����Ƶ������
 /// </summary>
 /// <param name="cp">ѹ������</param>
 /// <param name="biIn">ͼ����Ϣ</param>
 /// <param name="fourcc">��������</param>
 public ICDecompressor(COMPVARS cp,BITMAPINFO biIn,int fourcc)
     : base(cp,biIn,ICMODE.ICMODE_DECOMPRESS,fourcc)
 {
 }
예제 #8
0
        public static extern bool ICSeqCompressFrameStart(
			COMPVARS pc,        
			ref BITMAPINFO lpbiIn  
			);
예제 #9
0
 public static extern void ICSeqCompressFrameEnd(ref COMPVARS pc);
예제 #10
0
        public static extern int ICSeqCompressFrame(
			COMPVARS pc,  
			int uiFlags,  
			byte[] lpBits, 
			ref bool pfKey,  
			ref long plSize  
			);
예제 #11
0
        public static extern bool ICCompressorChoose(
			IntPtr hwnd,      
			int uiFlags,   
			//ref BITMAPINFO pvIn,   
			int pvIn,
			int lpData,  
			COMPVARS pc,   
			string lpszTitle 
			);
예제 #12
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 public static extern bool ICSeqCompressFrameStart(
     COMPVARS pc,
     ref BITMAPINFO lpbiIn
     );
예제 #13
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 public static extern void ICSeqCompressFrameEnd(ref COMPVARS pc);
예제 #14
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 /// <summary>
 /// ³õʼ»¯ÊÓƵ½âÂëÆ÷
 /// </summary>
 /// <param name="cp">ѹËõ¶ÔÏñ</param>
 /// <param name="biIn">ͼÏñÐÅÏ¢</param>
 /// <param name="fourcc">±àÂëÀàÐÍ</param>
 public ICDecompressor(COMPVARS cp, BITMAPINFO biIn, int fourcc) : base(cp, biIn, ICMODE.ICMODE_DECOMPRESS, fourcc) //ICMODE_DECOMPRESS
 {
 }
예제 #15
0
파일: ICM.cs 프로젝트: xingchaoet/ourmsg
 /// <summary>
 /// ³õʼ»¯ÊÓƵ±àÂëÆ÷
 /// </summary>
 /// <param name="cp">ѹËõ¶ÔÏñ</param>
 /// <param name="biIn">ͼÏñÐÅÏ¢</param>
 /// <param name="fourcc">±àÂëÀàÐÍ</param>
 public ICCompressor(COMPVARS cp, BITMAPINFO biIn, int fourcc) : base(cp, biIn, ICMODE.ICMODE_COMPRESS, fourcc)
 {
 }