News:

Latest versions:
Server plugin: 0.5.1
MVP dongle: 0.5.2
Raspberry Pi client: 0.5.2
Windows client: 0.5.2-1

Main Menu

Patch to subtitles & OSD

Started by JTe, November 16, 2012, 17:52:47

Previous topic - Next topic

JTe

Currently when DVB subtitles are in use they do draw sometimes on top of the OSD and vice versa.

Attached patch makes up a global (and a little bit ugly) variable which is protected by mutex locks. Threads drawing OSD components or teletext pages set this variable to value "true" when objects are made visible on the OSD and when clearing the OSD screen it is set to "false".

The dvbsubtitles drawing and clearing routines will always check if the screen is clean (empty) using this variable before making changes to screen. So dvbsubtitles will not draw subtitles neither try to clear screen regions if there are visible OSD components.

After short tests it seems working and subtitles are now more usable as they do not write over on top of OSD objects.

Marten, if the patch looks ok, could you please add it to git?


MartenR

QuoteMarten, if the patch looks ok, could you please add it to git?
No, I am sorry, but I do not like the idea of global variables and global mutex.
You have to do it in the following way:

  • The VVideo??? objects include a pointer to the player object, it has the current dvbsubtitle object. So add a method to the corresponding player objects, which calls a method of dvbsubtitles to set showing subtitles as member of dvbsubtitles.
  • Using the system mutex calls directly is deprecated (and will be removed from other parts of the code some time). For new code always use the Mutex object, this makes porting easier!
  • I doubt, that a mutex is necessary at all, it is just a bool variable, concurrent access should not do any harm.
  • Note not all platforms use the main.cc, so storing global variables is not allowed there.

Marten

JTe

Ok I will make it the clean way without global variables and using a method on dvbsubtitles to set the subs on or off. I could try to do it without locking, as it should be quite safe.

JTe

Ok,

I changed the patch to work the way you told (actually it is much more simple now). I run some preliminary tests and it seems to work fine. The only thing that does not work is the teletext page that keeps wiped out by each subtitle.

MartenR

Looks fine, but I do not have time until weekend to apply it.
If it does not appear in git after the weekend remind me.

Marten

JTe

Ok, now also teletext pages are detected and subtitles can be turned on when the teletext pages are watched. No subtitles should be displayed while other objects are on the screen. When the screen is empty the subtitles will be displayed (if turned on).

Discard the previous patch and use this instead!

MartenR


hondansx

#7
What I noticed is that toggleSubtitles in vvideorec.cc is not working.


case Remote::RECORD: player->toggleSubtitles(); return 2;


If I hit the record button nothing happens. In lifetv it is working.

Could this be fixed?
GA-EP43 | headless | 1xCineS2 Dual | 1xSkystar 2.6D | VDR 1.7.37 
Frontend: 1xRasperry | 1xION3

JTe

I will look at that. I need to do some debugging as it seems that the toggleSubtitles method is in place in player.cc as in videolivetv.cc, but just does nothing in record mode.

Do you know, did the toggleSubtitles work with the old MVP vompclient?

hondansx

Quote from: JTe on January 07, 2013, 10:54:11
I will look at that. I need to do some debugging as it seems that the toggleSubtitles method is in place in player.cc as in videolivetv.cc, but just does nothing in record mode.

Do you know, did the toggleSubtitles work with the old MVP vompclient?

With my mvp this works, don't know where this got lost in the rasperry branch or maybe I do something wrong.
Thanks for investigating.
GA-EP43 | headless | 1xCineS2 Dual | 1xSkystar 2.6D | VDR 1.7.37 
Frontend: 1xRasperry | 1xION3

hondansx

GA-EP43 | headless | 1xCineS2 Dual | 1xSkystar 2.6D | VDR 1.7.37 
Frontend: 1xRasperry | 1xION3

JTe

Still in to-do list, just have to find time to set up my test environment!