-
Notifications
You must be signed in to change notification settings - Fork 288
implement layer level AUTO_LENGTH override to support AUTO play for all producers #1650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
686f853 to
4d218f4
Compare
-add layer level call with FRAMES_LEFT overrides
| foreground_ = frame_producer::empty(); | ||
| auto_play_ = false; | ||
| foreground_auto_length_override_.reset(); | ||
| background_auto_length_override_.reset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct, as we aren't disposing of background_
| background_auto_length_override_.reset(); |
| std::wstring value = boost::to_upper_copy(params[1]); | ||
| if (value == L"CLEAR" || value == L"RESET") { | ||
| foreground_auto_length_override_.reset(); | ||
| auto_play_ = false; // Disable AUTO entirely |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If doing this, there should be a way to reverse this and to re-enable auto-play with the default duration
perhaps FRAMES_LEFT AUTO would be how to do this?
| L"FRAMES_LEFT SET TO " + boost::lexical_cast<std::wstring>(frames_left_value))); | ||
| } | ||
| } catch (const boost::bad_lexical_cast&) { | ||
| return make_ready_future(std::wstring(L"ERROR: Invalid frames value")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should throw an error, otherwise AMCP will report a 2xx status code, indicating that it was ok.
| } | ||
| } | ||
|
|
||
| std::future<std::wstring> call(const std::vector<std::wstring>& params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the AMCP responses from this are unusual. They say things like AUTO PLAY NOT ACTIVE which will be annoying to parse in a library in any kind of generic way.
It would be better to simply return FRAMES_LEFT TRUE 123. While less human readable, it will be much easier to parse without needing to consider every route through the code.
| virtual std::future<void> clear_transforms() = 0; | ||
| virtual std::future<frame_transform> get_current_transform(int index) = 0; | ||
| virtual std::future<void> | ||
| load(int index, const spl::shared_ptr<frame_producer>& producer, bool preview = false, bool auto_play = false) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nicer to replace these other methods, instead of adding more with extra parameters.
The new parameter could have a default value of none, so to the couple of callsites that havent been touched in this PR could continue that way
This PR adds layer level AUTO_LENGTH to PLAY, LOADBG and LOAD to override auto play behavior at the layer level. This allows auto play functionality with infinite length producers (decklink, bluefish, looping content, etc.). Previously, infinite length producers couldn't use timed auto play since their nb_frames() returns infinity. With this change, users can now specify AUTO_LENGTH with any producer to override nb_franes. The implementation tracks separate auto_length overrides for foreground and background producers at the layer level.
This PR also adds a layer level CALL FRAMES_LEFT that allows you to query, set and clear the AUTO_LENGTH overide to augment auto play functionality at runtime.
CALL 1-0 FRAMES_LEFT 200will change the AUTO_LENGTH override so that the auto transition will occur 200 frames from when the command was executed, effectively starting a countdown clock of the specified frames. It will also set AUTO play to true if there is a background producer loaded.CALL 1-0 FRAMES LEFT CLEARwill remove any AUTO_LENGTH override and also disable auto play.notable autoplay behavior
closes #1644