Page 1 of 1
Changing Subtitle Size
Posted: 14 Jul 2015 16:44
by jungleMan
Hi there,
I've dug around a lot of code trying to figure out how to change subtitle size *while* the video is playing. I've come to a conclusion that the correct way to do this is via
Code: Select all
config_PutInt(vlc_obj, "freetype-fontsize", 56);
config_GetInt will then return correctly 56, which leads me to believe that I'm on the correct path. Unfortunately, this config change doesn't propagate to the player. I've tried using config_SaveConfigFile, but nothing changed. To be honest, I'm not sure what to pass as the first parameter in config_PutInt, or what to call afterwards to make the video view update. I've tried passing the core vlc instance, the media itself, etc.
Could someone please give me a hint where to look?
Thanks in advance!
Re: Changing Subtitle Size
Posted: 15 Jul 2015 23:10
by Jean-Baptiste Kempf
You need to add a callback in the freetype module.
Re: Changing Subtitle Size
Posted: 16 Jul 2015 11:43
by jungleMan
Thank you for your response. Could you please point me to where e.g. VLC (for OS X) does this so that I can study the code?
I am using VLCKit for OS X and am trying to hack my way into more advanced stuff using some internal pointers to the libvlc, so I'm not that familiar with the entire libVLC yet - I've gone through the entire vlc_modules.h, as well as went through the text_renderer module's source code, bug haven't found a way to add a callback.
I have confirmed via module_config_get(...), however, that the value indeed makes it all the way to the module config...
Again, thanks for your answer and thank you in advance for any pointers you can give me.
Re: Changing Subtitle Size
Posted: 16 Jul 2015 13:07
by Jean-Baptiste Kempf
var_AddCallback
Re: Changing Subtitle Size
Posted: 16 Jul 2015 15:09
by jungleMan
Do you mean modifying the FreeType/Quartz CoreText text renderer module to add a callback in the Create(...) method to handle the change and change the value in the filter from there? I.e.
Code: Select all
var_AddCallback(p_filter->p_module, "quartztext-rel-fontsize", FontSizeChanged, p_filter);
?
I'm just wondering how VLC on OS X does this without these callbacks. I've searched through all OS X code and it doesn't do anything special other then use the config_PutInt(...) function and the behaviour I'm trying to achieve just works...
Re: Changing Subtitle Size
Posted: 16 Jul 2015 15:40
by Jean-Baptiste Kempf
Yes, something like that.
Re: Changing Subtitle Size
Posted: 16 Jul 2015 15:54
by jungleMan
If I manage to get this working, would you be interested in a patch file so that others can benefit from this?
Re: Changing Subtitle Size
Posted: 16 Jul 2015 16:44
by Jean-Baptiste Kempf
Yes.