Microsoft DirectX 8.0 |
These functions manipulate the DMO_MEDIA_TYPE structure. They are declared in the file Dmort.h.
MoInitMediaType Initializes a media type structure. MoFreeMediaType Frees the allocated members of a media type structure. MoCopyMediaType Copies the members of one media type structure into another media type structure. MoCreateMediaType Allocates a new media type structure. MoDeleteMediaType Deletes a media type structure that was previously allocated. MoDuplicateMediaType Duplicates a media type structure.
Initializes a media type structure.
Syntax
HRESULT MoInitMediaType( DMO_MEDIA_TYPE *pmt, DWORD cbFormat );
Parameters
- pmt
- Pointer to an uninitialized DMO_MEDIA_TYPE structure allocated by the caller.
- cbFormat
- Number of bytes to allocate for the format block. Can be zero.
Return Value
Returns an HRESULT value. Possible values include the following:
S_OK Success E_OUTOFMEMORY Insufficient memory E_POINTER NULL pointer argument
Remarks
This function allocates the format block and sets the cbFormat and pbFormat members of the DMO_MEDIA_TYPE structure.
The caller must free the media type by calling the MoFreeMediaType function.
Frees the allocated members of a media type structure.
Syntax
HRESULT MoFreeMediaType( DMO_MEDIA_TYPE *pmt );
Parameters
- pmt
- Pointer to an initialized DMO_MEDIA_TYPE structure.
Return Value
Returns an HRESULT value. Possible values include the following:
S_OK Success E_POINTER NULL pointer argument
Remarks
This function frees the format block pointed to by the pbFormat member of the DMO_MEDIA_TYPE structure.
Copies the members of one media type structure into another media type structure.
Syntax
HRESULT MoCopyMediaType( DMO_MEDIA_TYPE *pmtDest, const DMO_MEDIA_TYPE *pmtSrc );
Parameters
- pmtDest
- Pointer to the target DMO_MEDIA_TYPE structure. The caller must allocate, but not initialize, this structure.
- pmtSrc
- Pointer to the source DMO_MEDIA_TYPE structure.
Return Value
Returns an HRESULT value. Possible values include the following:
S_OK Success E_OUTOFMEMORY Insufficient memory E_POINTER NULL pointer argument
Remarks
This function copies all the members of pmtSrc to pmtDest and copies the format block.
The caller must free the target media type by calling the MoFreeMediaType function.
Allocates a new media type structure.
Syntax
HRESULT MoCreateMediaType( DMO_MEDIA_TYPE **ppmt, DWORD cbFormat );
Parameters
- ppmt
- Address of a pointer to a DMO_MEDIA_TYPE structure that receives the allocated structure.
- cbFormat
- Number of bytes to allocate for the format block. Can be zero.
Return Value
Returns an HRESULT value. Possible values include the following:
S_OK Success E_OUTOFMEMORY Insufficient memory E_POINTER NULL pointer argument
Remarks
This function allocates a new DMO_MEDIA_TYPE structure and then initializes it by calling the MoInitMediaType function.
The caller must delete the media type structure by calling the MoDeleteMediaType function.
Deletes a media type structure that was previously allocated.
Syntax
HRESULT MoDeleteMediaType( DMO_MEDIA_TYPE *pmt );
Parameters
- pmt
- Pointer to an initialized DMO_MEDIA_TYPE structure.
Return Value
Returns an HRESULT value. Possible values include the following:
S_OK Success E_POINTER NULL pointer argument
Remarks
This function frees the allocated members of the media type structure by calling MoFreeMediaType. Then it frees the media type structure itself.
Duplicates a media type structure.
Syntax
HRESULT MoDuplicateMediaType( DMO_MEDIA_TYPE **ppmtDest, const DMO_MEDIA_TYPE *pmtSrc );
Parameters
- ppmtDest
- Address of a pointer to a DMO_MEDIA_TYPE structure that receives the duplicated structure.
- pmtSrc
- Pointer to the media type structure to duplicate.
Return Value
Returns an HRESULT value. Possible values include the following:
S_OK Success E_OUTOFMEMORY Insufficient memory E_POINTER NULL pointer argument
Remarks
This method is equivalent to calling MoCreateMediaType and MoCopyMediaType.
The caller must delete the returned media type structure by calling the MoDeleteMediaType function.