MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / run_helper

Function run_helper

scripting/examples.py:299–322  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

297 # Run in separate thread to avoid blocking main OBS signal handler.
298 # Operation completion will be indicated via signal completion_signal_name.
299 def run_helper(data):
300 completion_signal_name = obs.calldata_string(data, "completion_signal_name")
301 completion_id = obs.calldata_int(data, "completion_id")
302 instance_id = obs.calldata_int(data, "instance_id")
303
304 def thread_func(settings):
305 settings = obs.obs_data_create_from_json(
306 obs.calldata_string(data, "settings")
307 )
308 callback_result = callback(settings, instance_id)
309 if is_action:
310 callback_result = True
311
312 reply_data = obs.calldata_create()
313 obs.calldata_set_int(reply_data, "completion_id", completion_id)
314 obs.calldata_set_bool(reply_data, "result", callback_result)
315 signal_handler = obs.obs_get_signal_handler()
316 obs.signal_handler_signal(
317 signal_handler, completion_signal_name, reply_data
318 )
319 obs.obs_data_release(settings)
320 obs.calldata_destroy(reply_data)
321
322 threading.Thread(target=thread_func, args={data}).start()
323
324 def properties_helper(data):
325 if get_properties is not None:

Callers

nothing calls this directly

Calls 2

ThreadMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected