Ler em inglês

Compartilhar via


About IMediaObject

The IMediaObject interface is the required interface for DMOs. IMediaObject contains the methods that a Windows Media Player rendering plug-in uses to get data from the Player. For complete documentation of the IMediaObject interface, see the DirectX SDK.

The methods of IMediaObject can be categorized as follows:

Methods that Handle Format Negotiation

These are the methods that Windows Media Player calls to get information about the data formats supported by the plug-in. These methods include:

  • GetInputMaxLatency
  • GetInputSizeInfo
  • GetInputStreamInfo
  • GetInputType
  • GetOutputSizeInfo
  • GetOutputStreamInfo
  • GetStreamCount
  • SetInputMaxLatency
  • SetInputType
  • SetOutputType

Of these methods, only SetInputType is called for rendering plug-ins.

Methods that Specify or Retrieve State Information

These are the methods that a DMO client calls to get or set values related to the current state of the plug-in. These methods include:

  • GetInputCurrentType
  • GetInputStatus
  • GetOutputCurrentType

Windows Media Player doesn't call these methods for rendering plug-ins.

Methods that Handle Buffering and Processing Data

These are the methods that Windows Media Player calls to initiate the various processes that the plug-in performs to do the digital signal processing. These methods include:

  • AllocateStreamingResources
  • Discontinuity
  • Flush
  • FreeStreamingResources
  • Lock
  • ProcessInput
  • ProcessOutput

Windows Media Player calls AllocateStreamingResources and FreeStreamingResources to provide the rendering plug-in with an opportunity to set up or release any additional buffers the plug-in may require for internal processing.

Windows Media Player may call Discontinuity at any time to indicate an interruption in the stream. Rendering plug-ins can simply return S_OK.

Windows Media Player calls Flush to direct the rendering plug-in to flush all internally buffered data. The plug-in should release any references to IMediaBuffer interfaces, clear any values that specify the time stamp or sample length for the media buffer, and reinitialize any internal states that depend upon the contents of the media sample.

Windows Media Player calls ProcessInput to pass a pointer to an IMediaBuffer interface to the rendering plug-in. This interface provides access to the input buffer allocated by Windows Media Player to supply data to the plug-in.

The IMediaObject interface includes a method named Lock. This method is designed to acquire or release a lock on the DMO to keep the DMO serialized when performing multiple operations. The version of IMediaObject::Lock in the wizard code overrides the ATL implementation of Lock. Because the sample code is apartment threaded, the implementation of Lock simply returns S_OK. For details about how to create a multithreaded DMO, refer to the DirectX SDK.

Required Interfaces (deprecated)