Skip to content

Commit

Permalink
Update to 8.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
xaxtix committed Mar 13, 2022
1 parent d30f796 commit 5d55275
Show file tree
Hide file tree
Showing 717 changed files with 7,503 additions and 19,770 deletions.
4 changes: 2 additions & 2 deletions TMessagesProj/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ android {
}
}

defaultConfig.versionCode = 2587
defaultConfig.versionCode = 2594

applicationVariants.all { variant ->
variant.outputs.all { output ->
Expand All @@ -319,7 +319,7 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionName "8.6.0"
versionName "8.6.1"

vectorDrawables.generatedDensities = ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi']

Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ target_compile_definitions(sqlite PUBLIC
#voip
include(${CMAKE_HOME_DIRECTORY}/voip/CMakeLists.txt)

set(NATIVE_LIB "tmessages.41")
set(NATIVE_LIB "tmessages.42")

#tmessages
add_library(${NATIVE_LIB} SHARED
Expand Down
12 changes: 3 additions & 9 deletions TMessagesProj/jni/voip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,6 @@ add_library(tgcalls STATIC
voip/webrtc/api/video/video_adaptation_counters.cc
voip/webrtc/api/video/video_frame_metadata.cc
voip/webrtc/api/voip/voip_engine_factory.cc
voip/webrtc/api/video/i444_buffer.cc
voip/webrtc/api/video/rtp_video_frame_assembler.cc
voip/webrtc/api/numerics/samples_stats_counter.cc
voip/webrtc/api/wrapping_async_dns_resolver.cc
Expand Down Expand Up @@ -1181,6 +1180,7 @@ add_library(tgcalls STATIC
voip/webrtc/modules/audio_processing/vad/vad_audio_proc.cc
voip/webrtc/modules/audio_processing/vad/vad_circular_buffer.cc
voip/webrtc/modules/audio_processing/vad/voice_activity_detector.cc
voip/webrtc/modules/audio_processing/voice_detection.cc
voip/webrtc/modules/audio_processing/optionally_built_submodule_creators.cc
voip/webrtc/modules/audio_processing/capture_levels_adjuster/capture_levels_adjuster.cc
voip/webrtc/modules/audio_processing/capture_levels_adjuster/audio_samples_scaler.cc
Expand Down Expand Up @@ -1327,7 +1327,7 @@ add_library(tgcalls STATIC
voip/webrtc/modules/video_capture/video_capture_impl.cc
voip/webrtc/modules/video_coding/codec_timer.cc
voip/webrtc/modules/video_coding/codecs/av1/libaom_av1_decoder_absent.cc
voip/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_supported.cc
voip/webrtc/modules/video_coding/codecs/av1/libaom_av1_encoder_absent.cc
voip/webrtc/modules/video_coding/codecs/h264/h264.cc
voip/webrtc/modules/video_coding/codecs/h264/h264_color_space.cc
voip/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc
Expand Down Expand Up @@ -1409,7 +1409,6 @@ add_library(tgcalls STATIC
voip/webrtc/modules/video_coding/codecs/av1/av1_svc_config.cc
voip/webrtc/modules/video_coding/nack_requester.cc
voip/webrtc/modules/video_coding/frame_buffer3.cc
voip/webrtc/modules/video_coding/frame_helpers.cc
voip/webrtc/modules/video_coding/h264_packet_buffer.cc
voip/webrtc/modules/video_processing/util/denoiser_filter.cc
voip/webrtc/modules/video_processing/util/denoiser_filter_c.cc
Expand Down Expand Up @@ -1635,12 +1634,7 @@ add_library(tgcalls STATIC
voip/webrtc/video/receive_statistics_proxy2.cc
voip/webrtc/video/call_stats2.cc
voip/webrtc/video/alignment_adjuster.cc
voip/webrtc/video/frame_buffer_proxy.cc
voip/webrtc/video/decode_synchronizer.cc
voip/webrtc/video/frame_cadence_adapter.cc
voip/webrtc/video/frame_decode_timing.cc
voip/webrtc/video/task_queue_frame_decode_scheduler.cc
voip/webrtc/video/video_receive_stream_timeout_tracker.cc
voip/webrtc/audio/audio_level.cc
voip/webrtc/audio/audio_receive_stream.cc
voip/webrtc/audio/audio_send_stream.cc
Expand Down Expand Up @@ -1786,7 +1780,7 @@ add_library(voipandroid STATIC
voip/webrtc/sdk/android/native_api/video/wrapper.cc
voip/webrtc/sdk/android/native_api/network_monitor/network_monitor.cc
voip/webrtc/sdk/android/src/jni/android_histogram.cc
voip/webrtc/sdk/android/src/jni/libaom_av1_codec.cc
voip/webrtc/sdk/android/src/jni/av1_codec.cc
voip/webrtc/sdk/android/src/jni/egl_base_10_impl.cc
voip/webrtc/sdk/android/src/jni/android_metrics.cc
voip/webrtc/sdk/android/src/jni/android_network_monitor.cc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ struct InstanceHolder {
std::unique_ptr<GroupInstanceCustomImpl> groupNativeInstance;
std::shared_ptr<tgcalls::VideoCaptureInterface> _videoCapture;
std::shared_ptr<tgcalls::VideoCaptureInterface> _screenVideoCapture;
std::shared_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> _sink;
std::shared_ptr<PlatformContext> _platformContext;
std::map<std::string, SetVideoSink> remoteGroupSinks;
bool useScreencast = false;
Expand Down Expand Up @@ -754,7 +755,8 @@ JNIEXPORT jlong JNICALL Java_org_telegram_messenger_voip_NativeInstance_makeNati
holder->nativeInstance = tgcalls::Meta::Create(v, std::move(descriptor));
holder->_videoCapture = videoCapture;
holder->_platformContext = platformContext;
holder->nativeInstance->setIncomingVideoOutput(webrtc::JavaToNativeVideoSink(env, remoteSink));
holder->_sink = webrtc::JavaToNativeVideoSink(env, remoteSink);
holder->nativeInstance->setIncomingVideoOutput(holder->_sink);
holder->nativeInstance->setNetworkType(parseNetworkType(networkType));
holder->nativeInstance->setRequestedVideoAspect(aspectRatio);
return reinterpret_cast<jlong>(holder);
Expand Down
18 changes: 9 additions & 9 deletions TMessagesProj/jni/voip/tgcalls/Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ void Manager::sendSignalingAsync(int delayMs, int cause) {
}
};
if (delayMs) {
_thread->PostDelayedTask(std::move(task), delayMs);
_thread->PostDelayedTask(RTC_FROM_HERE, std::move(task), delayMs);
} else {
_thread->PostTask(std::move(task));
_thread->PostTask(RTC_FROM_HERE, std::move(task));
}
}

void Manager::start() {
const auto weak = std::weak_ptr<Manager>(shared_from_this());
const auto thread = _thread;
const auto sendSignalingMessage = [=](Message &&message) {
thread->PostTask([=, message = std::move(message)]() mutable {
thread->PostTask(RTC_FROM_HERE, [=, message = std::move(message)]() mutable {
const auto strong = weak.lock();
if (!strong) {
return;
Expand All @@ -167,7 +167,7 @@ void Manager::start() {
rtcServers,
std::move(proxy),
[=](const NetworkManager::State &state) {
thread->PostTask([=] {
thread->PostTask(RTC_FROM_HERE, [=] {
const auto strong = weak.lock();
if (!strong) {
return;
Expand Down Expand Up @@ -200,7 +200,7 @@ void Manager::start() {
});
},
[=](DecryptedMessage &&message) {
thread->PostTask([=, message = std::move(message)]() mutable {
thread->PostTask(RTC_FROM_HERE, [=, message = std::move(message)]() mutable {
if (const auto strong = weak.lock()) {
strong->receiveMessage(std::move(message));
}
Expand All @@ -216,9 +216,9 @@ void Manager::start() {
}
};
if (delayMs) {
thread->PostDelayedTask(task, delayMs);
thread->PostDelayedTask(RTC_FROM_HERE, task, delayMs);
} else {
thread->PostTask(task);
thread->PostTask(RTC_FROM_HERE, task);
}
});
}));
Expand All @@ -232,7 +232,7 @@ void Manager::start() {
videoCapture,
sendSignalingMessage,
[=](Message &&message) {
thread->PostTask([=, message = std::move(message)]() mutable {
thread->PostTask(RTC_FROM_HERE, [=, message = std::move(message)]() mutable {
const auto strong = weak.lock();
if (!strong) {
return;
Expand Down Expand Up @@ -362,7 +362,7 @@ void Manager::getNetworkStats(std::function<void (TrafficStats, CallStats)> comp
CallStats callStats;
networkManager->fillCallStats(callStats);

thread->PostTask([weak, networkStats, completion = std::move(completion), callStats = std::move(callStats), statsLogPath = statsLogPath] {
thread->PostTask(RTC_FROM_HERE, [weak, networkStats, completion = std::move(completion), callStats = std::move(callStats), statsLogPath = statsLogPath] {
const auto strong = weak.lock();
if (!strong) {
return;
Expand Down
10 changes: 5 additions & 5 deletions TMessagesProj/jni/voip/tgcalls/MediaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ _platformContext(platformContext) {

webrtc::AudioProcessingBuilder builder;
std::unique_ptr<AudioCapturePostProcessor> audioProcessor = std::make_unique<AudioCapturePostProcessor>([this](float level) {
this->_thread->PostTask([this, level](){
this->_thread->PostTask(RTC_FROM_HERE, [this, level](){
auto strong = this;
strong->_currentMyAudioLevel = level;
});
Expand Down Expand Up @@ -436,7 +436,7 @@ void MediaManager::start() {
// Here we hope that thread outlives the sink
rtc::Thread *thread = _thread;
std::unique_ptr<AudioTrackSinkInterfaceImpl> incomingSink(new AudioTrackSinkInterfaceImpl([weak, thread](float level) {
thread->PostTask([weak, level] {
thread->PostTask(RTC_FROM_HERE, [weak, level] {
if (const auto strong = weak.lock()) {
strong->_currentAudioLevel = level;
}
Expand Down Expand Up @@ -545,7 +545,7 @@ void MediaManager::sendOutgoingMediaStateMessage() {

void MediaManager::beginStatsTimer(int timeoutMs) {
const auto weak = std::weak_ptr<MediaManager>(shared_from_this());
_thread->PostDelayedTask([weak]() {
_thread->PostDelayedTask(RTC_FROM_HERE, [weak]() {
auto strong = weak.lock();
if (!strong) {
return;
Expand All @@ -556,7 +556,7 @@ void MediaManager::beginStatsTimer(int timeoutMs) {

void MediaManager::beginLevelsTimer(int timeoutMs) {
const auto weak = std::weak_ptr<MediaManager>(shared_from_this());
_thread->PostDelayedTask([weak]() {
_thread->PostDelayedTask(RTC_FROM_HERE, [weak]() {
auto strong = weak.lock();
if (!strong) {
return;
Expand Down Expand Up @@ -653,7 +653,7 @@ void MediaManager::setSendVideo(std::shared_ptr<VideoCaptureInterface> videoCapt
const auto object = GetVideoCaptureAssumingSameThread(_videoCapture.get());
_isScreenCapture = object->isScreenCapture();
object->setStateUpdated([=](VideoState state) {
thread->PostTask([=] {
thread->PostTask(RTC_FROM_HERE, [=] {
if (const auto strong = weak.lock()) {
strong->setOutgoingVideoState(state);
}
Expand Down
2 changes: 1 addition & 1 deletion TMessagesProj/jni/voip/tgcalls/NetworkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void NetworkManager::logCurrentNetworkState() {

void NetworkManager::checkConnectionTimeout() {
const auto weak = std::weak_ptr<NetworkManager>(shared_from_this());
_thread->PostDelayedTask([weak]() {
_thread->PostDelayedTask(RTC_FROM_HERE, [weak]() {
auto strong = weak.lock();
if (!strong) {
return;
Expand Down
6 changes: 3 additions & 3 deletions TMessagesProj/jni/voip/tgcalls/ThreadLocalObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ class ThreadLocalObject {
_thread(thread),
_valueHolder(std::make_unique<ValueHolder>()) {
assert(_thread != nullptr);
_thread->PostTask([valueHolder = _valueHolder.get(), generator = std::forward<Generator>(generator)]() mutable {
_thread->PostTask(RTC_FROM_HERE, [valueHolder = _valueHolder.get(), generator = std::forward<Generator>(generator)]() mutable {
valueHolder->_value.reset(generator());
});
}

~ThreadLocalObject() {
_thread->PostTask([valueHolder = std::move(_valueHolder)](){
_thread->PostTask(RTC_FROM_HERE, [valueHolder = std::move(_valueHolder)](){
valueHolder->_value.reset();
});
}

template <typename FunctorT>
void perform(const rtc::Location& posted_from, FunctorT &&functor) {
_thread->PostTask([valueHolder = _valueHolder.get(), f = std::forward<FunctorT>(functor)]() mutable {
_thread->PostTask(posted_from, [valueHolder = _valueHolder.get(), f = std::forward<FunctorT>(functor)]() mutable {
assert(valueHolder->_value != nullptr);
f(valueHolder->_value.get());
});
Expand Down
Loading

0 comments on commit 5d55275

Please sign in to comment.