亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? amfilter.cpp

?? 用DirectX制作高級動畫-[Advanced.Animation.with.DirectX]
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
        if (i == (int)m_bTryMyTypesFirst) {
            hr = pReceivePin->EnumMediaTypes(&pEnumMediaTypes);
        } else {
            hr = EnumMediaTypes(&pEnumMediaTypes);
        }
        if (SUCCEEDED(hr)) {
            ASSERT(pEnumMediaTypes);
            hr = TryMediaTypes(pReceivePin,pmt,pEnumMediaTypes);
            pEnumMediaTypes->Release();
            if (SUCCEEDED(hr)) {
                return NOERROR;
            } else {
                // try to remember specific error codes if there are any
                if ((hr != E_FAIL) &&
                    (hr != E_INVALIDARG) &&
                    (hr != VFW_E_TYPE_NOT_ACCEPTED)) {
                    hrFailure = hr;
                }
            }
        }
    }

    return hrFailure;
}


/* Called when we want to complete a connection to another filter. Failing
   this will also fail the connection and disconnect the other pin as well */

HRESULT
CBasePin::CompleteConnect(IPin *pReceivePin)
{
    UNREFERENCED_PARAMETER(pReceivePin);
    return NOERROR;
}


/* This is called to set the format for a pin connection - CheckMediaType
   will have been called to check the connection format and if it didn't
   return an error code then this (virtual) function will be invoked */

HRESULT
CBasePin::SetMediaType(const CMediaType *pmt)
{
    HRESULT hr = m_mt.Set(*pmt);
    if (FAILED(hr)) {
        return hr;
    }

    return NOERROR;
}


/* This is called during Connect() to provide a virtual method that can do
   any specific check needed for connection such as QueryInterface. This
   base class method just checks that the pin directions don't match */

HRESULT
CBasePin::CheckConnect(IPin * pPin)
{
    /* Check that pin directions DONT match */

    PIN_DIRECTION pd;
    pPin->QueryDirection(&pd);

    ASSERT((pd == PINDIR_OUTPUT) || (pd == PINDIR_INPUT));
    ASSERT((m_dir == PINDIR_OUTPUT) || (m_dir == PINDIR_INPUT));

    // we should allow for non-input and non-output connections?
    if (pd == m_dir) {
        return VFW_E_INVALID_DIRECTION;
    }
    return NOERROR;
}


/* This is called when we realise we can't make a connection to the pin and
   must undo anything we did in CheckConnect - override to release QIs done */

HRESULT
CBasePin::BreakConnect()
{
    return NOERROR;
}


/* Called normally by an output pin on an input pin to try and establish a
   connection.
*/

STDMETHODIMP
CBasePin::ReceiveConnection(
    IPin * pConnector,      // this is the pin who we will connect to
    const AM_MEDIA_TYPE *pmt    // this is the media type we will exchange
)
{
    CheckPointer(pConnector,E_POINTER);
    CheckPointer(pmt,E_POINTER);
    ValidateReadPtr(pConnector,sizeof(IPin));
    ValidateReadPtr(pmt,sizeof(AM_MEDIA_TYPE));
    CAutoLock cObjectLock(m_pLock);

    /* Are we already connected */
    if (m_Connected) {
        return VFW_E_ALREADY_CONNECTED;
    }

    /* See if the filter is active */
    if (!IsStopped() && !m_bCanReconnectWhenActive) {
        return VFW_E_NOT_STOPPED;
    }

    HRESULT hr = CheckConnect(pConnector);
    if (FAILED(hr)) {
        // Since the procedure is already returning an error code, there
        // is nothing else this function can do to report the error.
        EXECUTE_ASSERT( SUCCEEDED( BreakConnect() ) );


        return hr;
    }

    /* Ask derived class if this media type is ok */

    CMediaType * pcmt = (CMediaType*) pmt;
    hr = CheckMediaType(pcmt);
    if (hr != NOERROR) {
        // no -we don't support this media type

        // Since the procedure is already returning an error code, there
        // is nothing else this function can do to report the error.
        EXECUTE_ASSERT( SUCCEEDED( BreakConnect() ) );

        // return a specific media type error if there is one
        // or map a general failure code to something more helpful
        // (in particular S_FALSE gets changed to an error code)
        if (SUCCEEDED(hr) ||
            (hr == E_FAIL) ||
            (hr == E_INVALIDARG)) {
            hr = VFW_E_TYPE_NOT_ACCEPTED;
        }


        return hr;
    }

    /* Complete the connection */

    m_Connected = pConnector;
    m_Connected->AddRef();
    hr = SetMediaType(pcmt);
    if (SUCCEEDED(hr)) {
        hr = CompleteConnect(pConnector);
        if (SUCCEEDED(hr)) {


            return NOERROR;
        }
    }

    DbgLog((LOG_TRACE, CONNECT_TRACE_LEVEL, TEXT("Failed to set the media type or failed to complete the connection.")));
    m_Connected->Release();
    m_Connected = NULL;

    // Since the procedure is already returning an error code, there
    // is nothing else this function can do to report the error.
    EXECUTE_ASSERT( SUCCEEDED( BreakConnect() ) );


    return hr;
}


/* Called when we want to terminate a pin connection */

STDMETHODIMP
CBasePin::Disconnect()
{
    CAutoLock cObjectLock(m_pLock);

    /* See if the filter is active */
    if (!IsStopped()) {
        return VFW_E_NOT_STOPPED;
    }

    return DisconnectInternal();
}

STDMETHODIMP
CBasePin::DisconnectInternal()
{
    ASSERT(CritCheckIn(m_pLock));

    if (m_Connected) {
        HRESULT hr = BreakConnect();
        if( FAILED( hr ) ) {


            // There is usually a bug in the program if BreakConnect() fails.
            DbgBreak( "WARNING: BreakConnect() failed in CBasePin::Disconnect()." );
            return hr;
        }

        m_Connected->Release();
        m_Connected = NULL;


        return S_OK;
    } else {
        // no connection - not an error


        return S_FALSE;
    }
}


/* Return an AddRef()'d pointer to the connected pin if there is one */
STDMETHODIMP
CBasePin::ConnectedTo(
    IPin **ppPin
)
{
    CheckPointer(ppPin,E_POINTER);
    ValidateReadWritePtr(ppPin,sizeof(IPin *));
    //
    //  It's pointless to lock here.
    //  The caller should ensure integrity.
    //

    IPin *pPin = m_Connected;
    *ppPin = pPin;
    if (pPin != NULL) {
        pPin->AddRef();
        return S_OK;
    } else {
        ASSERT(*ppPin == NULL);
        return VFW_E_NOT_CONNECTED;
    }
}

/* Return the media type of the connection */
STDMETHODIMP
CBasePin::ConnectionMediaType(
    AM_MEDIA_TYPE *pmt
)
{
    CheckPointer(pmt,E_POINTER);
    ValidateReadWritePtr(pmt,sizeof(AM_MEDIA_TYPE));
    CAutoLock cObjectLock(m_pLock);

    /*  Copy constructor of m_mt allocates the memory */
    if (IsConnected()) {
        CopyMediaType( pmt, &m_mt );
        return S_OK;
    } else {
        ((CMediaType *)pmt)->InitMediaType();
        return VFW_E_NOT_CONNECTED;
    }
}

/* Return information about the filter we are connect to */

STDMETHODIMP
CBasePin::QueryPinInfo(
    PIN_INFO * pInfo
)
{
    CheckPointer(pInfo,E_POINTER);
    ValidateReadWritePtr(pInfo,sizeof(PIN_INFO));

    pInfo->pFilter = m_pFilter;
    if (m_pFilter) {
        m_pFilter->AddRef();
    }

    if (m_pName) {
        lstrcpynW(pInfo->achName, m_pName, sizeof(pInfo->achName)/sizeof(WCHAR));
    } else {
        pInfo->achName[0] = L'\0';
    }

    pInfo->dir = m_dir;

    return NOERROR;
}

STDMETHODIMP
CBasePin::QueryDirection(
    PIN_DIRECTION * pPinDir
)
{
    CheckPointer(pPinDir,E_POINTER);
    ValidateReadWritePtr(pPinDir,sizeof(PIN_DIRECTION));

    *pPinDir = m_dir;
    return NOERROR;
}

// Default QueryId to return the pin's name
STDMETHODIMP
CBasePin::QueryId(
    LPWSTR * Id
)
{
    //  We're not going away because someone's got a pointer to us
    //  so there's no need to lock

    return AMGetWideString(Name(), Id);
}

/* Does this pin support this media type WARNING this interface function does
   not lock the main object as it is meant to be asynchronous by nature - if
   the media types you support depend on some internal state that is updated
   dynamically then you will need to implement locking in a derived class */

STDMETHODIMP
CBasePin::QueryAccept(
    const AM_MEDIA_TYPE *pmt
)
{
    CheckPointer(pmt,E_POINTER);
    ValidateReadPtr(pmt,sizeof(AM_MEDIA_TYPE));

    /* The CheckMediaType method is valid to return error codes if the media
       type is horrible, an example might be E_INVALIDARG. What we do here
       is map all the error codes into either S_OK or S_FALSE regardless */

    HRESULT hr = CheckMediaType((CMediaType*)pmt);
    if (FAILED(hr)) {
        return S_FALSE;
    }
    // note that the only defined success codes should be S_OK and S_FALSE...
    return hr;
}


/* This can be called to return an enumerator for the pin's list of preferred
   media types. An input pin is not obliged to have any preferred formats
   although it can do. For example, the window renderer has a preferred type
   which describes a video image that matches the current window size. All
   output pins should expose at least one preferred format otherwise it is
   possible that neither pin has any types and so no connection is possible */

STDMETHODIMP
CBasePin::EnumMediaTypes(
    IEnumMediaTypes **ppEnum
)
{
    CheckPointer(ppEnum,E_POINTER);
    ValidateReadWritePtr(ppEnum,sizeof(IEnumMediaTypes *));

    /* Create a new ref counted enumerator */

    *ppEnum = new CEnumMediaTypes(this,
                              NULL);

    if (*ppEnum == NULL) {
        return E_OUTOFMEMORY;
    }

    return NOERROR;
}



/* This is a virtual function that returns a media type corresponding with
   place iPosition in the list. This base class simply returns an error as
   we support no media types by default but derived classes should override */

HRESULT CBasePin::GetMediaType(int iPosition, CMediaType *pMediaType)
{
    UNREFERENCED_PARAMETER(iPosition);
    UNREFERENCED_PARAMETER(pMediaType);
    return E_UNEXPECTED;
}


/* This is a virtual function that returns the current media type version.
   The base class initialises the media type enumerators with the value 1
   By default we always returns that same value. A Derived class may change
   the list of media types available and after doing so it should increment
   the version either in a method derived from this, or more simply by just
   incrementing the m_TypeVersion base pin variable. The type enumerators
   call this when they want to see if their enumerations are out of date */

LONG CBasePin::GetMediaTypeVersion()
{
    return m_TypeVersion;
}


/* Increment the cookie representing the current media type version */

void CBasePin::IncrementTypeVersion()
{
    InterlockedIncrement(&m_TypeVersion);
}


/* Called by IMediaFilter implementation when the state changes from Stopped
   to either paused or running and in derived classes could do things like
   commit memory and grab hardware resource (the default is to do nothing) */

HRESULT
CBasePin::Active(void)
{
    return NOERROR;
}

/* Called by IMediaFilter implementation when the state changes from
   to either paused to running and in derived classes could do things like
   commit memory and grab hardware resource (the default is to do nothing) */

HRESULT
CBasePin::Run(REFERENCE_TIME tStart)
{
    UNREFERENCED_PARAMETER(tStart);
    return NOERROR;
}


/* Also called by the IMediaFilter implementation when the state changes to
   Stopped at which point you should decommit allocators and free hardware
   resources you grabbed in the Active call (default is also to do nothing) */

HRESULT
CBasePin::Inactive(void)
{
    m_bRunTimeError = FALSE;
    return NOERROR;
}


// Called when no more data will arrive
STDMETHODIMP
CBasePin::EndOfStream(void)
{
    return S_OK;
}


STDMETHODIMP
CBasePin::SetSink(IQualityControl * piqc)
{
    CAutoLock cObjectLock(m_pLock);
    if (piqc) ValidateReadPtr(piqc,sizeof(IQualityControl));
    m_pQSink = piqc;
    return NOERROR;
} // SetSink


STDMETHODIMP
CBasePin::Notify(IBaseFilter * pSender, Quality q)
{
    UNREFERENCED_PARAMETER(q);
    UNREFERENCED_PARAMETER(pSender);
    DbgBreak("IQualityControl::Notify not over-ridden from CBasePin.  (IGNORE is OK)");
    return E_NOTIMPL;
} //Notify


// NewSegment notifies of the start/stop/rate applying to the data
// about to be received. Default implementation records data and
// returns S_OK.
// Override this to pass downstream.
STDMETHODIMP
CBasePin::NewSegment(
 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
777色狠狠一区二区三区| 日本韩国一区二区| 亚洲色图19p| 久久综合国产精品| 欧美一级黄色大片| 欧美日本在线观看| 欧美日韩aaaaa| 中文字幕制服丝袜一区二区三区| 国产日韩欧美一区二区三区乱码 | 国产欧美日韩不卡免费| 亚洲永久免费av| 亚洲精品欧美专区| 亚洲午夜在线视频| 天天色综合成人网| 精品一区二区三区久久久| 久久99热99| 成人一区二区三区| 91美女在线视频| 在线影院国内精品| 国产精品国产三级国产普通话三级 | 成人免费av资源| 精品88久久久久88久久久| 精品日产卡一卡二卡麻豆| 久久综合丝袜日本网| 日本中文在线一区| 国产一区激情在线| 大尺度一区二区| 欧美成人精品高清在线播放| 日本欧美一区二区三区| 欧美怡红院视频| 精品国产青草久久久久福利| 人人狠狠综合久久亚洲| 成人在线视频首页| 国产精品色哟哟网站| 午夜精品久久久久久久99水蜜桃 | 国产成人啪免费观看软件| 色狠狠av一区二区三区| 一区二区三区在线视频观看58| 美女被吸乳得到大胸91| 波多野结衣精品在线| 欧美男男青年gay1069videost | 中文成人av在线| 国产乱人伦偷精品视频免下载| www.日韩精品| 亚洲精品一卡二卡| 91国产成人在线| 五月天一区二区| 欧美一区二区三区视频在线 | 亚洲久草在线视频| 在线看国产一区| 国产精品日产欧美久久久久| av电影在线观看不卡| 一区二区三区高清| 欧美日韩久久不卡| 精品一区二区在线免费观看| 国产欧美日韩在线| 日本道色综合久久| 日韩 欧美一区二区三区| www国产精品av| www.亚洲在线| 午夜精品久久久久影视| 精品久久久久久无| 97精品视频在线观看自产线路二| 久久久久久久国产精品影院| 日韩电影在线观看一区| 久久久www免费人成精品| 99在线精品观看| 五月天激情综合| 欧美精品一区二区在线播放| 99久久er热在这里只有精品15| 亚洲午夜在线电影| 久久尤物电影视频在线观看| 91蜜桃视频在线| 久久国产尿小便嘘嘘| 国产精品久久三| 国产精品视频免费| 欧美视频一区二区三区在线观看 | 欧美不卡视频一区| 在线免费观看成人短视频| 久久99久国产精品黄毛片色诱| **网站欧美大片在线观看| 成人福利视频网站| 中文字幕国产一区| 成人丝袜18视频在线观看| 婷婷久久综合九色国产成人| 中文字幕久久午夜不卡| 欧美一区二视频| 一本一道久久a久久精品| 亚洲美女免费视频| 欧美性极品少妇| 成人激情图片网| 麻豆精品视频在线观看免费| 亚洲精品国产精华液| 国产女人水真多18毛片18精品视频| 欧美日韩一区二区三区不卡| 免费在线观看一区二区三区| 综合久久综合久久| 国产日韩欧美a| 日韩写真欧美这视频| 欧美日韩午夜精品| 日本电影欧美片| 91蜜桃传媒精品久久久一区二区| 国产丶欧美丶日本不卡视频| 美美哒免费高清在线观看视频一区二区| 亚洲一区日韩精品中文字幕| 亚洲欧美在线视频观看| 日本一二三不卡| 久久九九久久九九| 日本道色综合久久| caoporm超碰国产精品| 555夜色666亚洲国产免| 欧美影视一区二区三区| 色婷婷激情久久| 日本久久精品电影| 在线看一区二区| 在线精品视频小说1| 色88888久久久久久影院按摩 | 中文字幕一区二区在线观看| 欧美激情中文不卡| 中文字幕av不卡| 国产精品你懂的| 国产精品成人免费| 亚洲欧美一区二区三区久本道91 | 欧美男生操女生| 在线成人免费观看| 成人小视频免费在线观看| 国产一区久久久| 不卡电影一区二区三区| 成人黄色国产精品网站大全在线免费观看| 国产乱码一区二区三区| 国产91精品久久久久久久网曝门| 午夜视频一区在线观看| 视频一区中文字幕| 日韩一区欧美一区| 亚洲激情欧美激情| 手机精品视频在线观看| 麻豆精品一区二区| 国产一区二区导航在线播放| 成人性生交大片免费看视频在线| 色综合久久综合网97色综合| 欧美日韩一区二区不卡| 日韩你懂的在线观看| 在线观看免费视频综合| 欧美久久久久久久久久| 久久久久综合网| 亚洲欧美国产高清| 美女一区二区视频| 国产成人av网站| 91福利视频网站| 日韩视频在线观看一区二区| 国产网站一区二区| 亚洲国产美女搞黄色| 精品一区中文字幕| 色综合一个色综合| 成人做爰69片免费看网站| 色综合久久中文字幕| 欧美一级免费大片| 国产精品麻豆网站| 视频一区视频二区在线观看| 国产成人在线视频免费播放| 欧美日韩精品欧美日韩精品| 久久久久久99久久久精品网站| 亚洲精选一二三| 久久国产生活片100| 精品国产三级a在线观看| 亚洲乱码日产精品bd| 国产美女视频一区| 欧美日韩二区三区| 亚洲欧美一区二区在线观看| 精品一区二区免费在线观看| 日本久久一区二区三区| 久久九九全国免费| 久久国产福利国产秒拍| 欧美亚一区二区| 成人免费一区二区三区在线观看| 久久99深爱久久99精品| 欧美日韩成人在线| 中文字幕在线观看一区二区| 国产一区二区影院| 91精品国产乱| 午夜a成v人精品| 在线看不卡av| 最新中文字幕一区二区三区| 国产不卡在线视频| 精品国产区一区| 久久国产精品无码网站| 欧美日本一道本在线视频| 亚洲精品高清视频在线观看| 成人av综合一区| 国产日本一区二区| 国产精品一区在线| 26uuu国产电影一区二区| 日产国产高清一区二区三区| 欧美日韩精品一二三区| 亚洲综合激情网| 欧美三级日韩三级国产三级| 亚洲综合久久久| 在线观看视频一区| 亚洲国产婷婷综合在线精品| 欧美亚洲一区二区在线观看|