AVI API

来源:互联网 发布:淘宝客新增网站推广 编辑:程序博客网 时间:2024/06/06 18:59

打开AVI文件,并且返回地址,主要获得打开的次数,但是不释放,释放要用到AVIFileRelease;

STDAPI AVIFileOpen(   PAVIFILE *ppfile,   //缓冲区,接受IAVIFILE指针   LPCTSTR  szFile,  //要打开的文件名   UINT     mode,    //打开文件的权限模式,磨人的是OF_READ;   CLSID    pclsidHandler   //NULL,默认为从注册表中获取定义的Handler指针);

Returns zero if successful or an error otherwise



The AVIFileCreateStream function creates a new stream in an existing file and creates an interface to the new stream.

STDAPI AVIFileCreateStream(   PAVIFILE       pfile,//要打开的文件   PAVISTREAM     *ppavi,    //新的接口流的指针   AVISTREAMINFO  *psi    //包含新数据流的结构体指针);
Returns zero if successful or an error otherwise


设置流的格式和指定的位置

STDAPI AVIStreamSetFormat(   PAVISTREAM pavi,    //要打开的流   LONG       lPos,  //要接受这个格式流的位置   LPVOID     lpFormat,  //新的流的结构体指针   LONG       cbFormat   //size, in bytes, of the block of memory referenced by lpFormat);


The AVIStreamWrite function writes data to a stream.

STDAPI AVIStreamWrite(   PAVISTREAM pavi,     //Handle to an open stream.   LONG       lStart,  //First sample to write   LONG       lSamples,  //Number of samples to write.   LPVOID     lpBuffer,   //Pointer to a buffer containing the data to write   LONG       cbBuffer,  //Size of the buffer referenced by lpBuffer.   DWORD      dwFlags,   LONG       *plSampWritten,  //Pointer to a buffer that receives the number of samples written. This can be set to NULL.   LONG       *plBytesWritten  //Pointer to a buffer that receives the number of bytes written. This can be set to NULL.);

Returns zero if successful or an error otherwise.

0 0
原创粉丝点击