Hi,

I have implemented an AVStream mini-driver to stream DV
data to my device. The driver is listed as a filter in
the "WDM Streaming Rendering devices" and is able to
successfully stream also. The problem iam facing is as
follows:

When there is no more data to stream then AVStream class
driver sends a stream pointer with no MDL associated with
it. This is an indication to the mini-driver about the
non-availability of stream data. But my driver would
like to indicate "end_of_stream" to the application so
that the state of the filter graph is changed to "STOP"
state. I tried to set the optionsFlags in the last
stream pointer to KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM.
But still applications like GraphEdit is waiting for user
intervention to stop the filter graph. MSDV driver, on
the other hand, is able to issue this end_of_stream event
and the filter graph needs no intervention to transition
to STOP state.

What needs to be done in my KS mini-driver to indicate
end_of_stream to directshow applications?

Any suggestions on this will be highly appreciated.

Hari.

Re: end_of_stream event in render AVStream mini-drivers by Arnaud

Arnaud
Tue Aug 05 15:08:13 CDT 2003


The bottom line is that you need to fire the KSEVENT_CONNECTION_ENDOFSTREAM
event. This can be a bit tedious to do all by hand. The best way with
AVStream is to set the KSPIN_FLAG_GENERATE_EOS_EVENTS on your render pin.
Actually for a render pin you probably want the KSPIN_FLAG_RENDERER which
combines this flag with KSPIN_FLAG_PROCESS_IN_RUN_STATE_ONLY. When
KSPIN_FLAG_GENERATE_EOS_EVENTS is set on a pin, AVStream will fire the
KSEVENT_CONNECTION_ENDOFSTREAM event when a buffer with the
KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM flag in the header is completed.

By default the KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM flag is already set in
the last header you receive, so really when KSPIN_FLAG_GENERATE_EOS_EVENTS
is set you have nothing to do, except not crashing when you receive a NULL
MDL.

Hope this helps,
Arnaud.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arnaud Glatron

ZMagic Corporation

"Hari" <harik2k2@hotmail.com> wrote in message
news:073501c35b22$99e938c0$a501280a@phx.gbl...
> Hi,
>
> I have implemented an AVStream mini-driver to stream DV
> data to my device. The driver is listed as a filter in
> the "WDM Streaming Rendering devices" and is able to
> successfully stream also. The problem iam facing is as
> follows:
>
> When there is no more data to stream then AVStream class
> driver sends a stream pointer with no MDL associated with
> it. This is an indication to the mini-driver about the
> non-availability of stream data. But my driver would
> like to indicate "end_of_stream" to the application so
> that the state of the filter graph is changed to "STOP"
> state. I tried to set the optionsFlags in the last
> stream pointer to KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM.
> But still applications like GraphEdit is waiting for user
> intervention to stop the filter graph. MSDV driver, on
> the other hand, is able to issue this end_of_stream event
> and the filter graph needs no intervention to transition
> to STOP state.
>
> What needs to be done in my KS mini-driver to indicate
> end_of_stream to directshow applications?
>
> Any suggestions on this will be highly appreciated.
>
> Hari.



Re: end_of_stream event in render AVStream mini-drivers by Max

Max
Tue Aug 05 15:15:35 CDT 2003

You have to fire EOS event.

Do something like this

KsPinGenerateEvents(
m_pKsPin,
&KSEVENTSETID_Connection,
KSEVENT_CONNECTION_ENDOFSTREAM,
0,
NULL,
NULL,
NULL );


-- Max.


"Hari" <harik2k2@hotmail.com> wrote in message
news:073501c35b22$99e938c0$a501280a@phx.gbl...
> Hi,
>
> I have implemented an AVStream mini-driver to stream DV
> data to my device. The driver is listed as a filter in
> the "WDM Streaming Rendering devices" and is able to
> successfully stream also. The problem iam facing is as
> follows:
>
> When there is no more data to stream then AVStream class
> driver sends a stream pointer with no MDL associated with
> it. This is an indication to the mini-driver about the
> non-availability of stream data. But my driver would
> like to indicate "end_of_stream" to the application so
> that the state of the filter graph is changed to "STOP"
> state. I tried to set the optionsFlags in the last
> stream pointer to KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM.
> But still applications like GraphEdit is waiting for user
> intervention to stop the filter graph. MSDV driver, on
> the other hand, is able to issue this end_of_stream event
> and the filter graph needs no intervention to transition
> to STOP state.
>
> What needs to be done in my KS mini-driver to indicate
> end_of_stream to directshow applications?
>
> Any suggestions on this will be highly appreciated.
>
> Hari.



Re: end_of_stream event in render AVStream mini-drivers by Hari

Hari
Tue Aug 05 19:04:36 CDT 2003

Thanks a lot Max! It worked! I had already done what
Arnaud had pointed out but this was the missing aspect!

Thanks once again.
Hari.
>-----Original Message-----
>You have to fire EOS event.
>
>Do something like this
>
> KsPinGenerateEvents(
> m_pKsPin,
> &KSEVENTSETID_Connection,
> KSEVENT_CONNECTION_ENDOFSTREAM,
> 0,
> NULL,
> NULL,
> NULL );
>
>
>-- Max.
>
>
>"Hari" <harik2k2@hotmail.com> wrote in message
>news:073501c35b22$99e938c0$a501280a@phx.gbl...
>> Hi,
>>
>> I have implemented an AVStream mini-driver to stream DV
>> data to my device. The driver is listed as a filter in
>> the "WDM Streaming Rendering devices" and is able to
>> successfully stream also. The problem iam facing is as
>> follows:
>>
>> When there is no more data to stream then AVStream
class
>> driver sends a stream pointer with no MDL associated
with
>> it. This is an indication to the mini-driver about the
>> non-availability of stream data. But my driver would
>> like to indicate "end_of_stream" to the application so
>> that the state of the filter graph is changed to "STOP"
>> state. I tried to set the optionsFlags in the last
>> stream pointer to KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM.
>> But still applications like GraphEdit is waiting for
user
>> intervention to stop the filter graph. MSDV driver, on
>> the other hand, is able to issue this end_of_stream
event
>> and the filter graph needs no intervention to
transition
>> to STOP state.
>>
>> What needs to be done in my KS mini-driver to indicate
>> end_of_stream to directshow applications?
>>
>> Any suggestions on this will be highly appreciated.
>>
>> Hari.
>
>
>.
>

Re: end_of_stream event in render AVStream mini-drivers by Arnaud

Arnaud
Tue Aug 05 22:30:08 CDT 2003

There is something strange about your driver. Setting the pin flags as I
mentioned will trigger the KSEVENT_CONNECTION_ENDOFSTREAM event when a
buffer with the KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM flag is completed (when
the last stream pointer reference to it is released). I have done this many
times and this works. If it does not work for you this means that something
is not right. I have not tried this with DirectX 8.0, but this works fine
with the version of AVStream coming with DirectX 8.1 and above.

What Max mentions is exactly what the AVStream framework does internally
when it the conditions above are met. So of course this works, but you
should not need it!

Just thought I would point this out,
Arnaud.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Arnaud Glatron

ZMagic Corporation

"Hari" <harik2k2@hotmail.com> wrote in message
news:054901c35bae$52d5db50$a401280a@phx.gbl...
> Thanks a lot Max! It worked! I had already done what
> Arnaud had pointed out but this was the missing aspect!
>
> Thanks once again.
> Hari.
> >-----Original Message-----
> >You have to fire EOS event.
> >
> >Do something like this
> >
> > KsPinGenerateEvents(
> > m_pKsPin,
> > &KSEVENTSETID_Connection,
> > KSEVENT_CONNECTION_ENDOFSTREAM,
> > 0,
> > NULL,
> > NULL,
> > NULL );
> >
> >
> >-- Max.
> >
> >
> >"Hari" <harik2k2@hotmail.com> wrote in message
> >news:073501c35b22$99e938c0$a501280a@phx.gbl...
> >> Hi,
> >>
> >> I have implemented an AVStream mini-driver to stream DV
> >> data to my device. The driver is listed as a filter in
> >> the "WDM Streaming Rendering devices" and is able to
> >> successfully stream also. The problem iam facing is as
> >> follows:
> >>
> >> When there is no more data to stream then AVStream
> class
> >> driver sends a stream pointer with no MDL associated
> with
> >> it. This is an indication to the mini-driver about the
> >> non-availability of stream data. But my driver would
> >> like to indicate "end_of_stream" to the application so
> >> that the state of the filter graph is changed to "STOP"
> >> state. I tried to set the optionsFlags in the last
> >> stream pointer to KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM.
> >> But still applications like GraphEdit is waiting for
> user
> >> intervention to stop the filter graph. MSDV driver, on
> >> the other hand, is able to issue this end_of_stream
> event
> >> and the filter graph needs no intervention to
> transition
> >> to STOP state.
> >>
> >> What needs to be done in my KS mini-driver to indicate
> >> end_of_stream to directshow applications?
> >>
> >> Any suggestions on this will be highly appreciated.
> >>
> >> Hari.
> >
> >
> >.
> >



Re: end_of_stream event in render AVStream mini-drivers by Anatoly

Anatoly
Sun Aug 10 05:56:18 CDT 2003

Hi,

I have a similar problem but in Streaming Class minidriver. The graph clock
jumps to the end value after few frames were processed. The streaming
continues and the last frame has KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM. The
graph does not stop by itself (as it usually does, but can be stopped
manually), I assume because of stop event which is never received. Any ideas
what am I doing wrong?

Thanks,
Anatoly.

"Hari" <harik2k2@hotmail.com> wrote in message
news:073501c35b22$99e938c0$a501280a@phx.gbl...
> Hi,
>
> I have implemented an AVStream mini-driver to stream DV
> data to my device. The driver is listed as a filter in
> the "WDM Streaming Rendering devices" and is able to
> successfully stream also. The problem iam facing is as
> follows:
>
> When there is no more data to stream then AVStream class
> driver sends a stream pointer with no MDL associated with
> it. This is an indication to the mini-driver about the
> non-availability of stream data. But my driver would
> like to indicate "end_of_stream" to the application so
> that the state of the filter graph is changed to "STOP"
> state. I tried to set the optionsFlags in the last
> stream pointer to KSSTREAM_HEADER_OPTIONSF_ENDOFSTREAM.
> But still applications like GraphEdit is waiting for user
> intervention to stop the filter graph. MSDV driver, on
> the other hand, is able to issue this end_of_stream event
> and the filter graph needs no intervention to transition
> to STOP state.
>
> What needs to be done in my KS mini-driver to indicate
> end_of_stream to directshow applications?
>
> Any suggestions on this will be highly appreciated.
>
> Hari.