[Gnash-dev] Re: [Gnash] Playing multiple movies at the same time

From:

Sergio Garcia

Subject:

[Gnash-dev] Re: [Gnash] Playing multiple movies at the same time

Date:

Mon, 20 Aug 2007 12:07:22 +0200

>On Sun, 19 Aug 2007 22:36:03 +0200 strk wrote:
>> Hi,
>>
>> I'm currently working in using flash movies for Video IVR systems in
>> Asterisk.
>> I've got something working (currently working on audio) and probably I'l make
>> it public next week.
>>
>> But I have seen that currently there is no way of playing multiple movies at
>> the same time so I'll have to use forking as there is done in the plugins.
>Correct. The fix would be implementing a VM::reset() with same signature of
>VM::init()
>and taking care of stopping all threads, dropping all references to GC
>resources from
>the roots, collect garbage and restart. Would need a fair amount of testing as
>any as_object
>would have a reference to the *old* (now destroyed) VM.
I was thinking in having multiple instances of the vm at the same time, each
with
it's own movie, renderers, gc and so on.
I think that the first step should moving all the static functions and objets
to the VM class or create a new one for that pourposse and point the static
function
to it. For example:
void VM::set_base_url(const URL& url)
{
// can call this only once during a single run
assert(!globals::baseurl.get());
globals::baseurl.reset(new URL(url));
log_msg(_("Base url set to: %s"), globals::baseurl->str().c_str());
}
void
set_base_url(const URL& url)
{
VN::get().set_base_url(url);
}
Later we should remove the static function call and add the reference to the
appropiate
objects.
>> Also I've found that due to the garbage collector it's not possible to use
>> different
>> threads to load and play the movie.
>We are actually using a thread to load the movie in the core lib already, with
>assertion checking that the loader/parser thread doesn't mess with the garbage
>collector
>at all.
Then what does it mean the
assert(self == mainThread);
in GC.h??
>> Would any work done in that area considered interesting to be commited?
>Sure, cleaning up modules interface will be appreciated.
Don't know if I'll be able to get much time for this, but I'll try.
BTW I copy the dev list because it's probably the correct list for this
discussion.. :)
BR
Sergio