Problems encountered during the use of the function 'obs_source_update'

leif12138

New Member
...
obs_source_update(_source, _source_setting);
obs_data_release(_source_setting);
qDebug() << obs_source_get_width(_source);//output:0
std::this_thread::sleep_for(std::chrono::milliseconds(100));
qDebug() << obs_source_get_width(_source) ;//output:1920
...
I'm using obs_ source_ After calling update(), I immediately get the source width and height. It seems to be asynchronous, but I don't see any asynchronous process in the source code. What's going on? How can I know? The source has been updated so that I can obtain some of its parameters in a timely manner.
 

leif12138

New Member
...
obs_source_update(_source, _source_setting);
obs_data_release(_source_setting);
qDebug() << obs_source_get_width(_source);//output:0
std::this_thread::sleep_for(std::chrono::milliseconds(100));
qDebug() << obs_source_get_width(_source) ;//output:1920
...
I'm using obs_ source_ After calling update(), I immediately get the source width and height. It seems to be asynchronous, but I don't see any asynchronous process in the source code. What's going on? How can I know? The source has been updated so that I can obtain some of its parameters in a timely manner.
1698308177551.png
 
Top