Marquee extended string format support help

This forum is about all development around libVLC.
jelwell
New Cone
New Cone
Posts: 2
Joined: 12 Jul 2006 02:11

Marquee extended string format support help

Postby jelwell » 06 Apr 2020 00:35

So I want to implement the ability to have the title of the currently playing movie, as well as how much of the movie is already finished (current playback percentage). Something like "Terminator 45%".

It looks like Marquee is the correct place to start:
https://wiki.videolan.org/Documentation:Modules/marq/
Unfortunately it only supports TIME based format strings.
https://wiki.videolan.org/Documentation:Format_String/
I would like to extend Marquee to support the same expressions as --input-title-format
This would allow me to have a marquee of "$t $P%%".

I'm digging into the code, Marquee calls vlc_strftime with the text entered by the user.
https://code.videolan.org/videolan/vlc/-/blob/master/modules/spu/marq.c#L289
Here's that implementation:
https://code.videolan.org/videolan/vlc/-/blob/master/src/text/strings.c#L475

The function (vlc_strfplayer) I'd like to call is in the same file!
https://code.videolan.org/videolan/vlc/-/blob/master/src/text/strings.c#L532

However I need a vlc_player_t and a input_item_t. Although I can see from the implementation that I can pass in a null item and a valid player and the method will call vlc_player_GetCurrentMedia to get the current item for me. SOoooo, all I need is the vlc_player_t.

I'm struggling to find a way to get the vlc_player_t object. I found :
https://code.videolan.org/videolan/vlc/-/blob/master/include/vlc_player.h#L140
But that one is clearly for starting up a new VLC.
https://code.videolan.org/videolan/vlc/-/blob/master/src/playlist/player.c#L168
This one (vlc_playlist_GetPlayer) leads me deeper into a rabbit hole. Now I'd need a vlc_playlist_t.
I can get that numerous ways from
https://code.videolan.org/videolan/vlc/-/blob/master/src/interface/interface.c#L99
libvlc_GetMainPlaylist or vlc_intf_GetMainPlaylist but now I'd need a libvlc_int_t or intf_thread_t.
I still don't have either of those in marq.c nor strings.c.

I know there are others that would like this feature.
https://forum.videolan.org/viewtopic.php?t=46798

If anyone has any tips on how to get access to the types I need. Or tips on whether I should be trying to pass those objects into marq.c vs trying to create them from thin air in strings.c or marq.c. Or perhaps I'm going about this feature entirely wrong? Please let me know.
Thanks,
Joseph Elwell.

Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests