|
|
|
Parser refers to various components and entities responsible for analyzing a media from the time it's discovered to the point where it's exposed along with its information in the database
|
|
|
|
|
|
|
|
Pipeline overall
|
|
|
|
================
|
|
|
|
|
|
|
|
The pipeline consists or 3 steps:
|
|
|
|
* Metadata extraction
|
|
|
|
* Metadata analysis
|
|
|
|
* Linker
|
|
|
|
|
|
|
|
Those steps are linked together by the `Parser` and `ParserWorker` classes. Each step is referred to as a Parser Service, and described by the `IParserService` interface.
|
|
|
|
|
|
|
|
Parser
|
|
|
|
------
|
|
|
|
|
|
|
|
The parser is the component responsible for storing and controlling the various services. It allows the application to pause and resume the background parsing tasks, and is responsible for notifying the analysis progress to the application.
|
|
|
|
|
|
|
|
Most of its features are exposed to the applications through `IMediaLibrary` functions, however there is no public interface for the parser.
|
|
|
|
|
|
|
|
The main exposed operations are:
|
|
|
|
* `parse` which starts the parsing of a given MRL
|
|
|
|
* `pause`/`resume` which will pause/resume the pipeline (the currently executing task will complete first)
|
|
|
|
* `rescan` which will fetch all incomplete tasks and restart them (:warning: the name is misleading and should be changed)
|
|
|
|
|
|
|
|
In most cases, any operation on the parser will simply result in the same request being dispatched to all the services known by the parser.
|
|
|
|
|
|
|
|
The parser communicates with the service directly, and expects some callbacks to be invoked through the `IParserCb` interface
|
|
|
|
|
|
|
|
Parser Worker
|
|
|
|
-------------
|
|
|
|
|
|
|
|
The `ParserWorker` class exposes some common functionalities for all parser services. In itself, it is agnostic to what the service does, and will invoke the main service function (`IParserService::run`) and react to the result the service returns.
|
|
|
|
|
|
|
|
To put it simply, the `ParserWorker` is just a wrapper over a task list and dedicated thread(s) for each services
|
|
|
|
|
|
|
|
IParserService interface
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
Since some service might differ depending on the configuration, a public interface is exposed in order to allow the application to provide its own service. For now this is only needed for the extraction phase, which is implemented by libvlc for mobile applications, and by libvlccore for the desktop applications.
|
|
|
|
|
|
|
|
For the desktop application, it is VLC medialibrary module's responsability to provide an implementation of the `IParserService` that will perform the preparse and the serialization of the extracted information.
|
|
|
|
|
|
|
|
IParserCb interface
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
This interface is provided to each `ParserWorker` in order for it to communicate back to the parser.
|
|
|
|
|
|
|
|
The worker will invoke `IParserService::run` and gets a result code back. It then invokes the `IParserCb::done` function in order to continue the processing of the task, or to mark it as complete.
|
|
|
|
|
|
|
|
All in all, the `IParserCb` is currently only used to expose a subset of the parser operations. It is not available externally and isn't meant to be used directly by the services, only by the `ParserWorker`
|
|
|
|
|
|
|
|
Existing services
|
|
|
|
=================
|
|
|
|
|
|
|
|
Metadata Extraction
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Metadata Analysis
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
Linker
|
|
|
|
------
|
|
|
|
|
|
|
|
|
|
|
|
Tasks in database
|
|
|
|
================= |
|
|
\ No newline at end of file |