This merge request adds the libvlc API and core handling for tracer support.
To achieve that goal, the initial requirements have been respected on the tracing path:
It needed to provide a mechanism for non-racy tracer switching, which has been solved by imitating the log system and the use of the RCU algorithm to avoid waiting in trace() and still wait for traces to have switched to the correct variant before destroying the previous tracer.
It's still a draft since multiple questions have not been addressed. I would like to use some feedback on those before continuing, and any other point I might have missed on the way here.
I think that we could still integrate the API with a reserved field (a null-terminated array of string?) to describe the enabled traces but we need an efficient way to enable on the core side afterwards. Maybe we can:
It would mean that:
The current API exposed for libvlc completely mimics the entries present in vlc core, which is of course wrong since it's not exposed.
There would be at least two alternatives here:
In this MR, there are no way to select an existing tracer module, mostly because there is still no way to discover those modules for the libvlc application developer (like filters, sout, etc). With a discovery plugin / plugin discovery API like discussed in the workshop, it would be possible to expose endpoints to create objects matching those tracers, but a libvlc entrypoint will still be needed to assign a libvlc_tracer
object created this way. It means that the API will both have a libvlc_instance_set_tracer(object)
and libvlc_instance_set_tracer_callbacks(callbacks)
whereas the callback version could have been a dedicated creation function giving a libvlc_tracer from the beginning.
If we don't have a discovery plugin/ plugin discovery API, the question doesn't arise, but I don't have any solution for the modules, except hardcoding in the API like the logger.
VideoLAN code repository instance