Microsoft DirectX 8.1 (C++) |
The IMediaDet interface retrieves information about a media file, such as the number of streams, and the media type, duration, and frame rate of each stream. It also contains methods for retrieving poster frames from a video stream.
The Media Detector (MediaDet) object exposes this interface.
To obtain information about a file using this interface, perform the following steps:
To retrieve poster frames, call IMediaDet::GetBitmapBits or IMediaDet::WriteBitmapBits. Alternatively, call IMediaDet::EnterBitmapGrabMode and then IMediaDet::GetSampleGrabber to obtain a pointer to the ISampleGrabber interface. All three of these methods put the media detector into a new mode, called bitmap grab mode. The informational methods described previously do not work in this mode. Therefore, obtain any information you need before retrieving poster frames, or else create new instances of the media detector for each stream.
The IMediaDet interface does not support VIDEOINFOHEADER2 formats, so you cannot use this interface to get interlaced fields or information about interlacing. Also, if the upstream decoder supports only VIDEOINFOHEADER2, you cannot use IMediaDet. This might be the case with an MPEG-2 decoder, for example.
Requirements
Requires Qedit.h.
In addition to the methods inherited from IUnknown, the IMediaDet interface exposes the following methods.
Method | Description |
EnterBitmapGrabMode | Switches the media detector to bitmap grab mode and seeks the filter graph to a specified time. |
get_CurrentStream | Retrieves the stream number currently used by the media detector. |
get_Filename | Retrieves the name of the source file currently used by the media detector. |
get_Filter | Retrieves a pointer to the source filter currently used by the media detector. |
get_FrameRate | Retrieves the frame rate of the current stream. |
get_OutputStreams | Retrieves the number of output streams contained in the media source. |
get_StreamLength | Retrieves the duration of the current stream. |
get_StreamMediaType | Retrieves the media type of the current stream. |
get_StreamType | Retrieves the globally unique identifier (GUID) for the media type of the current stream. |
get_StreamTypeB | Retrieves a string representing the GUID of the media type for the current stream. |
GetBitmapBits | Retrieves a poster frame at the specified media time. |
GetSampleGrabber | Retrieves a pointer to the ISampleGrabber interface. |
put_CurrentStream | Specifies the stream number for the media detector to use. |
put_Filename | Specifies the name of the source file for the media detector to use. |
put_Filter | Specifies a source filter for the media detector to use. |
WriteBitmapBits | Retrieves a poster frame at the specified media time and writes it to a file. |