Previous | Next |
The basic types of media handled by this SDK are audio, video, and script. The properties of a particular media file are described by the IWMMediaProps interface. Certain types of media have additional media interfaces that have more properties; for instance, an object describing the properties of a video stream supports the basic IWMMediaProps interface, and also IWMVideoMediaProps.
The basic properties of a media stream are stored in the WM_MEDIA_TYPE structure, which can be retrieved from the IWMMediaProps interface. This structure is identical to the Microsoft® DirectShow® AM_MEDIA_TYPE structure, but is renamed in this SDK to avoid compile-time conflicts between this SDK and the Microsoft® DirectShow® SDK. The WM_MEDIA_TYPE structure contains a majortype member, which indicates the type of media: audio, video or scripts. The subtype field contains information about the actual format of the media. There is also a pointer to a format structure in the WM_MEDIA_TYPE structure; the type of this structure is defined by the formattype member. Other members of the WM_MEDIA_TYPE structure indicate the basic properties of the media.
For audio, the majortype member must be set to WMMEDIATYPE_Audio. The subtype member contains the format of the audio data; common choices are WMMEDIASUBTYPE_PCM (for PCM uncompressed audio), or WMMEDIASUBTYPE_WMAudioV2 (for audio compressed with the version of the Windows Media Audio codec included with the SDK). The formattype member must be WMFORMAT_WaveFormatEx, indicating that the pbFormat field points at a WAVEFORMATEX structure describing other properties of the audio data.
For video, the majortype must be set to WMMEDIATYPE_Video. The subtype member describes the format of the video data; WMMEDIASUBTYPE_MP43 indicates video data encoded with the Microsoft MPEG-4 encoder included in this SDK; other subtypes are defined in the SDK header files. The formattype should be WMFORMAT_VideoInfo, indicating that the pbFormat member points to a WMVIDEOINFOHEADER structure.
For script commands, the majortype must be WMMEDIATYPE_Script, and the subtype must be set to GUID_NULL. The formattype must be WMFORMAT_Script, indicating that the structure to which pbFormat points is a WMSCRIPTFORMAT structure. This structure contains a GUID scriptType that indicates the format of the script command samples; the only type currently supported by this SDK is WMSCRIPTTYPE_TwoStrings. This indicates that the samples will contain two consecutive NULL-terminated Unicode strings; the first is the type of the script command, and the second is the member of the script command.
See Also
Previous | Next |