honor toxav bitrate suggestions
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (push) Has been cancelled
ContinuousDelivery / windows-asan (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled
ContinuousIntegration / linux (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
This commit is contained in:
parent
6d33c6e141
commit
a800b82cff
@ -759,11 +759,34 @@ bool ToxAVVoIPModel::onEvent(const Events::FriendAudioBitrate&) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ToxAVVoIPModel::onEvent(const Events::FriendVideoBitrate& e) {
|
bool ToxAVVoIPModel::onEvent(const Events::FriendVideoBitrate& e) {
|
||||||
std::cout << "TAVVOIP: event suggests new video bitrate: " << e.video_bit_rate << " for " << e.friend_number << "\n";
|
Object oo{entt::null};
|
||||||
|
{
|
||||||
|
std::lock_guard lg{_video_sinks_mutex};
|
||||||
|
|
||||||
//_video_sinks.front()->_video_bitrate
|
// find the sink
|
||||||
|
auto it = std::find_if(_video_sinks.cbegin(), _video_sinks.cend(), [e](const auto& a){ return a->_fid == e.friend_number; });
|
||||||
|
if (it == _video_sinks.cend()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: unlock before search?
|
||||||
|
// find the object
|
||||||
|
for (auto&& [ov, tavcvs, bitrate] : _os.registry().view<ToxAVCallVideoSink*, Components::Bitrate>().each()) {
|
||||||
|
if (tavcvs != *it) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// found it
|
||||||
|
oo = ov;
|
||||||
|
|
||||||
|
bitrate.rate = e.video_bit_rate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_os.registry().valid(oo)) {
|
||||||
|
_os.throwEventUpdate(oo);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: use this info
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user