darbyjohnston / tlRender

tlRender is an open source library for building playback and review applications for visual effects, film, and animation.
BSD 3-Clause "New" or "Revised" License
185 stars 22 forks source link

Add a std::future/std::promise to send I/O options to tlIO #118

Closed ggarra13 closed 11 months ago

ggarra13 commented 1 year ago

Currently, there's some modules that would benefit from a mechanism to send a std::map<std::string, std::string> (ioOptions?) of options to tlIO. For example, the USD reader has all sets of parameters to control its visualization that now are sent only on start up. Changing them means re-loading the file to take effect. Any thoughts on this, Darby?

darbyjohnston commented 12 months ago

This could be useful though there may be some options that only apply when opening the file, I guess they could either be ignored or the file closed and re-opened. Maybe in addition to passing the options to the constructor they could also be passed to the readVideo and readAudio functions.

However I just realized there is a bug with the options, the I/O cache does not take them into account which means they will be ignored if the requested image is already in the cache. I need to fix this first...

darbyjohnston commented 11 months ago

I fixed the bug with the cache and added the option arguments to readVideo and readAudio. Note the options passed to those functions are merged with the options passed when constructing the reader. Currently only the USD plugin is using the new functionality, I added some UI to "tlplay-gl" and "tlplay-qt" for testing it out and it seems to be working OK:

tlRender USD Options 2023-10-14

ggarra13 commented 11 months ago

I also added this to mrv2. You are also using the options in the EXR reader to read the layer.