[vlc-devel] Add module to pre-load a URL when VLC starts

Ron Crocker ron.crocker at nsn.com
Wed Aug 22 22:55:52 CEST 2012


I'm new here, so be nice to me please.

I'm working on a prototype and the VLC architecture is quite amenable to 
making focused changes with big impact. For this prototype, I want to 
add a module/plugin/... to VLC to load the contents of a URL prior to 
doing anything related to media. The URL request will result in a JSON 
file being returned to VLC. This JSON file contains some information 
that I'd like to share with some of the other modules. For ease of 
conversation, let's call this module "json."

How might I go about doing this? Assume that I'm a relatively competent 
programmer and I've read everything on the Wiki (as best as I could):

 1. How should json be categorized (using set_category(),
    set_subcategory(), and any other functions) to ensure that json is
    loaded and run prior to any media being accessed?
    input/input_general? Maybe a services_discovery as documented at
    http://wiki.videolan.org/Documentation:VLC_Modules_Loading (though
    that doesn't seem to exist, at least according to vlc_plugin.h, but
    on second look I see there is a modules/services_discovery directory
    that I can learn from)? Any other options. Recall that the key
    requirement is that it's loaded early.
 2. What is the "VLC way" to share the values from json to other modules?
 3. I'll have to add a JSON parsing library to my VLC build. Any hints
    on how to add that library into the build process? I don't plan to
    write this, I'm just going to download one of the many that are
    available and do something with it. (does VLC already have a JSON
    library? if so, just point me to that - I haven't run across it yet,
    but I didn't run across services_discovery until I was writing this
    email.)
 4. The URL that json loads could be one of the parameters that is
    modifiable on the command line. I kinda get that those parameters
    are defined using add_string(), add_integer(), .... Is there more
    than that?

One thing I've seen in reading some stuff on this list is that loading 
this stuff PRIOR to bringing up the UI, etc., is a little anti-social. 
It would be allowed to load json module just prior to loading another 
media source (network, disk, ...), so if that's a better option how 
would that change the categorization of json?

I know this is a lot of words, but I think I put the questions in 
priority order - answering 1 and 2 will get me a long way to solving my 
issues.

Thanks for the help.

Ron




More information about the vlc-devel mailing list