Changing Subtitle Size

This forum is about all development around libVLC.
jungleMan
New Cone
New Cone
Posts: 6
Joined: 24 Jun 2015 12:02

Changing Subtitle Size

Postby jungleMan » 14 Jul 2015 16:44

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!

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Changing Subtitle Size

Postby Jean-Baptiste Kempf » 15 Jul 2015 23:10

You need to add a callback in the freetype module.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

jungleMan
New Cone
New Cone
Posts: 6
Joined: 24 Jun 2015 12:02

Re: Changing Subtitle Size

Postby jungleMan » 16 Jul 2015 11:43

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Changing Subtitle Size

Postby Jean-Baptiste Kempf » 16 Jul 2015 13:07

var_AddCallback
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

jungleMan
New Cone
New Cone
Posts: 6
Joined: 24 Jun 2015 12:02

Re: Changing Subtitle Size

Postby jungleMan » 16 Jul 2015 15:09

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...

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Changing Subtitle Size

Postby Jean-Baptiste Kempf » 16 Jul 2015 15:40

Yes, something like that.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

jungleMan
New Cone
New Cone
Posts: 6
Joined: 24 Jun 2015 12:02

Re: Changing Subtitle Size

Postby jungleMan » 16 Jul 2015 15:54

If I manage to get this working, would you be interested in a patch file so that others can benefit from this?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Changing Subtitle Size

Postby Jean-Baptiste Kempf » 16 Jul 2015 16:44

Yes.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 29 guests