Previous | Next |
The OnStatus method is called when status information must be communicated by the reader to the host application. This happens routinely when a Windows Media file is being opened and read, and when errors occur during reading.
Syntax
HRESULT OnStatus(
WMT_STATUS Status,
HRESULT hr,
WMT_ATTR_DATATYPE dwType,
BYTE* pValue,
void* pvContext
);
Parameters
Status
[in] Specifies one member of the WMT_STATUS enumeration type. For a description of possible WMT_STATUS members, see the table in the Remarks section.
hr
[in] Specifies an HRESULT error code.
dwType
[in] Double word containing a value of WMT_ATTR_DATATYPE type, indicating what this OnStatus call means.
pValue
[in] Pointer to a value object.
pvContext
[in] Universal pointer to the context. This context pointer matches the context passed to IWMReader::Open, IWMReader::Start, or IWMIndexer::StartIndexing.
Return Values
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Remarks
The contents of pParam depend on those of Status.
The WMT_STATUS members that can be returned by the IWMReaderCallback method are as follows.
Members | Number | Description |
WMT_ERROR | 0 | An error occurred in reading the file. |
WMT_OPENED | 1 | The file has been opened for reading. |
WMT_BUFFERING_START | 2 | The reader has started buffering data. |
WMT_BUFFERING_STOP | 3 | The reader has stopped buffering data. |
WMT_EOF | 4 | The reader has reached the end of the file. |
WMT_END_OF_FILE | 4 | The reader has reached the end of the file. |
WMT_END_OF_SEGMENT | 5 | When the Start() method is called with a duration argument, WMT_END_OF_SEGMENT is returned when playback has been completed after the specified period. The argument is a QWORD indicating duration of playback in 100-nanosecond units. |
WMT_END_OF_STREAMING | 6 | The file has finished streaming. |
WMT_LOCATING | 7 | Locating a server. |
WMT_CONNECTING | 8 | Connecting to a server. |
WMT_NO_RIGHTS | 9 | The reader does not have the appropriate rights to access this file. |
WMT_MISSING_CODEC | 10 | The reader does not have the appropriate codec to decompress this file. |
WMT_STARTED | 11 | The reader has started reading the file |
WMT_STOPPED | 12 | The reader has stopped reading the file. |
WMT_CLOSED | 13 | The reader has closed the file. |
WMT_STRIDING | 14 | The reader is seeking through the file. |
WMT_TIMER | 15 | A timer event has occurred. |
The WMT_STATUS enumerated types that can be returned by the IWMIndexer::StartIndexing method are as follows.
Members | Number | Description |
WMT_ERROR | 0 | An error occurred in reading the file. |
WMT_OPENED | 1 | The file has been opened for indexing. |
WMT_STARTED | 11 | The indexer has started indexing the file |
WMT_STOPPED | 12 | The indexer has stopped indexing the file. |
WMT_CLOSED | 13 | The indexer has closed the file. |
WMT_INDEX_PROGRESS | 16 | Indicates the progress of the current indexing operation. The argument is a double word that indicates percentage completed, ranging from 0 to 100. |
See Also
Previous | Next |