audio/sysvad/APO/SwapAPO/swapapomfx.cpp
STDMETHODIMP CSwapAPOMFX::LockForProcess(UINT32 u32NumInputConnections,
    APO_CONNECTION_DESCRIPTOR** ppInputConnections,  
    UINT32 u32NumOutputConnections, APO_CONNECTION_DESCRIPTOR** ppOutputConnections)
{
    ASSERT_NONREALTIME();
    HRESULT hr = S_OK;

    if (m_queueId != 0)
    {
        hr = SwapMFXApoAsyncCallback::Create(&m_asyncCallback, m_queueId);
        IF_FAILED_JUMP(hr, Exit);

        wil::com_ptr_nothrow<IRtwqAsyncResult> asyncResult;
        hr = RtwqCreateAsyncResult(static_cast<IAudioProcessingObject*>(this), m_asyncCallback.get(), nullptr, &asyncResult);
        IF_FAILED_JUMP(hr, Exit);

        hr = RtwqPutWorkItem(m_queueId, 0, asyncResult.get());
        IF_FAILED_JUMP(hr, Exit);
    }

    hr = CBaseAudioProcessingObject::LockForProcess(u32NumInputConnections,
        ppInputConnections, u32NumOutputConnections, ppOutputConnections);
    IF_FAILED_JUMP(hr, Exit);
    
Exit:
    return hr;
}
//-------------------------------------------------------------------------
// Description:
//
//  Verifies that the APO is ready to process and locks its state if so.
//
// Parameters:
//
//      u32NumInputConnections - [in] number of input connections attached to this APO
//      ppInputConnections - [in] connection descriptor of each input connection attached to this APO
//      u32NumOutputConnections - [in] number of output connections attached to this APO
//      ppOutputConnections - [in] connection descriptor of each output connection attached to this APO
//
// Return values:
//
//      S_OK                                Object is locked and ready to process.
//      E_POINTER                           Invalid pointer passed to function.
//      APOERR_INVALID_CONNECTION_FORMAT    Invalid connection format.
//      APOERR_NUM_CONNECTIONS_INVALID      Number of input or output connections is not valid on
//                                          this APO.

Verifies that the APO is ready to process and locks its state if so.



[in] number of input connections attached to this APO
ppInputConnections - [in] connection descriptor of each input connection attached to this APO
u32NumOutputConnections - [in] number of output connections attached to this APO
ppOutputConnections - [in] connection descriptor of each output connection attached to this APO

Return values.

S_OK                                Object is locked and ready to process.
E_POINTER                           Invalid pointer passed to function.
APOERR_INVALID_CONNECTION_FORMAT    Invalid connection format.
APOERR_NUM_CONNECTIONS_INVALID      Number of input or output connections is not valid on
this APO.
Verifies that the APO is ready to process and locks its state if so . [ in ] number of input connections attached to this APO ppInputConnections - [ in ] connection descriptor of each input connection attached to this APO u32NumOutputConnections - [ in ] number of output connections attached to this APO ppOutputConnections - [ in ] connection descriptor of each output connection attached to this APO Return values . S_OK Object is locked and ready to process . E_POINTER Invalid pointer passed to function . APOERR_INVALID_CONNECTION_FORMAT Invalid connection format . APOERR_NUM_CONNECTIONS_INVALID Number of input or output connections is not valid on this APO .
STDMETHODIMP CSwapAPOMFX::LockForProcess(UINT32 u32NumInputConnections,
    APO_CONNECTION_DESCRIPTOR** ppInputConnections,  
    UINT32 u32NumOutputConnections, APO_CONNECTION_DESCRIPTOR** ppOutputConnections)
{
    ASSERT_NONREALTIME();
    HRESULT hr = S_OK;
    if (m_queueId != 0)
    {
        hr = SwapMFXApoAsyncCallback::Create(&m_asyncCallback, m_queueId);
        IF_FAILED_JUMP(hr, Exit);
        wil::com_ptr_nothrow<IRtwqAsyncResult> asyncResult;
        hr = RtwqCreateAsyncResult(static_cast<IAudioProcessingObject*>(this), m_asyncCallback.get(), nullptr, &asyncResult);
        IF_FAILED_JUMP(hr, Exit);
        hr = RtwqPutWorkItem(m_queueId, 0, asyncResult.get());
        IF_FAILED_JUMP(hr, Exit);
    }
    hr = CBaseAudioProcessingObject::LockForProcess(u32NumInputConnections,
        ppInputConnections, u32NumOutputConnections, ppOutputConnections);
    IF_FAILED_JUMP(hr, Exit);
Exit:
    return hr;
}
STDMETHODIMP CSwapAPOMFX :: LockForProcess ( UINT32 u32NumInputConnections , APO_CONNECTION_DESCRIPTOR * * ppInputConnections , UINT32 u32NumOutputConnections , APO_CONNECTION_DESCRIPTOR * * ppOutputConnections ) { ASSERT_NONREALTIME ( ) ; HRESULT hr = S_OK ; if ( m_queueId != 0 ) { hr = SwapMFXApoAsyncCallback :: Create ( & m_asyncCallback , m_queueId ) ; IF_FAILED_JUMP ( hr , Exit ) ; wil :: com_ptr_nothrow < IRtwqAsyncResult > asyncResult ; hr = RtwqCreateAsyncResult ( static_cast < IAudioProcessingObject * > ( this ) , m_asyncCallback . get ( ) , nullptr , & asyncResult ) ; IF_FAILED_JUMP ( hr , Exit ) ; hr = RtwqPutWorkItem ( m_queueId , 0 , asyncResult . get ( ) ) ; IF_FAILED_JUMP ( hr , Exit ) ; } hr = CBaseAudioProcessingObject :: LockForProcess ( u32NumInputConnections , ppInputConnections , u32NumOutputConnections , ppOutputConnections ) ; IF_FAILED_JUMP ( hr , Exit ) ; Exit : return hr ; }
Description:
Verifies that the APO is ready to process and locks its state if so.
Description : Verifies that the APO is ready to process and locks its state if so .