AVISave

The AVISave function builds a file by combining data streams from other files or from memory.

HRESULT AVISave(
  LPCTSTR szFile,                
  CLSID * pclsidHandler,         
  AVISAVECALLBACK lpfnCallback,  
  int nStreams,                  
  PAVISTREAM pavi,               
  LPAVICOMPRESSOPTIONS lpOptions,  
  . . .                          
);

Parameters

szFile

Null-terminated string containing the name of the file to save.

pclsidHandler

Pointer to the file handler used to write the file. The file is created by calling the AVIFileOpen function using this handler. If a handler is not specified, a default is selected from the registry based on the file extension.

lpfnCallback

Pointer to a callback function for the save operation.

nStreams

Number of streams saved in the file.

pavi

Pointer to an AVI stream. This parameter is paired with lpOptions. The parameter pair can be repeated as a variable number of arguments.

lpOptions

Pointer to an application-defined AVICOMPRESSOPTIONS structure containing the compression options for the stream referenced by pavi. This parameter is paired with pavi. The parameter pair can be repeated as a variable number of arguments.

Return Values

Returns AVIERR_OK if successful or an error otherwise.

Remarks

This function creates a file, copies stream data into the file, closes the file, and releases the resources used by the new file. The last two parameters of this function identify a stream to save in the file and define the compression options of that stream. When saving more than one stream in an AVI file, repeat these two stream-specific parameters for each stream in the file.

A callback function (referenced by using lpfnCallback) can display status information and let the user cancel the save operation. The callback function uses the following format:

LONG PASCAL SaveCallback(int nPercent)  

The nPercent parameter specifies the percentage of the file saved.

The callback function should return AVIERR_OK if the operation should continue and AVIERR_USERABORT if the user wishes to abort the save operation.

The argument pavi is a pointer to an IAVIStream interface.

Requirements

**  Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Vfw.h.
**  Library:** Use Vfw32.lib.
**  Unicode:** Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

See Also

AVIFile Functions and Macros, AVIFile Functions, AVICOMPRESSOPTIONS