TCC 89再生コードはLOGに対応

5304 ワード

Telechipsプラットフォームのオーディオ再生Filterを読み取り、テストし、WinCEの標準的なOverlayオーディオ再生プロセスを比較します.オーディオの再生手順については、次のように記録します.
(1) CheckCoCreateInstance(hr, CLSID_FilterGraph, IID_IGraphBuilder, (void **)&mpGraph, TEXT("CLSID_FilterGraph fail")); 
   : BOOL CFilterControl::CheckCoCreateInstance(HRESULT &hr, REFCLSID rclsid, REFIID riid, LPVOID* ppv, LPCTSTR pszErrorMessage)
    CoCreateInstance   : hr = ::CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, riid, ppv);
 : quartz.dll
 : mmtimer.dll
 : waveapic.dll

(2) hr = CoCreateInstance((REFCLSID)CLSID_AudioRender, NULL, CLSCTX_INPROC, (REFIID)IID_IBaseFilter, (void **)&m_pAudioRenderFilter);
    hr = mpGraph->AddFilter(m_pAudioRenderFilter,L"Audio Renderer");
    
    hr = mpGraph->AddFilter(m_pAudioOutputControlFilter,L"TCC Audio Output Control Filter");
 : TCCAudioOutputControlFilter.dll
 : TWS893x_200\Filters\TCCAudioOutputControlFilter\TCCAudioOutputControlFilter.cpp
  CFactoryTemplate g_Templates[] = 
  {
    {
      L"TCC Audio Output Control Filter",
      &CLSID_TCCAudioOutputControlFilter,
      CAudioOutputControlFilter::CreateInstance,      // Create a new instance of this class
      NULL,
      &sudTCCAudioOutputControlFilter
    },
  };

(3) hr = CoCreateInstance((REFCLSID)CLSID_TCCDEQ, NULL, CLSCTX_INPROC, (REFIID)IID_IBaseFilter, (void **)&m_pDEQFilter);
    // DEQ Filter Add
    if(SUCCEEDED(hr))
      hr = mpGraph->AddFilter(m_pDEQFilter,L"TCC DEQ Filter");
 : TCCDEQFilter.dll

(4) hr = mpGraph->RenderFile(FileName,NULL);
 : TCCCDKAudioDecFilter.dll
 : TCCCDKDemuxFilter.dll
[ CDK  DEMUX ] Audio Demuxer is MP3
========================================================
[ CDK  DEMUX ]Start Time        : 1999-10-29 07:21:08

[ CDK  DEMUX ]Demux Type        : AUDIO(8)
[ CDK  DEMUX ]Video Width       : 0
[ CDK  DEMUX ]Video Height      : 0
[ CDK  DEMUX ]Video Frame Rate  : 0.00
[ CDK  DEMUX ]Video BitRate     : Unknown
[ CDK  DEMUX ]Extra Data Length : 0
[ CDK  DEMUX ]Seekable          : Seekable
[ CDK  DEMUX ]AspectRatio       : 4 x 3
--------------------------------------------------------
[ CDK  DEMUX ]Audio Track Num    : 1
 [0]Audio nFormatId   : MP3(0x55)
 [0]Avg Bytes Per Sec : 16000
 [0]Bits Per Sample   : 16
 [0]Block Align       : 0
 [0]nChannels         : 2
 [0]SamplePerSec      : 44100
 [0]nExtraDataLength  : 0
--------------------------------------------------------
[ CDK  DEMUX ]Total Subtitle Num   : 0
[ CDK  DEMUX ]Current Subtitle Num : 0
========================================================
[ CDK  AUDIO ][CCDKAudioDecFilter::CheckInputType,1180] AUDIO_ID_MP3 
--------------------------------------------------------
[ CDK  DEMUX ]Audio Stream ID                : Audio0
[ CDK  DEMUX ]Audio Ouptut Buffer Num        : 128
[ CDK  DEMUX ]Audio Ouptut 1 Buffer Size     : 32[Kbytes]
[ CDK  DEMUX ]Audio Ouptut Buffer total Size : 4[Mbytes]
--------------------------------------------------------
--------------------------------------------------------
[ CDK  AUDIO ]Audio Ouptut Buffer Num        : 16
[ CDK  AUDIO ]Audio Ouptut 1 Buffer Size     : 512[Kbytes]
[ CDK  AUDIO ]Audio Ouptut Buffer total Size : 8[Mbytes]
--------------------------------------------------------
--------------------------------------------------------
[ CDK  AUDIO ]Audio Ouptut Buffer Num        : 16
[ CDK  AUDIO ]Audio Ouptut 1 Buffer Size     : 512[Kbytes]
[ CDK  AUDIO ]Audio Ouptut Buffer total Size : 8[Mbytes]
--------------------------------------------------------

(5) HRESULT hr = mpGraph->QueryInterface(IID_IMediaControl, (void **)&p_mc);
   if (hr == S_OK)
   {
    hr = p_mc->Run();
    mIsRunning = TRUE;
    if (FAILED(hr))
      printf("Fail : RunGraph(ret=0x%x)\r
", hr); // Leo mIsRunning ? SAFE_RELEASE(p_mc); } [ CDK DEMUX ]CDK Audio DMX Seek Time : 0 ======================================================== [ CDK DEMUX ]Seek Position : 0(00:00:00) [ CDK DEMUX ]Real Position : 0(00:00:00) [ CDK DEMUX ]Seek duration : 3[ms] ======================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DirectShow IGraphBuilder *m_pGB; IMediaControl *m_pMC; IMediaEventEx *m_pME; IBasicAudio *m_pBA; IMediaSeeking *m_pMS; // Initialize COM if(CoInitializeEx(NULL,COINIT_MULTITHREADED) != S_OK) { goto END; } // Get the interface for DirectShow's GraphBuilder if(CoCreateInstance(CLSID_FilterGraph,NULL,CLSCTX_INPROC_SERVER,IID_IGraphBuilder,(void **)&m_pGB) != S_OK) { goto END; } // Have the graph construct its the appropriate graph automatically if(m_pGB->RenderFile(m_szFileName, NULL) != NOERROR) { goto END; } // QueryInterface for DirectShow interfaces if(m_pGB->QueryInterface(IID_IMediaControl, (void **)&m_pMC) != NOERROR) { goto END; } if(m_pGB->QueryInterface(IID_IMediaEventEx, (void **)&m_pME) != NOERROR) { goto END; } if(m_pGB->QueryInterface(IID_IMediaSeeking, (void **)&m_pMS) != NOERROR) { goto END; } // Query for audio interfaces, which may not be relevant for video-only files if(m_pGB->QueryInterface(IID_IBasicAudio, (void **)&m_pBA) != NOERROR) { goto END; }