my dmo can not connect to mux,can someone help me?there are always no answer??
I developing capture application,the graph is builded by the campture sourcefilter, mpeg4 encoder DMO and mux filter.
when the graph checked my DMO, at the end of checking DMO the graph called InternalGetOutputType () and InternalGetOutputStreamInfo() ceaselessly, and at the end the capture crashed!!
my InternalGetOutputStreamInfo() is coded as:
HRESULT CMpeg4enc::InternalGetOutputStreamInfo(DWORD dwOutputStreamIndex, DWORD *pdwFlags)
{
*pdwFlags = DMO_OUTPUT_STREAMF_WHOLE_SAMPLES |
DMO_OUTPUT_STREAMF_SINGLE_SAMPLE_PER_BUFFER;
return S_OK;
}
and my InternalGetOutputType () is coded as:
HRESULT CMpeg4enc::InternalCheckOutputType(DWORD dwOutputStreamIndex, const DMO_MEDIA_TYPE *pmt)
{
// Check if the type is already set and if so reject any type that's not identical
if (OutputTypeSet(dwOutputStreamIndex)) {
return DMO_E_INVALIDTYPE;
} else {
return S_OK;
}
}
if (pmt->majortype == MEDIATYPE_Video &&
// pmt->subtype == MEDIASUBTYPE_RGB565 &&
pmt->formattype == FORMAT_VideoInfo &&
pmt->pbFormat != NULL) {
return S_OK;
}
return DMO_E_INVALIDTYPE;
}
I have implement those function that IMediaObjectImpl ruquired:
public:
// IMediaObjectImpl callbacks
HRESULT InternalGetInputStreamInfo(DWORD dwInputStreamIndex, DWORD *pdwFlags);
HRESULT InternalGetOutputStreamInfo(DWORD dwOutputStreamIndex, DWORD *pdwFlags);
HRESULT InternalCheckInputType(DWORD dwInputStreamIndex, const DMO_MEDIA_TYPE *pmt);
HRESULT InternalCheckOutputType(DWORD dwOutputStreamIndex, const DMO_MEDIA_TYPE *pmt);
HRESULT InternalGetInputType(DWORD dwInputStreamIndex, DWORD dwTypeIndex,
DMO_MEDIA_TYPE *pmt);
HRESULT InternalGetOutputType(DWORD dwOutputStreamIndex, DWORD dwTypeIndex,
DMO_MEDIA_TYPE *pmt);
HRESULT InternalGetInputSizeInfo(DWORD dwInputStreamIndex, DWORD *pcbSize,
DWORD *pcbMaxLookahead, DWORD *pcbAlignment);
HRESULT InternalGetOutputSizeInfo(DWORD dwOutputStreamIndex, DWORD *pcbSize,
DWORD *pcbAlignment);
HRESULT InternalGetInputMaxLatency(DWORD dwInputStreamIndex, REFERENCE_TIME *prtMaxLatency);
HRESULT InternalSetInputMaxLatency(DWORD dwInputStreamIndex, REFERENCE_TIME rtMaxLatency);
HRESULT InternalFlush();
HRESULT InternalDiscontinuity(DWORD dwInputStreamIndex);
HRESULT InternalAllocateStreamingResources();
HRESULT InternalFreeStreamingResources();
HRESULT InternalProcessInput(DWORD dwInputStreamIndex, IMediaBuffer *pBuffer,
DWORD dwFlags, REFERENCE_TIME rtTimestamp,
REFERENCE_TIME rtTimelength);
HRESULT InternalProcessOutput(DWORD dwFlags, DWORD cOutputBufferCount,
DMO_OUTPUT_DATA_BUFFER *pOutputBuffers,
DWORD *pdwStatus);
HRESULT InternalAcceptingInput(DWORD dwInputStreamIndex);
I dont know why this happend can you help me?
thank you very much

