0

プロジェクトで MediaFoundation dolby エンコーダーを使用しようとしています。出力タイプを初期化できますが、入力タイプの設定中に c00d6d60 エラー コードが表示されます

IMFMediaType* pInputMediaType = NULL;
    IMFMediaType *pOutputType = NULL;
    if (!m_pMFT)
    {
        return MF_E_NOT_INITIALIZED;
    }
    HRESULT hr = S_OK;
    DWORD pcInputStreams = 0;
    DWORD pcOutputStreams = 0;
    CHECK_HR(m_pMFT->GetStreamCount(&pcInputStreams,&pcOutputStreams));

assert(pcInputStreams==1 && pcInputStreams == pcOutputStreams);
hr = m_pMFT->GetStreamIDs(1, &m_dwInputID, 1, &m_dwOutputID);

if (hr == E_NOTIMPL)
{
    // The stream identifiers are zero-based.
    m_dwInputID = 0;
    m_dwOutputID = 0;
    hr = S_OK;
}
else if (FAILED(hr))
{
    goto done;
}

SafeRelease(&m_pOutputType);

CHECK_HR( MFCreateMediaType( &pOutputType ) );
CHECK_HR( pOutputType->SetGUID( MF_MT_MAJOR_TYPE, MFMediaType_Audio ) );  
CHECK_HR( pOutputType->SetGUID( MF_MT_SUBTYPE, MFAudioFormat_Dolby_AC3 ) );
CHECK_HR( pOutputType->SetUINT32( MF_MT_AUDIO_SAMPLES_PER_SECOND, inSamplePerSec ) );
CHECK_HR( pOutputType->SetUINT32( MF_MT_AUDIO_AVG_BYTES_PER_SECOND, inOutputAvgBytesPerSec ) );
CHECK_HR( pOutputType->SetUINT32( MF_MT_AUDIO_NUM_CHANNELS, inNumChannels ) );


LogMediaType(pOutputType);
hr = m_pMFT->SetOutputType(m_dwOutputID, pOutputType, 0);

if (SUCCEEDED(hr))
{
    m_pOutputType = pOutputType;
    m_pOutputType->AddRef();
}

CHECK_HR( MFCreateMediaType( &pInputMediaType ) );
CHECK_HR( pInputMediaType->SetGUID( MF_MT_MAJOR_TYPE, MFMediaType_Audio ) );
CHECK_HR( pInputMediaType->SetGUID( MF_MT_SUBTYPE, MFAudioFormat_PCM ) );  
CHECK_HR( pInputMediaType->SetUINT32( MF_MT_AUDIO_BITS_PER_SAMPLE, 16 ) );
CHECK_HR( pInputMediaType->SetUINT32( MF_MT_AUDIO_SAMPLES_PER_SECOND, inSamplePerSec ) );
CHECK_HR( pInputMediaType->SetUINT32( MF_MT_AUDIO_NUM_CHANNELS, inNumChannels ) );
//CHECK_HR( spMFTypeIn->SetUINT32( MF_MT_AUDIO_PREFER_WAVEFORMATEX, 1 ) );
CHECK_HR( pInputMediaType->SetUINT32( MF_MT_AUDIO_BLOCK_ALIGNMENT, inNumChannels*2 ) );
CHECK_HR( pInputMediaType->SetUINT32( MF_MT_AUDIO_AVG_BYTES_PER_SECOND, inNumChannels*2*inSamplePerSec) );
LogMediaType(pInputMediaType);
if (FAILED(hr))
{
    goto done;
}

hr = m_pMFT->SetInputType(m_dwInputID, pInputMediaType, 0);

私が使用しているガイドはhttp://msdn.microsoft.com/en-us/library/windows/desktop/hh447682%28v=vs.85%29.aspxです。いくつかの洞察を提供してください

4

1 に答える 1