Partager via


IDMOVideoOutputOptimizations Interface

The IDMOVideoOutputOptimizations interface supports video optimizations on a Microsoft DirectX Media Object (DMO).

This interface enables an application to negotiate with a DMO about video output optimizations. A DMO exposes this interface when it can perform optimizations that require support from the application. The application can query the DMO for its preferred features, and then agree (or not agree) to provide them. The DMO must process output even if the application rejects the optimizations.

For example, a video decoder might generate an output frame by applying deltas to the previous output frame. When queried, it requests that the application supply the previous frame in the output buffer. The application can agree to this request or not.

Video optimizations are negotiated separately for each output stream.

The following pseudo-code shows how an application might negotiate with the DMO:

IDMOVideoOutputOptimizations *pVidOpt;
// Query the DMO for IDMOVideoOutputOptimizations (not shown).

BOOL  bWantsPreviousBuffer = FALSE;
DWORD wFlags;
pVidOpt->QueryOperationModePreferences(0,&dwFlags);

if (dwFlags & DMO_VOSF_NEEDS_PREVIOUS_SAMPLE) 
{
    // Agree to the request.      
    pVidOpt->SetOperationMode(0, DMO_VOSF_NEEDS_PREVIOUS_SAMPLE);
    bWantsPreviousBuffer = TRUE;
}

// Processing loop
while (there is input).
{
    ProcessInput(0, ...);
    if (bWantsPreviousBuffer)
        pDMO->ProcessOutput(0, ...) // Use the same buffer as last time.
    else
        pDMO->ProcessOutput(0, ...) // OK to use a new buffer.
}

In addition to the methods inherited from IUnknown, the IDMOVideoOutputOptimizations interface exposes the following methods.

Method Description
GetCurrentOperationMode Retrieves the optimization features in effect.
GetCurrentSampleRequirements Retrieves the optimization features required to process the next sample, given the features already agreed to by the application.
QueryOperationModePreferences Retrieves the DMO's preferred optimization features.
SetOperationMode Notifies the DMO of the optimization features in effect.

Requirements

Requirements

  Header: Declared in Mediaobj.h; include Dmo.h
  Library: Dmoguids.lib.

© 2004 Microsoft Corporation. All rights reserved.