[與此頁面相關聯的功能,DirectShow是舊版功能。 它已被 MediaPlayer、IMFMediaEngine,以及在 Media Foundation 的音訊/視訊擷取取代。 這些功能已針對 Windows 10 和 Windows 11 進行優化。 Microsoft強烈建議新程式代碼盡可能在媒體 基礎中使用 MediaPlayer、IMFMediaEngine 和 音訊/視訊擷取,而不是 DirectShow。 Microsoft建議使用舊版 API 的現有程式代碼,盡可能改寫成使用新的 API。]
如果您的篩選具有使用篩選資源的自定義配置器,配置器的 IMemAllocator::GetBuffer 方法應該會保留串流鎖定,如同其他串流方法一樣:
HRESULT CMyInputAllocator::GetBuffer(
IMediaSample **ppBuffer,
REFERENCE_TIME *pStartTime,
REFERENCE_TIME *pEndTime,
DWORD dwFlags)
{
CAutoLock cObjectLock(&m_csReceive);
/* Use resources. */
return CMemAllocator::GetBuffer(ppBuffer, pStartTime, pEndTime, dwFlags);
}
相關主題