Mailing List archive

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

[vdr] Re: can the osd be accessed by a separate pthread?



Clemens Kirchgatterer wrote:
> 
> Gunnar Roth <gunnar.roth@gmx.de> wrote:
> 
> > >it can't. the osd is a static object. there is only one at any time.
> > >when there is already an osd open cOsd::OpenRaw(x, y) will return
> > >NULL.
> > >
> > >cOsdBase *cOsd::OpenRaw(int x, int y)
> > >{
> > >  return osd ? NULL : cDevice::PrimaryDevice()->NewOsd(x, y);
> > >}
> > >
> > maybe this is valid for OpenRaw, but believe me a status message will
> > interfer with your plugin as i did explain in my last post.
> > please do a test by yourself. start testris and then issue a status
> > message from the console with "svdrsend.pl  MESG  "this is a test""
> > and look what happens.
> 
> as i have already said: that is not the plugins fault. have you tried
> this with any other plugin that opens an raw osd? i.e. with klaus' own
> osddemo plugin?

Sorry, but it _is_ the plugin's fault!

A plugin that wants to open a raw OSD shall return a derived cOsdObject
from its MainMenuAction() function. VDR will then call that object's
Show() function and in _there_ the derived cOsdObject may call cOsd::OpenRaw()
(and nowhere else!).

The derived cOsdObject must delete its raw OSD inside its desctructor
(see the osddemo example).

While the derived cOsdObject exists, it may access the OSD even from
a thread, because VDR will not access it while such an object exists.
However, VDR absolutely relies on the object to close the raw OSD in
its destructor. After the destructor has run, VDR assumes full control
over the OSD again. If the object doesn't play along, trouble is probably
inevitable.

Maybe I should add a note about this in PLUGINS.html, because apparantly
this isn't quite clear.

BTW: since the OSD is a very limited resource, there's no way of making it
"sharable".

> > >the osd gets closed just before the main thread ends. so there is
> > >nothing to wait for.
> > >
> > It gets closed , but at this time the main vdr thread can already do
> > access the osd.
> > you do an usleep in your thread loop, on slow computers this could
> > indded happen IMHO
> 
> but where is the problem? when the osd has been closed, it does not
> matter, if the plugins "main thread" thread is still runnig for a few
> milliseconds or not.
> 
> what are you concerned about?

If the thread doesn't access the OSD any more, that's fine.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index