Microsoft DirectX 8.0

IAMMediaTypeStream Interface

This interface contains methods for creating multimedia streams with arbitrary media types. Use this interface if you need to create a multimedia stream with a format that is not supported by the other Microsoft® DirectShow® multimedia streaming interfaces.

This interface inherits from the IMediaStream interface.

Note  For video streams, use the IDirectDrawMediaStream interface instead of this interface. For audio streams, use the IAudioMediaStream interface.

Methods in Vtable Order

IUnknown methodsDescription
QueryInterfaceRetrieves pointers to supported interfaces.
AddRef Increments the reference count.
Release Decrements the reference count.
IMediaStream methodsDescription
GetMultiMediaStreamRetrieves a pointer to the multimedia stream that contains the specified media stream.
GetInformationRetrieves the stream's purpose identifier (ID) and media type.
SetSameFormatSets the media stream to the same format as a previous stream.
AllocateSampleAllocates a new stream sample object for the current media stream.
CreateSharedSampleCreates a new stream sample that shares the same backing object as the existing sample.
SendEndOfStreamForces the current stream to end. If the current stream is not writable, calling this method has no effect.
IAMMediaTypeStream methodsDescription
GetFormatRetrieves the format of the stream.
SetFormatSets the format of the stream.
CreateSampleCreates a stream sample and optionally specifies the sample buffer.
GetStreamAllocatorRequirementsRetrieves the allocator requirements for the stream. This method is not currently implemented.
SetStreamAllocatorRequirementsSets the allocator requirements for the stream. This method is not currently implemented.

IAMMediaTypeStream::CreateSample

IAMMediaTypeStream Interface

Creates a stream sample and optionally specifies the sample buffer.

Syntax

HRESULT CreateSample(
    long lSampleSize,
    BYTE *pbBuffer,
    DWORD dwFlags,
    IUnknown *pUnkOuter,
    IAMMediaTypeSample **ppAMMediaTypeSample
);

Parameters

lSampleSize
[in] Size of the sample.
pbBuffer
[in] [optional] Pointer to an array of bytes that contains the sample data, or NULL.
dwFlags
[in] Reserved.
pUnkOuter
[in] [optional] Pointer to the interface of an object that aggregates the stream sample.
ppAMMediaTypeSample
[in] Address of an IAMMediaTypeSample interface pointer that receives a pointer to the created sample.

Return Value

Returns one of the following values.

E_OUTOFMEMORYInsufficient memory.
E_POINTER NULL pointer argument.
S_OKSuccess.

Remarks

If pUnkOuter is non-NULL, the new stream sample is aggregated into the specified object. Filters that receive the sample can then query it for interfaces supported by the aggregating object.

IAMMediaTypeStream::GetFormat

IAMMediaTypeStream Interface

Retrieves the format of the stream.

Syntax

HRESULT GetFormat(
    AM_MEDIA_TYPE *pMediaType,
    DWORD dwFlags
);

Parameters

pMediaType
[out] Pointer to an AM_MEDIA_TYPE structure that receives the stream format.
dwFlags
[in] Reserved.

Return Value

Returns one of the following values.

MS_E_NOSTREAMNo stream is associated with this object.
S_OKSuccess.

IAMMediaTypeStream::GetStreamAllocatorRequirements

IAMMediaTypeStream Interface

Retrieves the allocator requirements for the stream. This method is not currently implemented.

Syntax

HRESULT GetStreamAllocatorRequirements(
  ALLOCATOR_PROPERTIES *pProps
);

Parameters

pProps
[out] Pointer to an ALLOCATOR_PROPERTIES structure that receives the stream allocator requirements.

Return Value

Returns E_FAIL.

IAMMediaTypeStream::SetFormat

IAMMediaTypeStream Interface

Sets the format of the stream.

Syntax

HRESULT SetFormat(
    AM_MEDIA_TYPE *pMediaType,
    DWORD dwFlags
);

Parameters

pMediaType
[in] Pointer to an AM_MEDIA_TYPE structure that contains the stream format.
dwFlags
[in] Reserved.

Return Value

Returns one of the following values.

MS_E_SAMPLEALLOCThe stream has already allocated a sample with another media type.
S_OKSuccess.

IAMMediaTypeStream::SetStreamAllocatorRequirements

IAMMediaTypeStream Interface

Sets the allocator requirements for the stream. This method is not currently implemented.

Syntax

HRESULT SetStreamAllocatorRequirements(
  ALLOCATOR_PROPERTIES *pProps
);

Parameters

pProps
[in] Pointer to an ALLOCATOR_PROPERTIES structure that contains the stream allocator requirements.

Return Value

Returns E_FAIL.