Ejemplo n.º 1
0
CBaseSplitterFilter::CBaseSplitterFilter(LPCTSTR pName, LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid)
	: CBaseFilter(pName, pUnk, this, clsid)
	, m_rtDuration(0), m_rtStart(0), m_rtStop(0), m_rtCurrent(0)
	, m_dRate(1.0)
	, m_nOpenProgress(100)
	, m_fAbort(false)
	, m_rtLastStart(INVALID_TIME)
	, m_rtLastStop(INVALID_TIME)
	, m_priority(THREAD_PRIORITY_NORMAL)
	, m_nFlag(0)
{
	if (phr) {
		*phr = S_OK;
	}

	m_pInput.Attach(DNew CBaseSplitterInputPin(NAME("CBaseSplitterInputPin"), this, this, phr));

	MEMORYSTATUSEX msEx;
	msEx.dwLength = sizeof(msEx);
	::GlobalMemoryStatusEx(&msEx);
	DWORDLONG halfMemMB = msEx.ullTotalPhys / 0x200000;

	m_MinQueueSize = KILOBYTE * max(64, min(MINQUEUESIZE * 4, AfxGetApp()->GetProfileInt(IDS_R_SETTINGS IDS_R_PERFOMANCE, IDS_RS_PERFOMANCE_MINQUEUESIZE, MINQUEUESIZE)));
	m_MaxQueueSize = MEGABYTE * max(10, min(min(512, halfMemMB), AfxGetApp()->GetProfileInt(IDS_R_SETTINGS IDS_R_PERFOMANCE, IDS_RS_PERFOMANCE_MAXQUEUESIZE, MAXQUEUESIZE)));

	m_MinQueuePackets = max(10, min(MAXQUEUEPACKETS, AfxGetApp()->GetProfileInt(IDS_R_SETTINGS IDS_R_PERFOMANCE, IDS_RS_PERFOMANCE_MINQUEUEPACKETS, MINQUEUEPACKETS)));
	m_MaxQueuePackets = max(m_MinQueuePackets*2, min(MAXQUEUEPACKETS*10, AfxGetApp()->GetProfileInt(IDS_R_SETTINGS IDS_R_PERFOMANCE, IDS_RS_PERFOMANCE_MAXQUEUEPACKETS, MAXQUEUEPACKETS)));
}
Ejemplo n.º 2
0
CBaseSplitterFilter::CBaseSplitterFilter(LPCTSTR pName, LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid)
	: CBaseFilter(pName, pUnk, this, clsid)
	, m_rtDuration(0), m_rtStart(0), m_rtStop(0), m_rtCurrent(0)
	, m_dRate(1.0)
	, m_nOpenProgress(100)
	, m_fAbort(false)
	, m_rtLastStart(_I64_MIN)
	, m_rtLastStop(_I64_MIN)
	, m_priority(THREAD_PRIORITY_NORMAL)
{
	if(phr) {
		*phr = S_OK;
	}

	m_pInput.Attach(DNew CBaseSplitterInputPin(NAME("CBaseSplitterInputPin"), this, this, phr));
}