00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "StdAfx.h"
00023 #include "BaseMuxerOutputPin.h"
00024
00025
00026
00027
00028
00029 CBaseMuxerOutputPin::CBaseMuxerOutputPin(TCHAR* pName, CBaseFilter* pFilter, CCritSec* pLock, HRESULT* phr)
00030 : CBaseOutputPin(pName, pFilter, pLock, phr, L"Output")
00031 {
00032 }
00033
00034 CBaseMuxerOutputPin::~CBaseMuxerOutputPin()
00035 {
00036 }
00037
00038 HRESULT CBaseMuxerOutputPin::DecideBufferSize(IMemAllocator* pAlloc, ALLOCATOR_PROPERTIES* pProperties)
00039 {
00040 ASSERT(pAlloc);
00041 ASSERT(pProperties);
00042
00043 HRESULT hr = NOERROR;
00044
00045 pProperties->cBuffers = 1;
00046 pProperties->cbBuffer = 1;
00047
00048 ALLOCATOR_PROPERTIES Actual;
00049 if(FAILED(hr = pAlloc->SetProperties(pProperties, &Actual))) return hr;
00050
00051 if(Actual.cbBuffer < pProperties->cbBuffer) return E_FAIL;
00052 ASSERT(Actual.cBuffers == pProperties->cBuffers);
00053
00054 return NOERROR;
00055 }
00056
00057 HRESULT CBaseMuxerOutputPin::CheckMediaType(const CMediaType* pmt)
00058 {
00059 return pmt->majortype == MEDIATYPE_Stream && pmt->subtype == MEDIASUBTYPE_NULL
00060 ? S_OK
00061 : E_INVALIDARG;
00062 }
00063
00064 HRESULT CBaseMuxerOutputPin::GetMediaType(int iPosition, CMediaType* pmt)
00065 {
00066 CAutoLock cAutoLock(m_pLock);
00067
00068 if(iPosition < 0) return E_INVALIDARG;
00069 if(iPosition > 0) return VFW_S_NO_MORE_ITEMS;
00070
00071 pmt->ResetFormatBuffer();
00072 pmt->InitMediaType();
00073 pmt->majortype = MEDIATYPE_Stream;
00074 pmt->subtype = MEDIASUBTYPE_NULL;
00075 pmt->formattype = FORMAT_None;
00076
00077 return S_OK;
00078 }
00079
00080 STDMETHODIMP CBaseMuxerOutputPin::Notify(IBaseFilter* pSender, Quality q)
00081 {
00082 return E_NOTIMPL;
00083 }