Microsoft DirectX 8.0

IComponentType Interface

The IComponentType interface is implemented on ComponentType objects, which contains methods for setting and retrieving various properties for a Component. Every Component object has an associated ComponentType object that is set or retrieved with the get_Type and put_Type methods.

MethodNameDescription
CloneCreates a new copy of this component type.
get_CategoryRetrieves the component category.
get_MediaFormatTypeRetrieves the DirectShow media format type as a BSTR.
get__MediaFormatTypeRetrieves the DirectShow media format type as a GUID.
get_MediaMajorTypeRetrieves the DirectShow media major type as a BSTR.
get__MediaMajorTypeRetrieves the DirectShow media major type as a GUID.
get_MediaSubTypeRetrieves the DirectShow media subtype as a BSTR.
get__MediaSubTypeRetrieves the DirectShow media subtype as a GUID.
get_MediaTypeRetrieves the DirectShow AM_MEDIA_TYPE media type structure for the component.
put_CategorySets the component category.
put_MediaFormatTypeSets the DirectShow media format type.
put__MediaFormatTypeSets the DirectShow media format type.
put_MediaMajorTypeSets the DirectShow media major type.
put__MediaMajorTypeSets the DirectShow media major type.
put_MediaSubTypeSets the DirectShow media subtype.
put__MediaSubTypeSets the DirectShow media subtype.
put_MediaTypeSets the DirectShow AM_MEDIA_TYPE media type structure for the component.

IComponentType::Clone

IComponentType Interface

Creates a new copy of this component type.

Syntax

HRESULT Clone(
    IComponentType** NewCT
    );

Parameters

NewCT
[out, retval] Address of the IComponentType interface pointer that will be set to the returned interface.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::get_Category

IComponentType Interface

Retrieves the component category.

Syntax

HRESULT get_Category(
    ComponentCategory* Category
    );

Parameters

Category
[out, retval] Pointer to a ComponentCategory datatype that will receive the category.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

The ComponentCategory enum is defined in bdatypes.h as follows:
typedef enum ComponentCategory
{
    CategoryNotSet = -1,
    CategoryOther = 0,
    CategoryVideo = 1,
    CategoryAudio = 2,
    CategoryText = 3,
    CategoryData = 4,
} ComponentCategory;

IComponentType::get_MediaFormatType

IComponentType Interface

Retrieves the DirectShow media format type as a BSTR.

Syntax

HRESULT get_MediaFormatType(
    BSTR* MediaFormatType
    );

Parameters

MediaFormatType
[out, retval] Pointer to a BSTR that will receive the GUID.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::get__MediaFormatType

IComponentType Interface

Retrieves the DirectShow media format type as a GUID.

Syntax

HRESULT get__MediaFormatType(
    GUID *MediaFormatType
    );

Parameters

MediaFormatType
[out, retval] Pointer to a GUID that will receive the format type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

This method is available through C++ only. Note the two underscores in the method name as compared to the one underscore for the method that uses a BSTR as a parameter.

IComponentType::get_MediaMajorType

IComponentType Interface

Retrieves the DirectShow media major type as a BSTR.

Syntax

HRESULT get_MediaMajorType(
    BSTR* MediaMajorType
    );

Parameters

MediaMajorType
[out, retval] Pointer to a BSTR that will receive the GUID.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::get__MediaMajorType

IComponentType Interface

Retrieves the DirectShow media format type as a GUID.

Syntax

HRESULT get__MediaMajorType(
    GUID *MediaMajorType
    );

Parameters

MediaMajorType
[out, retval] Pointer to a GUID that will receive the major type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

This method is available through C++ only. Note the two underscores in the method name as compared to the one underscore for the method that uses a BSTR as a parameter.

IComponentType::get_MediaSubType

IComponentType Interface

Retrieves the DirectShow media subtype as a BSTR.

Syntax

HRESULT get_MediaSubType(
    BSTR* MediaSubType
    );

Parameters

MediaSubType
[out, retval] Pointer to a BSTR that will receive the GUID.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::get__MediaSubType

IComponentType Interface

Retrieves the DirectShow media subtype as a GUID.

Syntax

HRESULT get__MediaSubType(
    GUID *MediaSubType
    );

Parameters

MediaSubType
[out, retval] Pointer to a GUID that will receive the major type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

This method is available through C++ only. Note the two underscores in the method name as compared to the one underscore for the method that uses a BSTR as a parameter.

IComponentType::get_MediaType

IComponentType Interface

Retrieves the DirectShow AM_MEDIA_TYPE media type structure for the component.

Syntax

HRESULT get_MediaType(
    AM_MEDIA_TYPE* MediaType
    );

Parameters

MediaType
[out, retval] Pointer to an AM_MEDIA_TYPE structure that will be filled in with the values associated with the current ComponentType.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::put_Category

IComponentType Interface

Sets the component category.

Syntax

HRESULT put_Category(
    ComponentCategory Category
    );

Parameters

Category
[in] A ComponentCategory value that specifies the new category for this component type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

The ComponentCategory enum is defined in bdatypes.h as follows:
typedef enum ComponentCategory
{
    CategoryNotSet = -1,
    CategoryOther = 0,
    CategoryVideo = 1,
    CategoryAudio = 2,
    CategoryText = 3,
    CategoryData = 4,
} ComponentCategory;

IComponentType::put_MediaFormatType

IComponentType Interface

Sets the DirectShow media format type.

Syntax

HRESULT put_MediaFormatType(
    BSTR MediaFormatType
    );

Parameters

MediaFormatType
[in] BSTR that specifies the GUID.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::put__MediaFormatType

IComponentType Interface

Sets the DirectShow media format type.

Syntax

HRESULT put__MediaFormatType(
    REFCLSID MediaFormatType
    );

Parameters

MediaFormatType
[in] REFCLSID that specifies the media format type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

This method is available through C++ only. Note the two underscores in the method name as compared to the one underscore for the method that uses a BSTR as a parameter.

IComponentType::put_MediaMajorType

IComponentType Interface

Sets the DirectShow media major type.

Syntax

HRESULT put_MediaMajorType(
    BSTR MediaMajorType
    );

Parameters

MediaMajorType
[in] BSTR that specifies the GUID.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::put__MediaMajorType

IComponentType Interface

Sets the DirectShow media major type.

Syntax

HRESULT put__MediaMajorType(
    REFCLSID MediaMajorType
    );

Parameters

MediaMajorType
[in] REFCLSID that specifies the media major type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

This method is available through C++ only. Note the two underscores in the method name as compared to the one underscore for the method that uses a BSTR as a parameter.

IComponentType::put_MediaSubType

IComponentType Interface

Sets the DirectShow media subtype.

Syntax

HRESULT put_MediaSubType(
    BSTR MediaSubType
    );

Parameters

MediaSubType
[in] BSTR that specifies the GUID.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

IComponentType::put__MediaSubType

IComponentType Interface

Sets the DirectShow media subtype.

Syntax

HRESULT put__MediaSubType(
    REFCLSID MediaSubType
    );

Parameters

MediaSubType
[in] REFCLSID that specifies the media sub type.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.

Remarks

This method is available through C++ only. Note the two underscores in the method name as compared to the one underscore for the method that uses a BSTR as a parameter.

IComponentType::put_MediaType

IComponentType Interface

Sets the DirectShow AM_MEDIA_TYPE media type structure for the component.

Syntax

HRESULT put_MediaType(
    AM_MEDIA_TYPE MediaType
    );

Parameters

MediaType
[in] AM_MEDIA_TYPE structure that specifies the major type, subtype, format, etc.

Return Value

Returns S_OK if successful. If the method fails, error information can be retrieved using the standard COM IErrorInfo interface.