次の方法で共有


IMediaObject::GetInputCurrentType method (mediaobj.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The GetInputCurrentType method retrieves the media type that was set for an input stream, if any.

Syntax

HRESULT GetInputCurrentType(
        DWORD          dwInputStreamIndex,
  [out] DMO_MEDIA_TYPE *pmt
);

Parameters

dwInputStreamIndex

Zero-based index of an input stream on the DMO.

[out] pmt

Pointer to a DMO_MEDIA_TYPE structure allocated by the caller. The method fills the structure with the media type.

Return value

Returns an HRESULT value. Possible values include those in the following table.

Return code Description
DMO_E_INVALIDSTREAMINDEX
Invalid stream index.
DMO_E_TYPE_NOT_SET
Media type was not set.
E_OUTOFMEMORY
Insufficient memory.
S_OK
Success.

Remarks

The caller must set the media type for the stream before calling this method. To set the media type, call the IMediaObject::SetInputType method.

If the method succeeds, call MoFreeMediaType to free the format block.

Requirements

Requirement Value
Target Platform Windows
Header mediaobj.h (include Dmo.h)
Library Dmoguids.lib

See also

IMediaObject Interface