53 ) : m_lBatchSize(lBatchSize),
54 m_bBatchExact(bBatchExact && (lBatchSize > 1)),
61 m_evFlushComplete(FALSE, phr),
67 m_bFlushingOpt(bFlushingOpt),
81 *phr = pInputPin->QueryInterface(IID_IMemInputPin, (
void **)&
m_pInputPin);
98 if (m_ppSamples ==
NULL) {
109 DWORD dwError = GetLastError();
118 *phr = E_OUTOFMEMORY;
131 DWORD dwError = GetLastError();
135 SetThreadPriority(
m_hThread, dwPriority);
137 DbgLog((
LOG_TRACE, 2, TEXT(
"Calling input pin directly - no thread")));
176 delete [] m_ppSamples;
184 HRESULT hrCoInit = CAMThread::CoInitializeHelper();
189 if(hrCoInit == S_OK) {
207 IMediaSample *pSample;
238 if (pSample !=
NULL &&
244 m_ppSamples[m_nBatched++] = pSample;
254 if (pSample ==
NULL &&
293 lNumberToSend = m_nBatched;
313 if (lNumberToSend != 0) {
327 while (lNumberToSend != 0) {
328 m_ppSamples[--lNumberToSend]->Release();
354 DbgLog((
LOG_ERROR, 2, TEXT(
"COutputQueue got code 0x%8.8X from EndOfStream()")));
394 REFERENCE_TIME tStart,
395 REFERENCE_TIME tStop,
403 m_pPin->NewSegment(tStart, tStop, dRate);
421 ppack->
tStop = tStop;
422 ppack->
dRate = dRate;
448 DbgLog((
LOG_ERROR, 2, TEXT(
"COutputQueue got code 0x%8.8X from EndOfStream()")));
595 __in_ecount(nSamples) IMediaSample **ppSamples,
597 __out
long *nSamplesProcessed)
619 *nSamplesProcessed = 0;
620 for (
int i = 0; i < nSamples; i++) {
621 DbgLog((
LOG_TRACE, 3, TEXT(
"COutputQueue (direct) : Discarding %d samples code 0x%8.8X"),
623 ppSamples[i]->Release();
647 if (iDone < nSamples) {
648 m_ppSamples[m_nBatched++] = ppSamples[iDone++];
663 iLost += m_nBatched - nDone;
664 for (LONG i = 0; i < m_nBatched; i++) {
665 m_ppSamples[i]->Release();
670 *nSamplesProcessed = iDone - iLost;
671 if (*nSamplesProcessed < 0) {
672 *nSamplesProcessed = 0;
679 *nSamplesProcessed = 0;
680 DbgLog((
LOG_TRACE, 3, TEXT(
"COutputQueue (queued) : Discarding %d samples code 0x%8.8X"),
682 for (
int i = 0; i < nSamples; i++) {
683 ppSamples[i]->Release();
688 for (
long i = 0; i < nSamples; i++) {
691 *nSamplesProcessed = nSamples;
728 if (pSample ==
NULL) {
750 for (
int i = 0; i < m_nBatched; i++) {
751 m_ppSamples[i]->Release();