STDMETHODIMP CSubtitleInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) { CAutoLock cAutoLock(&m_csReceive); if (m_mt.majortype == MEDIATYPE_Text || m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_UTF8 /*|| m_mt.subtype == MEDIASUBTYPE_USF*/ || m_mt.subtype == MEDIASUBTYPE_SSA || m_mt.subtype == MEDIASUBTYPE_ASS || m_mt.subtype == MEDIASUBTYPE_ASS2)) { CAutoLock cAutoLock2(m_pSubLock); CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)m_pSubStream; pRTS->RemoveAll(); pRTS->CreateSegments(); } else if (m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_VOBSUB)) { CAutoLock cAutoLock2(m_pSubLock); CVobSubStream* pVSS = (CVobSubStream*)(ISubStream*)m_pSubStream; pVSS->RemoveAll(); } else if (IsHdmvSub(&m_mt)) { CAutoLock cAutoLock2(m_pSubLock); CRenderedHdmvSubtitle* pHdmvSubtitle = (CRenderedHdmvSubtitle*)(ISubStream*)m_pSubStream; pHdmvSubtitle->NewSegment(tStart, tStop, dRate); } return __super::NewSegment(tStart, tStop, dRate); }
STDMETHODIMP CSubtitleInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) { CAutoLock cAutoLock(&m_csReceive); if (m_mt.majortype == MEDIATYPE_Text || m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_UTF8 /*|| m_mt.subtype == MEDIASUBTYPE_USF*/ || m_mt.subtype == MEDIASUBTYPE_SSA || m_mt.subtype == MEDIASUBTYPE_ASS || m_mt.subtype == MEDIASUBTYPE_ASS2)) { CAutoLock cAutoLock2(m_pSubLock); CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)m_pSubStream; pRTS->RemoveAll(); pRTS->CreateSegments(); } else if (m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_VOBSUB)) { CAutoLock cAutoLock2(m_pSubLock); CVobSubStream* pVSS = (CVobSubStream*)(ISubStream*)m_pSubStream; pVSS->RemoveAll(); } else if (IsHdmvSub(&m_mt)) { CAutoLock cAutoLock2(m_pSubLock); CRenderedHdmvSubtitle* pHdmvSubtitle = (CRenderedHdmvSubtitle*)(ISubStream*)m_pSubStream; pHdmvSubtitle->NewSegment(tStart, tStop, dRate); } TRACE(_T("NewSegment: InvalidateSubtitle(%I64d, ...)\n"), tStart); // IMPORTANT: m_pSubLock must not be locked when calling this InvalidateSubtitle(tStart, m_pSubStream); return __super::NewSegment(tStart, tStop, dRate); }
STDMETHODIMP CSubtitleInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) { CAutoLock cAutoLock(&m_csReceive); if(m_mt.majortype == MEDIATYPE_Text || m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_UTF8 /*|| m_mt.subtype == MEDIASUBTYPE_USF*/ || m_mt.subtype == MEDIASUBTYPE_SSA || m_mt.subtype == MEDIASUBTYPE_ASS || m_mt.subtype == MEDIASUBTYPE_ASS2)) { CAutoLock cAutoLock(m_pSubLock); CRenderedTextSubtitle* pRTS = (CRenderedTextSubtitle*)(ISubStream*)m_pSubStream; pRTS->RemoveAll(); pRTS->CreateSegments(); } else if(m_mt.majortype == MEDIATYPE_Subtitle && m_mt.subtype == MEDIASUBTYPE_SSF) { CAutoLock cAutoLock(m_pSubLock); ssf::CRenderer* pSSF = (ssf::CRenderer*)(ISubStream*)m_pSubStream; // LAME, implement RemoveSubtitles DWORD dwOffset = ((SUBTITLEINFO*)m_mt.pbFormat)->dwOffset; pSSF->Open(ssf::MemoryInputStream(m_mt.pbFormat + dwOffset, m_mt.cbFormat - dwOffset, false, false), _T("")); // pSSF->RemoveSubtitles(); } else if(m_mt.majortype == MEDIATYPE_Subtitle && (m_mt.subtype == MEDIASUBTYPE_VOBSUB)) { CAutoLock cAutoLock(m_pSubLock); CVobSubStream* pVSS = (CVobSubStream*)(ISubStream*)m_pSubStream; pVSS->RemoveAll(); } else if (IsHdmvSub(&m_mt)) { CAutoLock cAutoLock(m_pSubLock); CRenderedHdmvSubtitle* pHdmvSubtitle = (CRenderedHdmvSubtitle*)(ISubStream*)m_pSubStream; pHdmvSubtitle->NewSegment (tStart, tStop, dRate); } return __super::NewSegment(tStart, tStop, dRate); }
STDMETHODIMP CTextSubtitleInputPinHepler::NewSegment( REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate ) { m_pRTS->RemoveAllEntries(); m_pRTS->CreateSegments(); return __super::NewSegment(tStart,tStop,dRate); }