TVPinaudio.cpp
资源名称:p2p_vod.rar [点击查看]
上传用户:liguizhu
上传日期:2015-11-01
资源大小:2422k
文件大小:2k
源码类别:
P2P编程
开发平台:
Visual C++
- #include "stdafx.h"
- //
- //////////////////////////////////////////////////////////////
- // audio
- CTVStreamSourceAudioPin::CTVStreamSourceAudioPin(HRESULT *phr, CSource *pFilter)
- : CTVStreamSourcePin(NAME("Chaos Filter Audio Pin"), phr, pFilter, true)
- {
- }
- HRESULT CTVStreamSourceAudioPin::OnThreadStartPlay(void)
- {
- m_pFilter->SetBaseRef(_I64_MAX);
- m_pFilter->SetRawAudioRef(_I64_MAX);
- //
- return CTVStreamSourcePin::OnThreadStartPlay();
- }
- HRESULT CTVStreamSourceAudioPin::OnThreadDestroy(void)
- {
- m_pFilter->SetRawAudioRef(_I64_MAX);
- return CTVStreamSourcePin::OnThreadDestroy();
- }
- //
- STDMETHODIMP CTVStreamSourceAudioPin::NonDelegatingQueryInterface(REFIID riid, void ** ppv)
- {
- return CTVStreamSourcePin::NonDelegatingQueryInterface(riid,ppv);
- }
- //IMediaSeeking
- HRESULT CTVStreamSourceAudioPin::ChangeStart()
- {
- //SetCurrTime(0);
- //SetBaseRef(_I64_MAX);
- if (m_pFilter && m_pFilter->m_pComm)
- return NOERROR;
- //
- if (ThreadExists())
- {
- // next time round the loop the worker thread will
- // pick up the position change.
- // We need to flush all the existing data - we must do that here
- // as our thread will probably be blocked in GetBuffer otherwise
- DeliverBeginFlush();
- // make sure we have stopped pushing
- Stop();
- // complete the flush
- DeliverEndFlush();
- // restart
- Run();
- }
- return NOERROR;
- }
- //
- HRESULT CTVStreamSourceAudioPin::ChangeStop()
- {
- return NOERROR;
- }
- //
- HRESULT CTVStreamSourceAudioPin::ChangeRate()
- {
- return NOERROR;
- }
- //
- HRESULT CTVStreamSourceAudioPin::Active(void)
- {
- //SetSeekData(m_rtStart + m_llBaseTime);
- return CSourceStream::Active();
- }
- void CTVStreamSourceAudioPin::RawSync(LONGLONG start)
- {
- m_pFilter->SetRawAudioRef(start);
- }