原创 这段时间的笔记。。。很乱

2009-1-20 10:26 4383 6 7 分类: 软件与OS
下午回家,把笔记放上来,虽然很乱,但很有其价值所在。真的想了解这些东西的还要自己去看资料!

MFC只视频流点击下载 下载
AVI文件和BMP文件在结构上似乎很相近
1.AVIFileInfo()
The AVIFileInfo function obtains information about an AVI file.
STDAPI AVIFileInfo(
  PAVIFILE pfile,  //  Handle of an open AVI file.
  AVIFILEINFO * pfi,  //Address of the structure used to return file information.
  LONG lSize         // Size, in bytes, of the structure.
);
 

2.结构


AVIFILEINFO
The AVIFILEINFO structure contains global information for an entire AVI file.
typedef struct {
    DWORD dwMaxBytesPerSec;
    DWORD dwFlags;
    DWORD dwCaps;
    DWORD dwStreams;
    DWORD dwSuggestedBufferSize;
    DWORD dwWidth;
    DWORD dwHeight;
    DWORD dwScale;
    DWORD dwRate;
    DWORD dwLength;
    DWORD dwEditCount;
    char  szFileType[64];
} AVIFILEINFO;


AVISTREAMINFO
The AVISTREAMINFO structure contains information for a single stream.
typedef struct {
    DWORD fccType;
    DWORD fccHandler;
    DWORD dwFlags;
    DWORD dwCaps;
    WORD  wPriority;
    WORD  wLanguage;
    DWORD dwScale;
    DWORD dwRate;
    DWORD dwStart;
    DWORD dwLength;
    DWORD dwInitialFrames;
    DWORD dwSuggestedBufferSize;
    DWORD dwQuality;
    DWORD dwSampleSize;
    RECT  rcFrame; //Dimensions of the video destination rectangle.
                   //The values represent the coordinates of upper left corner,
                   // the height, and the width of the rectangle.
    DWORD dwEditCount;
    DWORD dwFormatChangeCount;
    char  szName[64];
} AVISTREAMINFO;
 
 AVICOMPRESSOPTIONS
The AVICOMPRESSOPTIONS structure contains information about a stream and how it is compressed and saved.
This structure passes data to the AVIMakeCompressedStream function (or the AVISave function, which uses
AVIMakeCompressedStream).
typedef struct {
    DWORD  fccType;
    DWORD  fccHandler;
    DWORD  dwKeyFrameEvery;
    DWORD  dwQuality;
    DWORD  dwBytesPerSecond;
    DWORD  dwFlags;
    LPVOID lpFormat;
    DWORD  cbFormat;
    LPVOID lpParms;
    DWORD  cbParms;
    DWORD  dwInterleaveEvery;
} AVICOMPRESSOPTIONS;




3.AVIFileInit在使用其他AVI函数前,使用它初始化AVI函数库
The AVIFileInit function initializes the AVIFile library.
The AVIFile library maintains a count of the number of times it is initialized,
but not the number of times it was released.
Use the AVIFileExit function to release the AVIFile library and decrement the reference count.
Call AVIFileInit before using any other AVIFile functions.
This function supersedes the obsolete AVIStreamInit function.

4.
AVIFileOpen
The AVIFileOpen function opens an AVI file and returns the address of a file interface used to access it.
The AVIFile library maintains a count of the number of times a file is opened, but not the number of times it was released.
Use the AVIFileRelease function to release the file and decrement the count.

STDAPI AVIFileOpen(
  PAVIFILE * ppfile,    
  LPCTSTR szFile,       
  UINT mode,            
  CLSID * pclsidHandler 
);


AVIFileCreateStream
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 
);
This function starts a reference count for the new stream.

AVIMakeCompressedStream
The AVIMakeCompressedStream function creates a compressed stream from an uncompressed stream
and a compression filter, and returns the address of a pointer to the compressed stream.
This function supports audio and video compression.

STDAPI AVIMakeCompressedStream(
  PAVISTREAM * ppsCompressed,  //Address to contain the compressed stream pointer.
  PAVISTREAM psSource,        
  AVICOMPRESSOPTIONS * lpOptions, //   Address of a structure that identifies the type of compression to use and the options to apply
  CLSID * pclsidHandler    //Address of a class identifier used to create the stream
);

AVISaveOptions
The AVISaveOptions function retrieves the save options for a file and returns them in a buffer.

BOOL AVISaveOptions(
  HWND hwnd,        //vHandle of the parent window for the Compression Options dialog box.
 
  UINT uiFlags,     //Flags for displaying the Compression Options dialog box.
  int nStreams,   //                  
  PAVISTREAM * ppavi,  //Address of an array of stream interface pointers             
  LPAVICOMPRESSOPTIONS * plpOptions  //Address of an array of pointers to AVICOMPRESSOPTIONS
                                     //structures. These structures hold the compression options
                                     //set by the dialog box. The nStreams parameter indicates
                                     //the number of pointers in the array.

);



AVIStreamSetFormat  //设置视频流格式
The AVIStreamSetFormat function sets the format of a stream at the specified position.

STDAPI AVIStreamSetFormat(
  PAVISTREAM pavi,  //Handle of an open stream.
  LONG lPos,        //Position in the stream to receive the format.

  LPVOID lpFormat,  //Position in the stream to receive the format.

  LONG cbFormat     //Size, in bytes, of the block of memory referenced by lpFormat.
);


AVIStreamWrite
The AVIStreamWrite function writes data to a stream.
STDAPI AVIStreamWrite(
  PAVISTREAM pavi,  //Handle of an open stream.      
  LONG lStart,         //First sample to write 
  LONG lSamples,         //Number of samples to write
  LPVOID lpBuffer,//Address of a buffer containing the data to write
  LONG cbBuffer,         //Size of the buffer referenced by lpBuffer.
  DWORD dwFlags,        
  LONG * plSampWritten,  //Address to contain the number of samples written. This can be set to NULL.

  LONG * plBytesWritten  //Address to contain the number of bytes written. This can be set to NULL.

);
 
 
界面更新
CCmdUI does not have a base class.

The CCmdUI class is used only within an ON_UPDATE_COMMAND_UI handler in a CCmdTarget-derived class.

When a user of your application pulls down a menu, each menu item needs to know whether it should be
displayed as enabled or disabled. The target of a menu command provides this information by implementing
 an ON_UPDATE_COMMAND_UI handler. Use ClassWizard to browse the command user-intetrface objects in your
 application and create a message-map entry and function prototype for each handler.

When the menu is pulled down, the framework searches for and calls each ON_UPDATE_COMMAND_UI handler,
each handler calls CCmdUI member functions such as Enable and Check, and the framework then appropriately
displays each menu item.

A menu item can be replaced with a control-bar button or other command user-interface objec without changing
the code within the ON_UPDATE_COMMAND_UI handler.


 
When it routes an update command to its handler, the framework passes the handler a pointer to
a CCmdUI object (or to an object of a CCmdUI-derived class). This object represents the menu item
 or toolbar button or other user-interface object that generated the command. The update handler
  calls member functions of the CCmdUI structure through the pointer to update the user-interface
   object. For example, here is an update handler for the Clear All menu item:
void CMyClass::OnUpdateToolsMyTool( CCmdUI* pCmdUI )
{
    if( ToolAvailable() )
        pCmdUI->Enable( TRUE );
}
This handler calls the Enable member function of an object with access to the menu item.
Enable makes the item available for use.



CCmdUI::Enable
virtual void Enable( BOOL bOn = TRUE );
TRUE to enable the item, FALSE to disable it.
Remarks:
Call this member function to enable or disable the user-interface item for this command.


CCmdUI::SetCheck
virtual void SetCheck( int nCheck = 1 );
Specifies the check state to set. If 0, unchecks; if 1, checks; and if 2, sets indeterminate.
Remarks:
Call this member function to set the user-interface item for this command to the appropriate check state.
This member function works for menu items and toolbar buttons. The indeterminate state applies only to toolbar buttons.
memset
Sets buffers to a specified character.
void *memset( void *dest,//Pointer to destination
             int c,      //Character to set
             size_t count
             );
returns the value of dest.


PARTNER CONTENT

文章评论1条评论)

登录后参与讨论

用户312121 2011-1-7 19:10

你好?由bmp做avi能实现吗?非期待你的回帖,谢谢!
相关推荐阅读
zhangshaobing517_935512703 2011-03-21 01:28
KC24RT-300调试笔记
项目中需要使用LED驱动器,主要是为了让一串LED发出的光照一致,所以在试验中采用LED串联的方式比较好点,LED并联容易导致LED发光的 不均匀以及寿命减少。我在项目中采用金升阳公司的KC24RT-...
zhangshaobing517_935512703 2010-11-19 14:53
线程中CreateEvent和SetEvent及WaitForSingleObj
首先介绍CreateEvent是创建windows事件的意思,作用主要用在判断线程退出,程锁定方面.CreateEvent 函功能描述:创建或打开一个命名的或无名的事件对象.EVENT有两种状态:发信...
zhangshaobing517_935512703 2010-11-15 13:29
VS2008 BEGIN
Visual Studio 2008环境与VC6.0的环境存在着比较大的区别,下面就一些小小的区别在这里做一些探讨,欢迎指教!1、如果是调试控制台程序,很多时候点击“启动调试”后是一闪而过,此时可有两...
zhangshaobing517_935512703 2010-11-01 20:38
使用MFC的数组类
 MFC的数组类支持的数组类似于C++中的常规数组,可以存放任何数据类型。C++的常规数组在使用前必须将其定义成能够容纳所有可能需要的元素,而MFC数组类创建的对象可以根据需要动态地增大或减小,数组的...
zhangshaobing517_935512703 2010-09-07 13:14
循环
 循环设计的注意的事情:(1)双重循环的跳出问题,break只挑出所在的循环,如果使用双层FOR循环,单个BREAK就不可能跳出所有的双层(2)在迭代的时候,注意起始和终止的条件,尤其是终止问题(3)...
zhangshaobing517_935512703 2010-09-02 01:09
图像处理改进
1.特征点提取的算法  标志点的提取算法对结果的影响虽然没有经过试验或者计算的推算,每1个pix的偏差对结果的影响有多大,但是不可避免的,要想获得高精度的  测量结果,高精度的提取对结果的影响还是很大...
EE直播间
更多
我要评论
1
6
关闭 站长推荐上一条 /3 下一条