gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] sound::InputStream


From: strk
Subject: [Gnash-dev] sound::InputStream
Date: Tue, 4 Nov 2008 00:49:27 +0100

Hello fellow hackers,
You may have noticed cleanups in the sound handling
subsystem lately.

The aim is allowing an hosting application to be
in control of sound output, in particular test
runners.

In order to do this, I've defined a sound::InputStream
class, instance of which I plan to plug/unplug to
the mixer (currently sound_handler).

Subclasses, to support all current uses, would be
for embedded and for streaming sound.

The embedded sound subclass is ready (EmbedSoundInst)
while the streaming sound one is to be done.

Currently, streaming sounds are simply defined as callbacks.
The callback has this signature:

  bool (*aux_streamer_ptr)(void *udata, boost::uint8_t* stream,
                int len);

In order to make the changes incremental (reducing risk of
regressions) I'd like to somehow change the signature to
let an InputStream subclass instanctiatable in sound_handler
directly, by taking the callback directly.

For that to be possible, the signature must be extended
to include a 'number of samples fetched' output.
This is because the bool return can likely be considered
as the return from sound::InputStream::eof() [negated]
so the only thing left is the actual number of samples fetched.
Also (minor change) it might be worth using unsigned for
length and int16_t* for stream.

The alternative would be dropping the attach_aux_streamer 
and detach_aux_streamer as a whole and focus on generic
::plugInputStream/::unplugInputStream methods, for which at
that point we would probably need to define much more stuff,
like ownership and thread safety.

Comments ? 

--strk; 

 ()   ASCII Ribbon Campaign
 /\   Keep it simple! 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]