MpegSplitter.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:3k
- /*
- * Copyright (C) 2003-2005 Gabest
- * http://www.gabest.org
- *
- * This Program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- */
- #pragma once
- #include "..BaseSplitterBaseSplitter.h"
- #include "MpegSplitterFile.h"
- [uuid("DC257063-045F-4BE2-BD5B-E12279C464F0")]
- class CMpegSplitterFilter : public CBaseSplitterFilter, public IAMStreamSelect
- {
- REFERENCE_TIME m_rtStartOffset;
- protected:
- CAutoPtr<CMpegSplitterFile> m_pFile;
- HRESULT CreateOutputs(IAsyncReader* pAsyncReader);
- bool DemuxInit();
- void DemuxSeek(REFERENCE_TIME rt);
- bool DemuxLoop();
- HRESULT DemuxNextPacket(REFERENCE_TIME rtStartOffset);
- public:
- CMpegSplitterFilter(LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid = __uuidof(CMpegSplitterFilter));
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
- // IAMStreamSelect
- STDMETHODIMP Count(DWORD* pcStreams);
- STDMETHODIMP Enable(long lIndex, DWORD dwFlags);
- STDMETHODIMP Info(long lIndex, AM_MEDIA_TYPE** ppmt, DWORD* pdwFlags, LCID* plcid, DWORD* pdwGroup, WCHAR** ppszName, IUnknown** ppObject, IUnknown** ppUnk);
- };
- [uuid("1365BE7A-C86A-473C-9A41-C0A6E82C9FA3")]
- class CMpegSourceFilter : public CMpegSplitterFilter
- {
- public:
- CMpegSourceFilter(LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid = __uuidof(CMpegSourceFilter));
- };
- class CMpegSplitterOutputPin : public CBaseSplitterOutputPin, protected CCritSec
- {
- CAutoPtr<Packet> m_p;
- REFERENCE_TIME m_rtPrev, m_rtOffset;
- protected:
- HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- HRESULT DeliverPacket(CAutoPtr<Packet> p);
- HRESULT DeliverEndFlush();
- public:
- CMpegSplitterOutputPin(CArray<CMediaType>& mts, LPCWSTR pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr);
- virtual ~CMpegSplitterOutputPin();
- };