Mailing List archive

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

[vdr] Re: REQUEST: spu/dvbspu api change .. (osd singleton problem)



Sven Goethel wrote:
> 
> dear klaus,
> 
> regarding the same problems trying to get the info,
> if an osd is in use ..
> i need the little extension for spu + dvbspu,
> as attached (you may skip the DEBUG stuff parts, if you like ;-)
> 
> the problem occurs, if dvd shows up an SPU,
> and vdr calls dvd::Hide !
> in this case, we have to shut down our own osd stuff,
> to give the callee "its" osd .. so far so good.

You (i.e. the DVD plugin) don't "give" the OSD to any "callee".
The DVD player is simply instructed to "hide" itself, which means
to give up any access to the OSD by deleting any cOsd object it might
currently have. What happens then is none of its business.

> spu/dvbspu provides Empty() allready, but it destroys too much information,
> so i made Hide(),Show(),IsVisible() public ..,
> which solves the problem.

You have also introduced cDvbSpuDecoder::getOsd(). Why would
you ever think this would be necessary? Nodody except the one
who has created the cOsd object should have access to it. So
giving away the 'osd' member is completely out of the question.

> anyway .. the osd singleton problem should being solved elsewhere,
> within the osd class, i guess this would be the most appropriate thingy ..
> 
> within the dvd-controller, i controll the osd usage with TakeOsd(object),
> isTaken(object) .. to ask for the osd (store the owner),
> and to ask if any other has taken the osd ..

What "others" would that be that you know of inside the DVD plugin?
You can't know if any other object has "taken" the OSD. Besides, I
have to admit that from briefly looking into dvd-0.3.5b02 I don't see
what all this fuss about who has "taken" the OSD is about. A cPlayerControl
is told via a call to its Hide() function when it shall seize to access the
OSD, and in case of the DVD plugin this means to delete any cOsd object it
might currently have, and tell the SPU decoder to do so as well.

> this kinda technique could provide plugins with the necessary information,
> if "their" osd is still valid !

A plugin can open an OSD either though its main menu function (in which case
it can keep it open until the cOsdObject is deleted) or via a cPlayerControl
(in which case the Hide() function will tell it when to close the OSD).
Plugins don't just create OSD "out of the blue" without coordination with
the VDR core. If they do, it's a design flaw of that particular plugin.

> please apply the patch to the next version
> ...
>                              Name: vdr-1.3.10_spu_01.diff
>    vdr-1.3.10_spu_01.diff    Type: text/x-diff
>                          Encoding: 7bit

Will do, except for the 'getOsd()' part.

Klaus




Home | Main Index | Thread Index