Discussion:
sending event to Media player from DShow ?
(too old to reply)
MCunha
2004-01-07 20:06:53 UTC
Permalink
I create an input filter using DShow to be use with Windows Media Player.

However, I would like that, each time an user click the button stop in
W.M.P.,
the input filter tell W.M.P to shut down and restart the graph again like if
the user open an new url.

How can I make that ?

Michel
Alessandro Angeli [MVP::DigitalMedia]
2004-01-07 20:54:49 UTC
Permalink
I don't think you can, in any way. What you could do is
create a worker thread from your filter that clears and
rebuilds he graph inside the same graph manager instance.
This should work but there may well be difficulties I can't
forsee now.
Post by MCunha
I create an input filter using DShow to be use with
Windows Media Player.
However, I would like that, each time an user click the
button stop in W.M.P.,
the input filter tell W.M.P to shut down and restart the
graph again like if the user open an new url.
How can I make that ?
Michel
--
/**
* Alessandro Angeli
*
* MVP::DigitalMedia
*
* a dot angeli at biosys dot net
*/
MCunha
2004-01-08 19:10:31 UTC
Permalink
I noted that if I return E_ABORT in the stop method of my input filter, it
will stop Windows Media Player and it will shut down the graph and all
connected filters, when the user click the stop button in Media Player.

Then the next time that the user click the play button, Media Player will
recreate the graph and will reload my input filter, as if it was the first
time that the user open an URL location.
This is exactly what I want.

Now the problem is, if the user start Media Player, open an URL to my
server, Media Player load my input filter, the user click the button pause,
then the user click the button play to continue playing, then if the user
click the button stop the button play will be freeze :(

Why ?

If I dont pause and only stop the button play is not freeze, but if I pause,
play and stop button play will be freeze. Why if I return E_ABORT in ::stop
method this problem append ?

Michel
Post by MCunha
I create an input filter using DShow to be use with Windows Media Player.
However, I would like that, each time an user click the button stop in
W.M.P.,
the input filter tell W.M.P to shut down and restart the graph again like if
the user open an new url.
How can I make that ?
Michel
Alessandro Angeli [MVP::DigitalMedia]
2004-01-08 21:56:27 UTC
Permalink
First of all, what is the "::stop method"? Do you mean
IMediaFilter::Stop()? If your Stop() method is not
IMediaFilter::Stop(), is it called also on Pause()?

Anyway, I don't think the destruction of the graph when you
return E_ABORT is by design, since this behavior is not
documented in any way, but a side effect of an unexpected
error (the Stop() method is not supposed to return anything
else but S_OK or S_FALSE unless an unforseen error happens),
in which case maybe WMP simply doesn't correctly handle the
failed Stop() after a Pause().
Post by MCunha
I noted that if I return E_ABORT in the stop method of my
input filter, it will stop Windows Media Player and it
will shut down the graph and all connected filters, when
the user click the stop button in Media Player.
Then the next time that the user click the play button,
Media Player will recreate the graph and will reload my
input filter, as if it was the first time that the user
open an URL location.
This is exactly what I want.
Now the problem is, if the user start Media Player, open
an URL to my server, Media Player load my input filter,
the user click the button pause, then the user click the
button play to continue playing, then if the user click
the button stop the button play will be freeze :(
Why ?
If I dont pause and only stop the button play is not
freeze, but if I pause, play and stop button play will be
freeze. Why if I return E_ABORT in ::stop method this
problem append ?
Michel
Post by MCunha
I create an input filter using DShow to be use with
Windows Media Player.
However, I would like that, each time an user click the
button stop in W.M.P.,
the input filter tell W.M.P to shut down and restart the
graph again like if the user open an new url.
How can I make that ?
Michel
--
/**
* Alessandro Angeli
*
* MVP::DigitalMedia
*
* a dot angeli at biosys dot net
*/
MCunha
2004-01-09 14:33:08 UTC
Permalink
You are right about the Stop() method is not supposed to return anything
else but S_OK or S_FALSE unless an unforseen error happens.

About my stop method :
My input pluging class derive from CBaseFilter which
implements the IMediaFilter::Stop method.

I override Stop and Pause so I can send messages to my server.
However in my Stop method I do call CBaseFilter::Stop();

Michel
Post by Alessandro Angeli [MVP::DigitalMedia]
First of all, what is the "::stop method"? Do you mean
IMediaFilter::Stop()? If your Stop() method is not
IMediaFilter::Stop(), is it called also on Pause()?
Anyway, I don't think the destruction of the graph when you
return E_ABORT is by design, since this behavior is not
documented in any way, but a side effect of an unexpected
error (the Stop() method is not supposed to return anything
else but S_OK or S_FALSE unless an unforseen error happens),
in which case maybe WMP simply doesn't correctly handle the
failed Stop() after a Pause().
Post by MCunha
I noted that if I return E_ABORT in the stop method of my
input filter, it will stop Windows Media Player and it
will shut down the graph and all connected filters, when
the user click the stop button in Media Player.
Then the next time that the user click the play button,
Media Player will recreate the graph and will reload my
input filter, as if it was the first time that the user
open an URL location.
This is exactly what I want.
Now the problem is, if the user start Media Player, open
an URL to my server, Media Player load my input filter,
the user click the button pause, then the user click the
button play to continue playing, then if the user click
the button stop the button play will be freeze :(
Why ?
If I dont pause and only stop the button play is not
freeze, but if I pause, play and stop button play will be
freeze. Why if I return E_ABORT in ::stop method this
problem append ?
Michel
Post by MCunha
I create an input filter using DShow to be use with
Windows Media Player.
However, I would like that, each time an user click the
button stop in W.M.P.,
the input filter tell W.M.P to shut down and restart the
graph again like if the user open an new url.
How can I make that ?
Michel
--
/**
* Alessandro Angeli
*
* MVP::DigitalMedia
*
* a dot angeli at biosys dot net
*/
Loading...