[openbeosmediakit] Re: Media prefs

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: openbeosmediakit@xxxxxxxxxxxxx
  • Date: Mon, 01 Mar 2004 13:12:49 +0100 CET

Jérôme Duval <korli@xxxxxxxx> wrote:
> Selon Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>:
> > What does the R5 server do?
> in R5 launch_media_server sends a BMessage through a BMessenger 
> with the signature of media_server with these timeout settings. i 
> don't 
> know exactly what media_server  does with it. It should receive the 
> message and handle it. It can't block its loop until the launch is 
> completed, maybe it sets up a BMessageRunner to submit again 
> the BMessage for handling it again later when the launch is complete. 
> I don't know either when we can say the launch is complete. 
> I should take a look at what notifications do exactly.

Since we intend to have an R5 replacement of the Media Kit, I think we 
have to copy the R5 behaviour of launch_media_server() - so that the R5 
version in libbe.so works as good as our own in our libmedia.so.
Why should the server set up a message runner? I think it should be up 
and running as soon as it starts to serve messages, that is, as soon as 
it's running.
So when you get an answer back from the server, it should be ready for 
whatever you intent to do IMO.

> > > Yes, it seems a good pseudo code. It's just the notifications in 
> > > media 
> > > server seem not implemented. So feeding the port should be 
> > > tricky. 
> > > We could start with a thread with several snooze calls though :)
> > Sure - just set the timeout low enough :)
> > Anyway, I think the server side of things is very easy to do; it 
> > just 
> > have to store the reply port, and send messages to it while it is 
> > shutting down its different components.
> I'm not sure about the easiness. Do you mean there should be a mean 
> to set the reply port and then B_QUIT_REQUESTED the media_server? 
> It should do the trick i think.

If you send the server a B_QUIT_REQUESTED, it should work as you would 
think it do.
I would just add another server command that passes a reply port to the 
server which will remember this, and set itself B_QUIT_REQUESTED.
If there is a reply port set in QuitRequested(), it should be notified 
about the shutdown progress.

As long as it does what is required (shutting down the media server), I 
wouldn't mind if the R5 version of shutdown_media_server() would not 
display the correct messages.

Bye,
   Axel.


Other related posts: