Commits on Source (13)
-
vout_subpictures:RenderText() now expects the subtitle to have been rasterized, but we'll never render any text, so we want to signal that the region must be discarded. This is a bit inadequate since it means that text OSD and subtitles are not displayed at all but we probably want to refactor this part later by adding a new capability for text parsing before rendering.
f0f1a500 -
extern "C" is needed for the function that will be given to the virtual table, and namespace {} avoid exposing the constructor of the struct outside of the translation unit.
a94585f0 -
c2a4e901
-
Using a lambda avoids having a wrapper around the ops structure and simplify the usage afterwards. It's also much simpler to write.
1fa3327a -
Co-locate the error handling with the call generating the error, allowing to simplify an indentation level from the success path and improve readibility of the failible function call. We can also remove the goto, which is not a good idea in C++ because of RAII mechanisms.
3fec42b0 -
Separating the content of SelectVoice in a different function will allow to easily make use of early return and greatly simplify the final code. It also separates what is really the setup for Create() and potentially dynamic features like voice selection.
487c6539 -
0fbcfcaf
-
No functional changes.
93b1f2d6 -
Using a less generic name allows referencing that name in a debugguer or code completion tool, and prevent potential ODR when linkage is not done correctly (eg. before when no namespace{} was present).
35fc27dd -
3c59de0f
-
We use a std::unique_ptr<> to handle the lifecycle of the sys pointer with the error cases at the same time, since it will default to using `delete` and will correctly release what's being new()-ed. This pattern effectively replace the vlc_obj_malloc/free() primitive in C++ code.
3e30c375 -
Move the Speech synthesis API calls into a dedicated MTA COM thread so that it's always guaranteed that those objects live in such thread. We use a producer-consumer fifo of one slot to prevent storing the text regions inside the COM thread, and in particular prevent duplicating them, through we currently keep duplicating the last text rendered for simplicity. The setup feels weird, given that we give a single instruction to a dedicated thread and then wait for that thread to process it. But everything boils down to thread COM model being global to a thread and not local to a scope, which means that we must control in which thread the allocated COM objects will be used and released (ie. the same as the one creating them).
8d66cdea -
Move the RenderTextMTA function up to remove the forward declaration. The function is not 100% identical because an early return has been added on the check for lastString.
d277b0aa