Description
I've got a time-sensitive mechanism that needs to be sure the last frame it got is actually the last one that got recorded until that moment. I'm using the start_recording
method and I'm passing an output object of a custom class I wrote that has implemented write
and flush
methods.
The write
method resembles this (it's pseudocode):
def write(self, frame):
metadata = get_state_of_current_frame()
queue.push([metadata, frame])
change_targeted_state_of_next_frame()
Basically, I'm changing the state of what the camera sees (like showing a unicorn instead of a bear in the next frame) for the next frame that it records and sends it as a parameter to the write method. What I need is the assurance that in the next frame I'll be seeing whatever the change_targeted_state_of_next_frame()
function wants it to see in the next one. Is this possible in this setting?
Hopefully, I've been as clear as possible 😃
Thank you!