ACMDRVSTREAMHEADER

See also ACMDM_STREAM_CLOSE, ACMDM_STREAM_CONVERT, ACMDM_STREAM_OPEN, ACMDM_STREAM_PREPARE, ACMDM_STREAM_RESET, ACMDM_STREAM_SIZE, ACMDM_STREAM_UNPREPARE, ACMDRVOPENDESC, ACMDRVSTREAMINSTANCE, ACMDRVSTREAMSIZE


typedef struct {
    DWORD cbStruct;         
    DWORD fdwStatus;        
    DWORD dwUser;           
    LPBYTE pbSrc;           
    DWORD cbSrcLength;      
    DWORD cbSrcLengthUsed;  
    DWORD dwSrcUser;        
    LPBYTE pbDst;           
    DWORD cbDstLength;      
    DWORD cbDstLengthUsed;  
    DWORD dwDstUser;        
    DWORD fdwConvert;       
    LPACMDRVSTREAMHEADER padshNext; 
    DWORD fdwDriver;          
    DWORD dwDriver;           
    DWORD fdwPrepared;        
    DWORD dwPrepared;         
    LPBYTE pbPreparedSrc;     
    DWORD cbPreparedSrcLength;
    LPBYTE pbPreparedDst;     
    DWORD cbPreparedDstLength;
} ACMDRVSTREAMHEADER;

Defines the header used to identify an Audio Compression Manager (ACM) conversion source and destination buffer pair for a conversion stream. This structure is passed as the lParam2 parameter for the ACMDM_STREAM_PREPARE, ACMDM_STREAM_UNPREPARE, and ACMDM_STREAM_CONVERT ACM driver messages. Except where noted, no members of this structure can be modified by the driver, because they are intended for state information about a conversion stream and are maintained by the ACM.

cbStruct

Size, in bytes, of the ACMDRVSTREAMHEADER structure. This member is initialized by the ACM before calling the driver. This member can be greater than the size, in bytes, of the base ACMDRVSTREAMHEADER structure. An ACM driver should ignore any members that are not contained in the base ACMDRVSTREAMHEADER structure. This member should not be modified by the driver.

fdwStatus

Flags giving information about the conversion buffers. This member should not be modified by the driver except as indicated below.

ACMSTREAMHEADER_STATUSF_DONE

Indicates that a conversion is complete.

ACMSTREAMHEADER_STATUSF_INQUEUE

Set by the driver to indicate that the data buffers are queued for an asynchronous conversion. If the conversion stream is not asynchronous, the driver should not modify this flag.

ACMSTREAMHEADER_STATUSF_PREPARED

Set by the ACM to indicate that the data buffers have been prepared with acmStreamPrepareHeader. This flag is always maintained by the ACM regardless of whether the driver supports preparing stream headers.


dwUser

32 bits of user data. This can be any instance data specified by the application. This member should not be examined or modified by the driver.

pbSrc

Address of the source data buffer. This pointer will always refer to the same location while the stream header remains prepared. If an application needs to change the source location, it will unprepare the header and re-prepare it with the alternate location. This member should not be modified by the driver. This pointer will always be non-NULL.

cbSrcLength

Length, in bytes, of the source data buffer pointed to by pbSrc. When the header is prepared, this member specifies the maximum size that will be used in the source buffer. Conversions can be performed on source lengths less than or equal to the original prepared size. However, this member will be reset to the original size when unpreparing the header. This member should not be modified by the driver. This length will always be nonzero.

cbSrcLengthUsed

Amount of data, in bytes, used for the conversion. This member must be set by the driver when the conversion is complete. Note that this value can be less than or equal to cbSrcLength. An application will use the cbSrcLengthUsed member when advancing to the next piece of source data for the conversion stream.

dwSrcUser

32 bits of user data. This can be any instance data specified by the application. This member should not be examined or modified by the driver.

pbDst

Address of the destination data buffer. This pointer will always refer to the same location while the stream header remains prepared. If an application needs to change the destination location, it will unprepare the header and re-prepare it with the alternate location. This member should not be modified by the driver. This pointer will always be non-NULL.

cbDstLength

Length, in bytes, of the destination data buffer pointed to by pbDst. When the header is prepared, this member specifies the maximum size that will be used in the destination buffer. This member should not be modified by the driver. This length will always be nonzero.

cbDstLengthUsed

Amount of data in bytes returned by the conversion. This member must be set by the driver when the conversion is complete. Note that this value can be less than or equal to cbDstLength. An application will use the cbDstLengthUsed member when advancing to the next destination location for the conversion stream.

dwDstUser

32 bits of user data. This can be any instance data specified by the application. This member should not be examined or modified by the driver.

fdwConvert

This member defines flags that should be used for preparing, unpreparing, and converting stream buffers. This member is identical to:

This member should not be modified by the driver.

Currently, neither acmStreamPrepareHeader nor acmStreamUnprepareHeader define flags. The acmStreamConvert function defines the following flags:

ACM_STREAMCONVERTF_BLOCKALIGN

Specifies that only integral numbers of blocks should be converted. Converted data must end on block-aligned boundaries. An application uses this flag for all conversions on a stream until there is not enough source data to convert to a block-aligned destination; in which case, the last conversion will be specified without this flag.

ACM_STREAMCONVERTF_END

Specifies that the conversion stream should begin returning pending instance data. For example, if a conversion stream maintains instance data, such as the tail end of an echo filter operation, this flag should tell the driver to start returning this remaining data with optional source data. Note that this flag can be specified with the ACM_STREAMCONVERTF_START flag.

ACM_STREAMCONVERTF_START

Specifies that the conversion stream should reinitialize its instance data. For example, if a conversion stream maintains instance data, such as delta or predictor information, this flag should reset the stream to starting defaults. Note that this flag can be specified with the ACM_STREAMCONVERTF_END flag.


padshNext

Specifies a pointer that can be used by a driver to maintain a list of queued asynchronous conversion buffers. This member is intended for drivers to use for driver-specific lists. However, this member can be any instance data specified by the driver. This member will not be valid after returning a header to the caller.

fdwDriver

32 bits of driver-defined flags. This member is intended for drivers to use for driver-specific flags. However, this member can be any instance data specified by the driver. Note that this member is set by the driver and can be modified during any ACMDM_STREAM_CONVERT message. This member will be passed back with all ACMDM_STREAM_CONVERT messages unmodified by the ACM while the stream header remains prepared.

dwDriver

32 bits of driver-defined data. This can be any instance data specified by the driver. Note that this member is set by the driver and can be modified during any ACMDM_STREAM_CONVERT message. This member will be passed back with all ACMDM_STREAM_CONVERT messages unmodified by the ACM while the stream header remains prepared.

fdwPrepared

This member is used by the ACM and should not be examined or modified by the driver.

dwPrepared

This member is used by the ACM and should not be examined or modified by the driver.

pbPreparedSrc

This member is used by the ACM and should not be examined or modified by the driver.

cbPreparedSrcLength

This member is used by the ACM and should not be examined or modified by the driver.

pbPreparedDst

This member is used by the ACM and should not be examined or modified by the driver.

cbPreparedDstLength

This member is used by the ACM and should not be examined or modified by the driver.

The source (pbSrc) and destination (pbDst) data buffers are allocated with GlobalAlloc using the GMEM_MOVEABLE and GMEM_SHARE flags, and locked with GlobalLock.