[vdr] [PATCH] fix segfault in cSkins::Message

Klaus Schmidinger Klaus.Schmidinger at cadsoft.de
Sun Jul 31 18:42:45 CEST 2005


Luca Olivetti wrote:
> Klaus Schmidinger wrote:
> 
>> A plugin may well call Skins.Message(), but only from the _main_
>> thread.
>>
>> I'm thinking about a function like
>>
>>   cOsdObject *cPlugin::Popup(void);
>>
>> which would be called in every turn of the main loop (i.e. from the
>> foreground thread) whenever there is no OSD display open. A plugin
>> could either return a cOsdObject that will be presented to the user,
> 
> 
> In this case the function wouldn't be called again, would it?

The Popup() function would be called whenever there is nothing else on
teh OSD. If it returns a cOsdObject, then that object's ProcessKey()
function will be called to actually process the display, and while doing
so the Plugin() function would, of course, not be called, since there
is already an object on the OSD.

> Isn't it possible to use Skins.Message even with an osd already open?
> Maybe
> 
> cOsdObject *cPlugin::Popup(bool canpopup)
> 
> called regardless of an osd open (and canpopup set to false if the 
> plugin cannot create a cOsdObject)?

No. Such messages from plugins come "out of the blue", so if there
is currently a menu open, the user shouldn't be irritated by messages
that don't have anything to do with this menu.

>> or could directly display a message (even with user interaction, if
>> necessary) and retrun NULL. Of course, if a plugin's thread wants to
>> issue a message, it will have to store the message inside the plugin
>> and wait until asked through a call to its Popup() function.
>>
>> Would that be a useful solution?
> 
> 
> I think it would be useful. For example, I could use it in my actuator 
> plugin to show the dish position instead of patching vdr as I do now, 
> and as soon as the user presses a button I could close my cOsdObject and 
> reinject the key to vdr.
> But it's not a complete solution, what if more than one plugin needs to 
> show something on screen? I reckon there's no simple solution to that, 
> but maybe the solution would be implementing something like the ttxsubs 
> or subtitles patches do (something like more than one osd opened at 
> once, with only the highest priority one actually shown), or some kind 
> of windowing system...I really don't know.

Only one plugin's Popup() function will be called at a time, and if that
plugin decides to display something, it will have the OSD for itself
until it gives it up (or VDR closes it for other reasons).  The subtitle
plugins should be able to use this mechanism just as well.

Klaus



More information about the vdr mailing list