Robin
2005-04-01 15:49:28 UTC
Hello!
I used CSource and CSourceStream for my DirectShow source filter
to implement a transport mechanism based on the push-mode.
This is working fine, because the handling of the fillbuffer() method is
easy.
Now I also like to have support for the pull-mode IAsyncReader because
most mpeg2 demultiplexers need it.
But it seems not to be simple to do that.
So I also inherit from IAsyncReader in my outputpin class.
Now I have to implement these methods of this interface:
HRESULT IAsyncReader::RequestAllocator(IMemAllocator *,ALLOCATOR_PROPERTIES
*,IMemAllocator ** )
HRESULT IAsyncReader::Request(IMediaSample *,DWORD_PTR)
HRESULT IAsyncReader::WaitForNext(DWORD,IMediaSample ** ,DWORD_PTR *)
HRESULT IAsyncReader::SyncReadAligned(IMediaSample *)
HRESULT IAsyncReader::SyncRead(LONGLONG,LONG,BYTE *)
HRESULT IAsyncReader::Length(LONGLONG *,LONGLONG *)
HRESULT IAsyncReader::BeginFlush(void)
HRESULT IAsyncReader::EndFlush(void)
But this only is not working because in preparation phase on connecting
between my source
filter and the pull-mode demuxer (what is done by the graphbuilder) I got an
error : E_NOINTERFACE.
I have debugged it a little bit and this error occurs, because the hidden
function "AttemptConnect()"
ask for the wrong interface on the input-pin: IMemInputPin (the push model).
That's the reason for connection failure.
But it should ask for the IAsyncReader support (at least as a second try)!
So how I can adjust this?
Maybe, I cannot use CSource & CSourceStream to implement both transport
mechanisms (pull & push)
but then I have to start with CBaseFilter & CBasePin, so there is a lot of
more work to do...
for both mechanisms.
Thanks for any help.
Regards,
Robin Siegemund.
I used CSource and CSourceStream for my DirectShow source filter
to implement a transport mechanism based on the push-mode.
This is working fine, because the handling of the fillbuffer() method is
easy.
Now I also like to have support for the pull-mode IAsyncReader because
most mpeg2 demultiplexers need it.
But it seems not to be simple to do that.
So I also inherit from IAsyncReader in my outputpin class.
Now I have to implement these methods of this interface:
HRESULT IAsyncReader::RequestAllocator(IMemAllocator *,ALLOCATOR_PROPERTIES
*,IMemAllocator ** )
HRESULT IAsyncReader::Request(IMediaSample *,DWORD_PTR)
HRESULT IAsyncReader::WaitForNext(DWORD,IMediaSample ** ,DWORD_PTR *)
HRESULT IAsyncReader::SyncReadAligned(IMediaSample *)
HRESULT IAsyncReader::SyncRead(LONGLONG,LONG,BYTE *)
HRESULT IAsyncReader::Length(LONGLONG *,LONGLONG *)
HRESULT IAsyncReader::BeginFlush(void)
HRESULT IAsyncReader::EndFlush(void)
But this only is not working because in preparation phase on connecting
between my source
filter and the pull-mode demuxer (what is done by the graphbuilder) I got an
error : E_NOINTERFACE.
I have debugged it a little bit and this error occurs, because the hidden
function "AttemptConnect()"
ask for the wrong interface on the input-pin: IMemInputPin (the push model).
That's the reason for connection failure.
But it should ask for the IAsyncReader support (at least as a second try)!
So how I can adjust this?
Maybe, I cannot use CSource & CSourceStream to implement both transport
mechanisms (pull & push)
but then I have to start with CBaseFilter & CBasePin, so there is a lot of
more work to do...
for both mechanisms.
Thanks for any help.
Regards,
Robin Siegemund.