diff --git a/Telegram/SourceFiles/calls/calls_group_call.cpp b/Telegram/SourceFiles/calls/calls_group_call.cpp index fb47c903ce..988ba9599c 100644 --- a/Telegram/SourceFiles/calls/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/calls_group_call.cpp @@ -383,7 +383,14 @@ GroupCall::GroupCall( GroupCall::~GroupCall() { destroyController(); - switchToCamera(); + const auto wasScreenSharing = isScreenSharing(); + const auto weak = wasScreenSharing + ? std::weak_ptr(_videoCapture) + : std::weak_ptr(); + _videoCapture = nullptr; + if (const auto strong = weak.lock()) { + strong->switchToDevice(_videoDeviceId.toStdString()); + } } bool GroupCall::isScreenSharing() const { @@ -402,7 +409,7 @@ void GroupCall::switchToScreenSharing() { if (isScreenSharing()) { return; } - _videoDeviceId = "desktop_capturer_"; + _videoDeviceId = "desktop_capturer_screen_0"; _videoCapture->switchToDevice(_videoDeviceId.toStdString()); } diff --git a/Telegram/SourceFiles/calls/calls_group_members.cpp b/Telegram/SourceFiles/calls/calls_group_members.cpp index 1acdf4536b..a4f539583b 100644 --- a/Telegram/SourceFiles/calls/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/calls_group_members.cpp @@ -650,14 +650,16 @@ auto Row::generatePaintUserpicCallback() -> PaintRoundImageCallback { ? QSize(videoSize.width() * size / videoSize.height(), size) : QSize(size, videoSize.height() * size / videoSize.width()); const auto request = Webrtc::FrameRequest{ - .resize = resize, - .outer = QSize(size, size), + .resize = resize * cIntRetinaFactor(), + .outer = QSize(size, size) * cIntRetinaFactor(), }; const auto frame = _videoTrackShown->frame(request); auto copy = frame; // #TODO calls optimize. copy.detach(); Images::prepareCircle(copy); - p.drawImage(x, y, copy); + p.drawImage( + QRect(QPoint(x, y), copy.size() / cIntRetinaFactor()), + copy); _videoTrackShown->markFrameShown(); return; } else if (_videoTrackShown) { diff --git a/Telegram/ThirdParty/tgcalls b/Telegram/ThirdParty/tgcalls index 082b938cbf..01c03d7b4c 160000 --- a/Telegram/ThirdParty/tgcalls +++ b/Telegram/ThirdParty/tgcalls @@ -1 +1 @@ -Subproject commit 082b938cbfef6539bdf6b71f9b46f9c2b2880d24 +Subproject commit 01c03d7b4cfd7c02c79bab32cc2e688316d1a450 diff --git a/Telegram/cmake/lib_tgcalls.cmake b/Telegram/cmake/lib_tgcalls.cmake index 0d870dadec..84c1d1ce21 100644 --- a/Telegram/cmake/lib_tgcalls.cmake +++ b/Telegram/cmake/lib_tgcalls.cmake @@ -139,19 +139,6 @@ PRIVATE reference/InstanceImplReference.h ) -remove_target_sources(lib_tgcalls ${tgcalls_loc} - desktop_capturer/DesktopCaptureSource.h - desktop_capturer/DesktopCaptureSource.mm - desktop_capturer/DesktopCaptureSourceHelper.h - desktop_capturer/DesktopCaptureSourceHelper.mm - desktop_capturer/DesktopCaptureSourceManager.h - desktop_capturer/DesktopCaptureSourceManager.mm - desktop_capturer/DesktopCaptureSourceView.h - desktop_capturer/DesktopCaptureSourceView.mm - desktop_capturer/DesktopSharingCapturer.h - desktop_capturer/DesktopSharingCapturer.mm -) - target_link_libraries(lib_tgcalls PRIVATE desktop-app::external_webrtc @@ -204,7 +191,22 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") ) endif() +if (NOT APPLE) + remove_target_sources(lib_tgcalls ${tgcalls_loc} + desktop_capturer/DesktopCaptureSource.h + desktop_capturer/DesktopCaptureSource.mm + desktop_capturer/DesktopCaptureSourceHelper.h + desktop_capturer/DesktopCaptureSourceHelper.mm + desktop_capturer/DesktopCaptureSourceManager.h + desktop_capturer/DesktopCaptureSourceManager.mm + desktop_capturer/DesktopSharingCapturer.h + desktop_capturer/DesktopSharingCapturer.mm + ) +endif() + remove_target_sources(lib_tgcalls ${tgcalls_loc} + desktop_capturer/DesktopCaptureSourceView.h + desktop_capturer/DesktopCaptureSourceView.mm platform/android/AndroidContext.cpp platform/android/AndroidContext.h platform/android/AndroidInterface.cpp diff --git a/docs/building-msvc-x64.md b/docs/building-msvc-x64.md index 92e91bdb19..a1bd707227 100644 --- a/docs/building-msvc-x64.md +++ b/docs/building-msvc-x64.md @@ -145,8 +145,18 @@ Open **x64 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath*** cd win32\VS2015 msbuild opus.sln /property:Configuration=Debug /property:Platform="x64" msbuild opus.sln /property:Configuration=Release /property:Platform="x64" + cd ..\..\.. - cd ..\..\..\..\.. + git clone https://github.com/desktop-app/rnnoise.git + cd rnnoise + mkdir out + cd out + cmake -A x64 .. + cmake --build . --config Debug + cmake --build . --config Release + cd ..\.. + + cd ..\.. SET PATH_BACKUP_=%PATH% SET PATH=%cd%\ThirdParty\msys64\usr\bin;%PATH% cd Libraries\win64 diff --git a/docs/building-msvc.md b/docs/building-msvc.md index e1739f3662..c89d13ae6b 100644 --- a/docs/building-msvc.md +++ b/docs/building-msvc.md @@ -145,18 +145,18 @@ Open **x86 Native Tools Command Prompt for VS 2019.bat**, go to ***BuildPath*** cd win32\VS2015 msbuild opus.sln /property:Configuration=Debug /property:Platform="Win32" msbuild opus.sln /property:Configuration=Release /property:Platform="Win32" + cd ..\..\.. git clone https://github.com/desktop-app/rnnoise.git cd rnnoise - git checkout tdesktop mkdir out cd out cmake -A Win32 .. cmake --build . --config Debug cmake --build . --config Release - cd .. + cd ..\.. - cd ..\..\..\.. + cd .. SET PATH_BACKUP_=%PATH% SET PATH=%cd%\ThirdParty\msys64\usr\bin;%PATH% cd Libraries diff --git a/docs/building-xcode.md b/docs/building-xcode.md index f4ac055f9a..9a8269a644 100644 --- a/docs/building-xcode.md +++ b/docs/building-xcode.md @@ -97,7 +97,7 @@ Go to ***BuildPath*** and run make build_libs $MAKE_THREADS_CNT cd .. - git clone https://github.com/xiph/opus + git clone https://github.com/xiph/opus.git cd opus git checkout v1.3 ./autogen.sh @@ -106,6 +106,21 @@ Go to ***BuildPath*** and run sudo make install cd .. + git clone https://github.com/desktop-app/rnnoise.git + cd rnnoise + mkdir out + cd out + mkdir Debug + cd Debug + cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../.. + ninja + cd .. + mkdir Release + cd Release + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../.. + ninja + cd ../../.. + libiconv_ver=1.16 wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-$libiconv_ver.tar.gz tar -xvzf libiconv-$libiconv_ver.tar.gz