diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-08-21 19:55:59 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-08-21 19:55:59 +0300 |
commit | 8756727a525f3c4f72d790adafb8d719dfc24a94 (patch) | |
tree | ee201c54b5e218ed449bb90c398355c0c88ffa4e | |
parent | 8f07f8e233ed5ed6c5a7b6f797d0ee7b18b652e2 (diff) | |
parent | 4bda6873ee7baac1ac34f92178d871c430da88c6 (diff) |
Merge branch 'develop' into marchcat/b-develop
# Conflicts:
# indra/newview/llvoicewebrtc.cpp
86 files changed, 529 insertions, 619 deletions
diff --git a/.clang-format b/.clang-format index 90124fb04b..f5a49845d0 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ # clang-format version 10.0.0+ Language: Cpp # BasedOnStyle: Microsoft -AccessModifierOffset: -2 +AccessModifierOffset: -4 AlignAfterOpenBracket: Align AlignConsecutiveMacros: true AlignConsecutiveAssignments: true @@ -15,14 +15,14 @@ AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Always AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All -AllowShortLambdasOnASingleLine: All +AllowShortFunctionsOnASingleLine: InlineOnly +AllowShortLambdasOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: MultiLine +AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BreakBeforeBinaryOperators: None @@ -67,7 +67,7 @@ IndentCaseLabels: true IndentGotoLabels: true IndentPPDirectives: None IndentWidth: 4 -IndentWrappedFunctionNames: false +IndentWrappedFunctionNames: true JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false @@ -91,9 +91,9 @@ PointerAlignment: Left ReflowComments: true SortIncludes: false SortUsingDeclarations: true -SpaceAfterCStyleCast: true +SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false -SpaceAfterTemplateKeyword: true +SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true @@ -102,8 +102,8 @@ SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyBlock: false SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 2 -SpacesInAngles: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: Never SpacesInContainerLiterals: false SpacesInCStyleCastParentheses: false SpacesInParentheses: false diff --git a/autobuild.xml b/autobuild.xml index 56c60e7fd6..0c91e4b13d 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -131,6 +131,16 @@ </map> <key>boost</key> <map> + <key>copyright</key> + <string>(see individual source files)</string> + <key>description</key> + <string>Boost C++ Libraries</string> + <key>license</key> + <string>boost 1.0</string> + <key>license_file</key> + <string>LICENSES/boost.txt</string> + <key>name</key> + <string>boost</string> <key>platforms</key> <map> <key>darwin64</key> @@ -138,11 +148,11 @@ <key>archive</key> <map> <key>hash</key> - <string>e86c0dba9fe7ede25fe00a1435421bce62077dc1</string> + <string>6bf5f4afddf87d48c069d781b5ef2d44d6ddf2d5</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r3/boost-1.85-darwin64-10333387089.tar.zst</string> + <string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-darwin64-10475904468.tar.zst</string> </map> <key>name</key> <string>darwin64</string> @@ -152,11 +162,11 @@ <key>archive</key> <map> <key>hash</key> - <string>30e1096fede786e5553a7c65b9d55dea9555bef3</string> + <string>3c0ba2a87e78d76c81da95fa87579bf4964242e1</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r3/boost-1.85-linux64-10333387089.tar.zst</string> + <string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-linux64-10475904468.tar.zst</string> </map> <key>name</key> <string>linux64</string> @@ -166,28 +176,18 @@ <key>archive</key> <map> <key>hash</key> - <string>e640611a7e4b245c8900048b995e243fb68b90c9</string> + <string>d1dd5d629b254d1b361c5a0fa210b5f3283e8a20</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-boost/releases/download/v1.85.0-r3/boost-1.85-windows64-10333387089.tar.zst</string> + <string>https://github.com/secondlife/3p-boost/releases/download/v1.86.0-e2bee1e/boost-1.86-windows64-10475904468.tar.zst</string> </map> <key>name</key> <string>windows64</string> </map> </map> - <key>license</key> - <string>boost 1.0</string> - <key>license_file</key> - <string>LICENSES/boost.txt</string> - <key>copyright</key> - <string>(see individual source files)</string> <key>version</key> - <string>1.85</string> - <key>name</key> - <string>boost</string> - <key>description</key> - <string>Boost C++ Libraries</string> + <string>1.86</string> </map> <key>bugsplat</key> <map> @@ -237,6 +237,14 @@ </map> <key>colladadom</key> <map> + <key>copyright</key> + <string>Copyright 2006 Sony Computer Entertainment Inc.</string> + <key>license</key> + <string>SCEA</string> + <key>license_file</key> + <string>LICENSES/collada.txt</string> + <key>name</key> + <string>colladadom</string> <key>platforms</key> <map> <key>darwin64</key> @@ -244,11 +252,11 @@ <key>archive</key> <map> <key>hash</key> - <string>ebe9defd8911b1e6d8783aebd692674845095630</string> + <string>18b46ce8ebb5ae6ef6527b4e95408433e29ad3f4</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r7/colladadom-2.3.0-r7-darwin64-10342904699.tar.zst</string> + <string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-darwin64-10476582237.tar.zst</string> </map> <key>name</key> <string>darwin64</string> @@ -258,11 +266,11 @@ <key>archive</key> <map> <key>hash</key> - <string>083f93911f6b6501fdc5a5985b2e379f3b9803cd</string> + <string>c088fe0be9ce7e42983c3c7708abe4ac8bd5a894</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r7/colladadom-2.3.0-r7-linux64-10342904699.tar.zst</string> + <string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-linux64-10476582237.tar.zst</string> </map> <key>name</key> <string>linux64</string> @@ -272,26 +280,18 @@ <key>archive</key> <map> <key>hash</key> - <string>6ba23076b439a62bb346ebaeb1656a645bf71177</string> + <string>8bfa9f1a78d077f3bd422f14ae360150b98c82f9</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r7/colladadom-2.3.0-r7-windows64-10342904699.tar.zst</string> + <string>https://github.com/secondlife/3p-colladadom/releases/download/v2.3-r8/colladadom-2.3.0-r8-windows64-10476582237.tar.zst</string> </map> <key>name</key> <string>windows64</string> </map> </map> - <key>license</key> - <string>SCEA</string> - <key>license_file</key> - <string>LICENSES/collada.txt</string> - <key>copyright</key> - <string>Copyright 2006 Sony Computer Entertainment Inc.</string> <key>version</key> - <string>2.3.0-r7</string> - <key>name</key> - <string>colladadom</string> + <string>2.3.0-r8</string> </map> <key>cubemaptoequirectangular</key> <map> @@ -739,6 +739,16 @@ </map> <key>freetype</key> <map> + <key>copyright</key> + <string>Copyright 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg.</string> + <key>description</key> + <string>Font rendering library</string> + <key>license</key> + <string>FreeType</string> + <key>license_file</key> + <string>LICENSES/freetype.txt</string> + <key>name</key> + <string>freetype</string> <key>platforms</key> <map> <key>darwin64</key> @@ -746,11 +756,11 @@ <key>archive</key> <map> <key>hash</key> - <string>df465ce3048add93f76d1f13e0f04d21b3875b74</string> + <string>51ad743c8943602913eedd2b6e2309abf46849d8</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-freetype/releases/download/v2.13.2-r1/freetype-2.13.2-r1-darwin64-10342925957.tar.zst</string> + <string>https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-darwin64-10475886095.tar.zst</string> </map> <key>name</key> <string>darwin64</string> @@ -760,11 +770,11 @@ <key>archive</key> <map> <key>hash</key> - <string>7cdc4f27dfa6424400863c746b487199b765794e</string> + <string>bc27e272e004dc2fc573550e8c1cd8b4ad07f5b2</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-freetype/releases/download/v2.13.2-r1/freetype-2.13.2-r1-linux64-10342925957.tar.zst</string> + <string>https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-linux64-10475886095.tar.zst</string> </map> <key>name</key> <string>linux64</string> @@ -774,28 +784,18 @@ <key>archive</key> <map> <key>hash</key> - <string>44788d645b3bcf9a7aaf7c3a92d609fbb2b36413</string> + <string>01971b998122a17c97e3616c428cc77077a0c39a</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-freetype/releases/download/v2.13.2-r1/freetype-2.13.2-r1-windows64-10342925957.tar.zst</string> + <string>https://github.com/secondlife/3p-freetype/releases/download/v2.13.3-cb2e120/freetype-2.13.3-cb2e120-windows64-10475886095.tar.zst</string> </map> <key>name</key> <string>windows64</string> </map> </map> - <key>license</key> - <string>FreeType</string> - <key>license_file</key> - <string>LICENSES/freetype.txt</string> - <key>copyright</key> - <string>Copyright 2006, 2007, 2008, 2009, 2010 by David Turner, Robert Wilhelm, and Werner Lemberg.</string> <key>version</key> - <string>2.13.2-r1</string> - <key>name</key> - <string>freetype</string> - <key>description</key> - <string>Font rendering library</string> + <string>2.13.3-cb2e120</string> </map> <key>glext</key> <map> @@ -863,18 +863,6 @@ </map> <key>glm</key> <map> - <key>canonical_repo</key> - <string>https://github.com/secondlife/3p-glm</string> - <key>copyright</key> - <string>Copyright (c) 2005 - G-Truc Creation</string> - <key>description</key> - <string>OpenGL Mathematics</string> - <key>license</key> - <string>MIT</string> - <key>license_file</key> - <string>LICENSES/glm_license.txt</string> - <key>name</key> - <string>glm</string> <key>platforms</key> <map> <key>common</key> @@ -892,16 +880,28 @@ <string>common</string> </map> </map> - <key>source_type</key> - <string>git</string> + <key>license</key> + <string>MIT</string> + <key>license_file</key> + <string>LICENSES/glm_license.txt</string> + <key>copyright</key> + <string>Copyright (c) 2005 - G-Truc Creation</string> + <key>version</key> + <string>v1.0.1</string> + <key>name</key> + <string>glm</string> <key>vcs_branch</key> <string>refs/tags/v1.0.1-r1</string> <key>vcs_revision</key> <string>399cd5ba57a9267a560ce07e50a0f8c5fe3dc66f</string> <key>vcs_url</key> <string>git://github.com/secondlife/3p-glm.git</string> - <key>version</key> - <string>v1.0.1</string> + <key>canonical_repo</key> + <string>https://github.com/secondlife/3p-glm</string> + <key>description</key> + <string>OpenGL Mathematics</string> + <key>source_type</key> + <string>git</string> </map> <key>gstreamer</key> <map> @@ -1516,14 +1516,6 @@ </map> <key>llphysicsextensions_source</key> <map> - <key>copyright</key> - <string>Copyright (c) 2010, Linden Research, Inc.</string> - <key>license</key> - <string>internal</string> - <key>license_file</key> - <string>LICENSES/llphysicsextensions.txt</string> - <key>name</key> - <string>llphysicsextensions_source</string> <key>platforms</key> <map> <key>darwin64</key> @@ -1575,8 +1567,16 @@ <string>windows64</string> </map> </map> + <key>license</key> + <string>internal</string> + <key>license_file</key> + <string>LICENSES/llphysicsextensions.txt</string> + <key>copyright</key> + <string>Copyright (c) 2010, Linden Research, Inc.</string> <key>version</key> <string>1.0.66e6919</string> + <key>name</key> + <string>llphysicsextensions_source</string> </map> <key>llphysicsextensions_stub</key> <map> @@ -2153,16 +2153,6 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> </map> <key>openal</key> <map> - <key>copyright</key> - <string>Copyright (C) 1999-2007 by authors.</string> - <key>description</key> - <string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string> - <key>license</key> - <string>LGPL2</string> - <key>license_file</key> - <string>LICENSES/openal-soft.txt</string> - <key>name</key> - <string>openal</string> <key>platforms</key> <map> <key>darwin64</key> @@ -2208,8 +2198,18 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <string>windows64</string> </map> </map> + <key>license</key> + <string>LGPL2</string> + <key>license_file</key> + <string>LICENSES/openal-soft.txt</string> + <key>copyright</key> + <string>Copyright (C) 1999-2007 by authors.</string> <key>version</key> <string>1.23.1</string> + <key>name</key> + <string>openal</string> + <key>description</key> + <string>OpenAL Soft is a software implementation of the OpenAL 3D audio API.</string> </map> <key>openjpeg</key> <map> @@ -2764,11 +2764,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>baabb11f324be350253b1fb58cf262c1aa19fa70</string> + <string>3570b6442d472cd97bad8622c2ec2571d72218a0</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.67-debug/webrtc-m114.5735.08.67-debug.10190042668-darwin64-10190042668.tar.zst</string> + <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-darwin64-10444682919.tar.zst</string> </map> <key>name</key> <string>darwin64</string> @@ -2778,11 +2778,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>a13776c8f99f8975665be66ff8b51a80ba46c718</string> + <string>eadf6aa99313940ded11801d42c11375669f1628</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.67-debug/webrtc-m114.5735.08.67-debug.10190042668-linux64-10190042668.tar.zst</string> + <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-linux64-10444682919.tar.zst</string> </map> <key>name</key> <string>linux64</string> @@ -2792,11 +2792,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>965ef5d65a14191a52ee9ec6a9a8a1d2ce3f2ffb</string> + <string>0081fd35290adbc8e66dd366535fb6cd8a966f1e</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.67-debug/webrtc-m114.5735.08.67-debug.10190042668-windows64-10190042668.tar.zst</string> + <string>https://github.com/secondlife/3p-webrtc-build/releases/download/m114.5735.08.72-test/webrtc-m114.5735.08.72-test.10444682919-windows64-10444682919.tar.zst</string> </map> <key>name</key> <string>windows64</string> @@ -2809,7 +2809,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>copyright</key> <string>Copyright (c) 2011, The WebRTC project authors. All rights reserved.</string> <key>version</key> - <string>m114.5735.08.67-debug.10190042668</string> + <string>m114.5735.08.72-test.10444682919</string> <key>name</key> <string>webrtc</string> <key>vcs_branch</key> @@ -2917,6 +2917,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> </map> <key>tinyexr</key> <map> + <key>copyright</key> + <string>Copyright (c) 2014 - 2021, Syoyo Fujita and many contributors.</string> + <key>description</key> + <string>tinyexr import library</string> + <key>license</key> + <string>3-clause BSD</string> + <key>license_file</key> + <string>LICENSES/tinyexr_license.txt</string> + <key>name</key> + <string>tinyexr</string> <key>platforms</key> <map> <key>common</key> @@ -2924,36 +2934,26 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string> <key>archive</key> <map> <key>hash</key> - <string>8278a2368136cb12319ca00e7aceb2829bf3ebd8</string> + <string>a9649f85e20c0b83acfd7b02ca19c1dcdd15f01e</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.8-ba4bc64/tinyexr-v1.0.8-common-9373975608.tar.zst</string> + <string>https://github.com/secondlife/3p-tinyexr/releases/download/v1.0.9-5e8947c/tinyexr-1.0.9-5e8947c-common-10475846787.tar.zst</string> </map> <key>name</key> <string>common</string> </map> </map> - <key>license</key> - <string>3-clause BSD</string> - <key>license_file</key> - <string>LICENSES/tinyexr_license.txt</string> - <key>copyright</key> - <string>Copyright (c) 2014 - 2021, Syoyo Fujita and many contributors.</string> - <key>version</key> - <string>v1.0.8</string> - <key>name</key> - <string>tinyexr</string> + <key>source_type</key> + <string>git</string> <key>vcs_branch</key> <string>dependabot/github_actions/secondlife/action-autobuild-4</string> <key>vcs_revision</key> <string>4dc4d1d90d82a22843e2adf5130f9ecb5ee5769e</string> <key>vcs_url</key> <string>https://github.com/secondlife/3p-tinyexr</string> - <key>description</key> - <string>tinyexr import library</string> - <key>source_type</key> - <string>git</string> + <key>version</key> + <string>1.0.9-5e8947c</string> </map> </map> <key>package_description</key> diff --git a/indra/cmake/Tracy.cmake b/indra/cmake/Tracy.cmake index 3339c51ba0..d54a32fdc2 100644 --- a/indra/cmake/Tracy.cmake +++ b/indra/cmake/Tracy.cmake @@ -4,11 +4,17 @@ include(Prebuilt) include_guard() add_library( ll::tracy INTERFACE IMPORTED ) -option(USE_TRACY "Use Tracy profiler." OFF) +# default Tracy profiling on for test builds, but off for all others +string(TOLOWER ${VIEWER_CHANNEL} channel_lower) +if(WINDOWS AND channel_lower MATCHES "^second life test") + option(USE_TRACY "Use Tracy profiler." ON) +else() + option(USE_TRACY "Use Tracy profiler." OFF) +endif() if (USE_TRACY) - option(USE_TRACY_ON_DEMAND "Use Tracy profiler." ON) - option(USE_TRACY_LOCAL_ONLY "Use Tracy profiler." OFF) + option(USE_TRACY_ON_DEMAND "Use on-demand Tracy profiling." ON) + option(USE_TRACY_LOCAL_ONLY "Disallow remote Tracy profiling." OFF) use_system_binary(tracy) use_prebuilt_binary(tracy) diff --git a/indra/llappearance/lllocaltextureobject.h b/indra/llappearance/lllocaltextureobject.h index 5505ef205a..a1b1178dee 100644 --- a/indra/llappearance/lllocaltextureobject.h +++ b/indra/llappearance/lllocaltextureobject.h @@ -27,8 +27,6 @@ #ifndef LL_LOCALTEXTUREOBJECT_H #define LL_LOCALTEXTUREOBJECT_H -#include <boost/shared_ptr.hpp> - #include "llpointer.h" #include "llgltexture.h" diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h index c8c566205a..25039c3e9c 100644 --- a/indra/llcommon/lldoubledispatch.h +++ b/indra/llcommon/lldoubledispatch.h @@ -30,7 +30,6 @@ #define LL_LLDOUBLEDISPATCH_H #include <list> -#include <boost/shared_ptr.hpp> #include <boost/function.hpp> #include <boost/bind.hpp> #include <boost/ref.hpp> diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index 1845fc42db..0a7b3d2046 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -32,7 +32,6 @@ #include "llpointer.h" #include "llrefcount.h" #include "boost/function.hpp" -#include "boost/shared_ptr.hpp" #include <string> class LLSD; diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 206aa51ba3..32d7b17034 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -31,7 +31,6 @@ #include <vector> #include <list> #include <boost/function.hpp> -#include <boost/shared_ptr.hpp> #include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_enum.hpp> #include <boost/unordered_map.hpp> diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index 166da8f424..39ed29c1b4 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -32,7 +32,6 @@ #include "llwin32headerslean.h" #include "llexception.h" #include "apr_thread_proc.h" -#include <boost/shared_ptr.hpp> #include <boost/ptr_container/ptr_vector.hpp> #include <boost/optional.hpp> #include <boost/noncopyable.hpp> diff --git a/indra/llcommon/llrun.h b/indra/llcommon/llrun.h index 8061117ad5..70767572ff 100644 --- a/indra/llcommon/llrun.h +++ b/indra/llcommon/llrun.h @@ -30,7 +30,6 @@ #define LL_LLRUN_H #include <vector> -#include <boost/shared_ptr.hpp> class LLRunnable; diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index be3e585ef8..375cb050cc 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -159,7 +159,8 @@ AccumulatorBufferGroup* ThreadRecorder::activate( AccumulatorBufferGroup* record ThreadRecorder::active_recording_list_t::iterator ThreadRecorder::bringUpToDate( AccumulatorBufferGroup* recording ) { #if LL_TRACE_ENABLED - if (mActiveRecordings.empty()) return mActiveRecordings.end(); + if (mActiveRecordings.empty()) + return mActiveRecordings.end(); mActiveRecordings.back()->mPartialRecording.sync(); BlockTimer::updateTimes(); @@ -202,7 +203,7 @@ ThreadRecorder::active_recording_list_t::iterator ThreadRecorder::bringUpToDate( #endif } -void ThreadRecorder::deactivate( AccumulatorBufferGroup* recording ) +void ThreadRecorder::deactivate(AccumulatorBufferGroup* recording) { #if LL_TRACE_ENABLED active_recording_list_t::iterator recording_it = bringUpToDate(recording); @@ -228,9 +229,10 @@ void ThreadRecorder::deactivate( AccumulatorBufferGroup* recording ) #endif } -ThreadRecorder::ActiveRecording::ActiveRecording( AccumulatorBufferGroup* target ) +ThreadRecorder::ActiveRecording::ActiveRecording(AccumulatorBufferGroup* target) : mTargetRecording(target) -{} +{ +} void ThreadRecorder::ActiveRecording::movePartialToTarget() { @@ -243,30 +245,30 @@ void ThreadRecorder::ActiveRecording::movePartialToTarget() // called by child thread -void ThreadRecorder::addChildRecorder( class ThreadRecorder* child ) +void ThreadRecorder::addChildRecorder(ThreadRecorder* child) { #if LL_TRACE_ENABLED - { LLMutexLock lock(&mChildListMutex); - mChildThreadRecorders.push_back(child); - } + LLMutexLock lock(&mChildListMutex); + mChildThreadRecorders.push_back(child); #endif } // called by child thread -void ThreadRecorder::removeChildRecorder( class ThreadRecorder* child ) +void ThreadRecorder::removeChildRecorder(ThreadRecorder* child) { #if LL_TRACE_ENABLED - { LLMutexLock lock(&mChildListMutex); - mChildThreadRecorders.remove(child); - } + LLMutexLock lock(&mChildListMutex); + mChildThreadRecorders.remove(child); #endif } void ThreadRecorder::pushToParent() { #if LL_TRACE_ENABLED - { LLMutexLock lock(&mSharedRecordingMutex); - LLTrace::get_thread_recorder()->bringUpToDate(&mThreadRecordingBuffers); + if (ThreadRecorder* recorder = LLTrace::get_thread_recorder()) + { + LLMutexLock lock(&mSharedRecordingMutex); + recorder->bringUpToDate(&mThreadRecordingBuffers); mSharedRecordingBuffers.append(mThreadRecordingBuffers); mThreadRecordingBuffers.reset(); } @@ -278,15 +280,14 @@ void ThreadRecorder::pullFromChildren() { #if LL_TRACE_ENABLED LL_PROFILE_ZONE_SCOPED_CATEGORY_STATS; - if (mActiveRecordings.empty()) return; - - { LLMutexLock lock(&mChildListMutex); - + if (!mActiveRecordings.empty()) + { + LLMutexLock lock(&mChildListMutex); AccumulatorBufferGroup& target_recording_buffers = mActiveRecordings.back()->mPartialRecording; target_recording_buffers.sync(); for (LLTrace::ThreadRecorder* rec : mChildThreadRecorders) - { LLMutexLock lock(&(rec->mSharedRecordingMutex)); - + { + LLMutexLock lock(&(rec->mSharedRecordingMutex)); target_recording_buffers.merge(rec->mSharedRecordingBuffers); rec->mSharedRecordingBuffers.reset(); } @@ -294,13 +295,11 @@ void ThreadRecorder::pullFromChildren() #endif } - -void set_master_thread_recorder( ThreadRecorder* recorder ) +void set_master_thread_recorder(ThreadRecorder* recorder) { sMasterThreadRecorder = recorder; } - ThreadRecorder* get_master_thread_recorder() { return sMasterThreadRecorder; diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index a3c54ffaa2..ab174a8bde 100644 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -30,8 +30,6 @@ #include <boost/bind.hpp> #include <boost/range.hpp> #include <boost/utility.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/make_shared.hpp> #include "linden_common.h" diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index c6eb0fdf75..bf661dc051 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -37,8 +37,6 @@ #include <algorithm> // std::sort() #include <stdexcept> // std headers -// external library headers -#include <boost/scoped_ptr.hpp> // other Linden headers #include "../test/lltut.h" diff --git a/indra/llcorehttp/bufferarray.h b/indra/llcorehttp/bufferarray.h index 0269d1785e..5105dbc4f7 100644 --- a/indra/llcorehttp/bufferarray.h +++ b/indra/llcorehttp/bufferarray.h @@ -30,7 +30,6 @@ #include <cstdlib> #include <vector> -#include "boost/intrusive_ptr.hpp" #include "_refcounted.h" diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 0a1c5ed101..511a17e000 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -189,13 +189,9 @@ #include "linden_common.h" // Modifies curl/curl.h interfaces #include "llsd.h" -#include "boost/intrusive_ptr.hpp" -#include "boost/shared_ptr.hpp" -#include "boost/weak_ptr.hpp" -#include "boost/function.hpp" -#include "boost/noncopyable.hpp" #include <string> #include <curl/curl.h> +#include "boost/noncopyable.hpp" namespace LLCore { diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 42f3e92257..4ec95bbcc3 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -31,7 +31,6 @@ #include "llmath.h" #include "llmemory.h" #include "llsd.h" -#include <boost/scoped_ptr.hpp> // Declare the prototype for this factory function here. It is implemented in // other files which define a LLImageJ2CImpl subclass, but only ONE static diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 2a32e10bac..19744a7f87 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -30,7 +30,6 @@ #include "llimage.h" #include "llassettype.h" #include "llmetricperformancetester.h" -#include <boost/scoped_ptr.hpp> // JPEG2000 : compression rate used in j2c conversion. const F32 DEFAULT_COMPRESSION_RATE = 1.f/8.f; diff --git a/indra/llinventory/llpermissionsflags.h b/indra/llinventory/llpermissionsflags.h index aaf1fd3afb..0ab4de0ab2 100644 --- a/indra/llinventory/llpermissionsflags.h +++ b/indra/llinventory/llpermissionsflags.h @@ -37,48 +37,48 @@ typedef U32 PermissionBit; // Do you have permission to transfer ownership of the object or // item. Fair use rules dictate that if you cannot copy, you can // always transfer. -const PermissionBit PERM_TRANSFER = (1 << 13); // 0x00002000 +constexpr PermissionBit PERM_TRANSFER = (1 << 13); // 0x00002000 // objects, scale or change textures // parcels, allow building on it -const PermissionBit PERM_MODIFY = (1 << 14); // 0x00004000 +constexpr PermissionBit PERM_MODIFY = (1 << 14); // 0x00004000 // objects, allow copy -const PermissionBit PERM_COPY = (1 << 15); // 0x00008000 +constexpr PermissionBit PERM_COPY = (1 << 15); // 0x00008000 // parcels, allow entry, deprecated -//const PermissionBit PERM_ENTER = (1 << 16); // 0x00010000 +//constexpr PermissionBit PERM_ENTER = (1 << 16); // 0x00010000 // parcels, allow terraform, deprecated -//const PermissionBit PERM_TERRAFORM = (1 << 17); // 0x00020000 +//constexpr PermissionBit PERM_TERRAFORM = (1 << 17); // 0x00020000 // NOTA BENE: This flag is NO LONGER USED!!! However, it is possible that some // objects in the universe have it set so DON"T USE IT going forward. -//const PermissionBit PERM_OWNER_DEBIT = (1 << 18); // 0x00040000 +//constexpr PermissionBit PERM_OWNER_DEBIT = (1 << 18); // 0x00040000 // objects, can grab/translate/rotate -const PermissionBit PERM_MOVE = (1 << 19); // 0x00080000 +constexpr PermissionBit PERM_MOVE = (1 << 19); // 0x00080000 // parcels, avatars take damage, deprecated //const PermissionBit PERM_DAMAGE = (1 << 20); // 0x00100000 // don't use bit 31 -- printf/scanf with "%x" assume signed numbers -const PermissionBit PERM_RESERVED = ((U32)1) << 31; +constexpr PermissionBit PERM_RESERVED = ((U32)1) << 31; -const PermissionMask PERM_NONE = 0x00000000; -const PermissionMask PERM_ALL = 0x7FFFFFFF; -//const PermissionMask PERM_ALL_PARCEL = PERM_MODIFY | PERM_ENTER | PERM_TERRAFORM | PERM_DAMAGE; -const PermissionMask PERM_ITEM_UNRESTRICTED = PERM_MODIFY | PERM_COPY | PERM_TRANSFER; +constexpr PermissionMask PERM_NONE = 0x00000000; +constexpr PermissionMask PERM_ALL = 0x7FFFFFFF; +//constexpr PermissionMask PERM_ALL_PARCEL = PERM_MODIFY | PERM_ENTER | PERM_TERRAFORM | PERM_DAMAGE; +constexpr PermissionMask PERM_ITEM_UNRESTRICTED = PERM_MODIFY | PERM_COPY | PERM_TRANSFER; // Useful stuff for transmission. // Which permissions field are we trying to change? -const U8 PERM_BASE = 0x01; +constexpr U8 PERM_BASE = 0x01; // TODO: Add another PERM_OWNER operation type for allowOperationBy DK 04/03/06 -const U8 PERM_OWNER = 0x02; -const U8 PERM_GROUP = 0x04; -const U8 PERM_EVERYONE = 0x08; -const U8 PERM_NEXT_OWNER = 0x10; +constexpr U8 PERM_OWNER = 0x02; +constexpr U8 PERM_GROUP = 0x04; +constexpr U8 PERM_EVERYONE = 0x08; +constexpr U8 PERM_NEXT_OWNER = 0x10; // This is just a quickie debugging key // no modify: PERM_ALL & ~PERM_MODIFY = 0x7fffbfff diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index a58ee045c2..1887b5cd9a 100644 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -30,7 +30,6 @@ #define LL_LLIOPIPE_H #include <boost/intrusive_ptr.hpp> -#include <boost/shared_ptr.hpp> #include "llwin32headerslean.h" #include "apr_poll.h" diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h index 6c32fa8102..7853e357f9 100644 --- a/indra/llmessage/llservice.h +++ b/indra/llmessage/llservice.h @@ -31,72 +31,10 @@ #include <string> #include <map> -//#include <boost/intrusive_ptr.hpp> -//#include <boost/shared_ptr.hpp> -//#include "llframetimer.h" #include "lliopipe.h" #include "llchainio.h" -#if 0 -class LLServiceCreator; -/** - * intrusive pointer support - */ -namespace boost -{ - void intrusive_ptr_add_ref(LLServiceCreator* p); - void intrusive_ptr_release(LLServiceCreator* p); -}; -#endif - -/** - * @class LLServiceCreator - * @brief This class is an abstract base class for classes which create - * new <code>LLService</code> instances. - * - * Derive classes from this class which appropriately implement the - * <code>operator()</code> and destructor. - * @see LLService - */ -#if 0 -class LLServiceCreator -{ -public: - typedef boost::intrusive_ptr<LLService> service_t; - virtual ~LLServiceCreator() {} - virtual service_t activate() = 0; - virtual void discard() = 0; - -protected: - LLServiceCreator() : mReferenceCount(0) - { - } - -private: - friend void boost::intrusive_ptr_add_ref(LLServiceCreator* p); - friend void boost::intrusive_ptr_release(LLServiceCreator* p); - U32 mReferenceCount; -}; -#endif - -#if 0 -namespace boost -{ - inline void intrusive_ptr_add_ref(LLServiceCreator* p) - { - ++p->mReferenceCount; - } - inline void intrusive_ptr_release(LLServiceCreator* p) - { - if(p && 0 == --p->mReferenceCount) - { - delete p; - } - } -}; -#endif - /** * @class LLService * @brief This class is the base class for the service classes. @@ -114,8 +52,6 @@ namespace boost class LLService : public LLIOPipe { public: - //typedef boost::intrusive_ptr<LLServiceCreator> creator_t; - //typedef boost::intrusive_ptr<LLService> service_t; typedef std::shared_ptr<LLChainIOFactory> creator_t; /** diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h index 178b75ab04..2bd64fafd7 100644 --- a/indra/llmessage/llstoredmessage.h +++ b/indra/llmessage/llstoredmessage.h @@ -29,7 +29,6 @@ #include "linden_common.h" #include "llsd.h" -#include <boost/shared_ptr.hpp> #include <string> diff --git a/indra/llmessage/message_string_table.cpp b/indra/llmessage/message_string_table.cpp index 6d2157eec9..084c373265 100644 --- a/indra/llmessage/message_string_table.cpp +++ b/indra/llmessage/message_string_table.cpp @@ -88,4 +88,3 @@ char* LLMessageStringTable::getString(const char *str) } return mString[hash_value]; } - diff --git a/indra/llrender/llcubemaparray.cpp b/indra/llrender/llcubemaparray.cpp index be69b997da..4f5e13765a 100644 --- a/indra/llrender/llcubemaparray.cpp +++ b/indra/llrender/llcubemaparray.cpp @@ -125,27 +125,25 @@ void LLCubeMapArray::allocate(U32 resolution, U32 components, U32 count, bool us mImage->setHasMipMaps(use_mips); bind(0); + free_cur_tex_image(); U32 format = components == 4 ? GL_RGBA16F : GL_RGB16F; - U32 mip = 0; - - free_cur_tex_image(); - - while (resolution >= 1) + U32 mip_resolution = resolution; + while (mip_resolution >= 1) { - glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, resolution, resolution, count * 6, 0, + glTexImage3D(GL_TEXTURE_CUBE_MAP_ARRAY, mip, format, mip_resolution, mip_resolution, count * 6, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); if (!use_mips) { break; } - resolution /= 2; + mip_resolution /= 2; ++mip; } - alloc_tex_image(resolution * 6, resolution, format); + alloc_tex_image(resolution, resolution, format, count * 6); mImage->setAddressMode(LLTexUnit::TAM_CLAMP); diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h index a7de20dc5c..122d2a7f9c 100644 --- a/indra/llrender/llgltexture.h +++ b/indra/llrender/llgltexture.h @@ -82,8 +82,6 @@ public: typedef enum { DELETED = 0, //removed from memory - DELETION_CANDIDATE, //ready to be removed from memory - INACTIVE, //not be used for the last certain period (i.e., 30 seconds). ACTIVE, //just being used, can become inactive if not being used for a certain time (10 seconds). NO_DELETE = 99 //stay in memory, can not be removed. } LLGLTextureState; diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 058afa0cf2..0746e21079 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -67,11 +67,12 @@ static U64 sTextureBytes = 0; // track a texture alloc on the currently bound texture. // asserts that no currently tracked alloc exists -void LLImageGLMemory::alloc_tex_image(U32 width, U32 height, U32 pixformat) +void LLImageGLMemory::alloc_tex_image(U32 width, U32 height, U32 intformat, U32 count) { U32 texUnit = gGL.getCurrentTexUnitIndex(); U32 texName = gGL.getTexUnit(texUnit)->getCurrTexture(); - U64 size = LLImageGL::dataFormatBytes(pixformat, width, height); + U64 size = LLImageGL::dataFormatBytes(intformat, width, height); + size *= count; llassert(size >= 0); @@ -291,9 +292,13 @@ S32 LLImageGL::dataFormatBits(S32 dataformat) case GL_SRGB: return 24; case GL_RGB8: return 24; case GL_RGBA: return 32; + case GL_RGBA8: return 32; case GL_SRGB_ALPHA: return 32; case GL_BGRA: return 32; // Used for QuickTime media textures on the Mac case GL_DEPTH_COMPONENT: return 24; + case GL_DEPTH_COMPONENT24: return 24; + case GL_R16F: return 16; + case GL_RG16F: return 32; case GL_RGB16F: return 48; case GL_RGBA16F: return 64; default: @@ -1384,7 +1389,7 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt sub_image_lines(target, miplevel, 0, 0, width, height, pixformat, pixtype, src, width); } } - alloc_tex_image(width, height, pixformat); + alloc_tex_image(width, height, intformat, 1); } stop_glerror(); @@ -2370,11 +2375,11 @@ bool LLImageGL::scaleDown(S32 desired_discard) gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, temp_texname, true); { LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("scaleDown - glTexImage2D"); - glTexImage2D(mTarget, 0, mFormatPrimary, desired_width, desired_height, 0, mFormatPrimary, mFormatType, NULL); + glTexImage2D(mTarget, 0, mFormatInternal, desired_width, desired_height, 0, mFormatPrimary, mFormatType, NULL); } // account for new texture getting created - alloc_tex_image(desired_width, desired_height, mFormatPrimary); + alloc_tex_image(desired_width, desired_height, mFormatInternal, 1); // Use render-to-texture to scale down the texture { @@ -2428,10 +2433,10 @@ bool LLImageGL::scaleDown(S32 desired_discard) glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, sScratchPBO); - glTexImage2D(mTarget, 0, mFormatPrimary, desired_width, desired_height, 0, mFormatPrimary, mFormatType, nullptr); + glTexImage2D(mTarget, 0, mFormatInternal, desired_width, desired_height, 0, mFormatPrimary, mFormatType, nullptr); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); - alloc_tex_image(desired_width, desired_height, mFormatPrimary); + alloc_tex_image(desired_width, desired_height, mFormatInternal, 1); if (mHasMipMaps) { diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 5073701c30..9a8d935b89 100644 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -50,7 +50,7 @@ class LLWindow; namespace LLImageGLMemory { - void alloc_tex_image(U32 width, U32 height, U32 pixformat); + void alloc_tex_image(U32 width, U32 height, U32 intformat, U32 count); void free_tex_image(U32 texName); void free_tex_images(U32 count, const U32* texNames); void free_cur_tex_image(); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 12d5c41de1..ff174d8470 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1966,6 +1966,14 @@ void LLFloater::onClickClose( LLFloater* self ) self->onClickCloseBtn(); } +// static +void LLFloater::onClickClose(LLFloater* self, bool app_quitting) +{ + if (!self) + return; + self->onClickCloseBtn(app_quitting); +} + void LLFloater::onClickCloseBtn(bool app_quitting) { closeFloater(false); diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 3d75c42f60..9be2240f6f 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -363,6 +363,7 @@ public: // } static void onClickClose(LLFloater* floater); + static void onClickClose(LLFloater* floater, bool app_quitting); static void onClickMinimize(LLFloater* floater); static void onClickTearOff(LLFloater* floater); static void onClickDock(LLFloater* floater); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 1a197f8a17..46286457cf 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -87,6 +87,7 @@ #include <boost/type_traits.hpp> #include <boost/signals2.hpp> #include <boost/range.hpp> +#include <boost/intrusive_ptr.hpp> #include "llevents.h" #include "llfunctorregistry.h" diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index 30aaec1265..a18b716003 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -31,6 +31,7 @@ add_library (llwebrtc SHARED ${llwebrtc_SOURCE_FILES}) set_target_properties(llwebrtc PROPERTIES PUBLIC_HEADER llwebrtc.h) if (WINDOWS) + cmake_policy(SET CMP0091 NEW) set_target_properties(llwebrtc PROPERTIES LINK_FLAGS "/debug /LARGEADDRESSAWARE" @@ -42,7 +43,10 @@ if (WINDOWS) wmcodecdspuuid msdmo strmiids - iphlpapi) + iphlpapi + libcmt) + # as the webrtc libraries are release, build this binary as release as well. + target_compile_options(llwebrtc PRIVATE "/MT") if (USE_BUGSPLAT) set_target_properties(llwebrtc PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}") endif (USE_BUGSPLAT) diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 2c890acbdb..0daa767766 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -206,10 +206,10 @@ void LLWebRTCImpl::init() mTuningDeviceModule->SetAudioDeviceSink(this); mTuningDeviceModule->InitMicrophone(); mTuningDeviceModule->InitSpeaker(); + mTuningDeviceModule->SetStereoRecording(false); + mTuningDeviceModule->SetStereoPlayout(true); mTuningDeviceModule->InitRecording(); mTuningDeviceModule->InitPlayout(); - mTuningDeviceModule->SetStereoRecording(true); - mTuningDeviceModule->SetStereoPlayout(true); updateDevices(); }); @@ -227,10 +227,6 @@ void LLWebRTCImpl::init() mPeerDeviceModule->EnableBuiltInAEC(false); mPeerDeviceModule->InitMicrophone(); mPeerDeviceModule->InitSpeaker(); - mPeerDeviceModule->InitRecording(); - mPeerDeviceModule->InitPlayout(); - mPeerDeviceModule->SetStereoRecording(true); - mPeerDeviceModule->SetStereoPlayout(true); }); // The custom processor allows us to retrieve audio data (and levels) @@ -251,8 +247,9 @@ void LLWebRTCImpl::init() apm_config.noise_suppression.level = webrtc::AudioProcessing::Config::NoiseSuppression::kVeryHigh; apm_config.transient_suppression.enabled = true; apm_config.pipeline.multi_channel_render = true; - apm_config.pipeline.multi_channel_capture = true; - apm_config.pipeline.multi_channel_capture = true; + apm_config.pipeline.multi_channel_capture = false; + + mAudioProcessingModule->ApplyConfig(apm_config); webrtc::ProcessingConfig processing_config; processing_config.input_stream().set_num_channels(2); @@ -264,10 +261,8 @@ void LLWebRTCImpl::init() processing_config.reverse_output_stream().set_num_channels(2); processing_config.reverse_output_stream().set_sample_rate_hz(48000); - mAudioProcessingModule->ApplyConfig(apm_config); mAudioProcessingModule->Initialize(processing_config); - mPeerConnectionFactory = webrtc::CreatePeerConnectionFactory(mNetworkThread.get(), mWorkerThread.get(), mSignalingThread.get(), @@ -279,7 +274,6 @@ void LLWebRTCImpl::init() nullptr /* audio_mixer */, mAudioProcessingModule); - mWorkerThread->BlockingCall([this]() { mPeerDeviceModule->StartPlayout(); }); } void LLWebRTCImpl::terminate() @@ -331,6 +325,8 @@ void LLWebRTCImpl::setRecording(bool recording) { if (recording) { + mPeerDeviceModule->SetStereoRecording(false); + mPeerDeviceModule->InitRecording(); mPeerDeviceModule->StartRecording(); } else @@ -340,6 +336,24 @@ void LLWebRTCImpl::setRecording(bool recording) }); } +void LLWebRTCImpl::setPlayout(bool playing) +{ + mWorkerThread->PostTask( + [this, playing]() + { + if (playing) + { + mPeerDeviceModule->SetStereoPlayout(true); + mPeerDeviceModule->InitPlayout(); + mPeerDeviceModule->StartPlayout(); + } + else + { + mPeerDeviceModule->StopPlayout(); + } + }); +} + void LLWebRTCImpl::setAudioConfig(LLWebRTCDeviceInterface::AudioConfig config) { webrtc::AudioProcessing::Config apm_config; @@ -402,7 +416,6 @@ void LLWebRTCImpl::unsetDevicesObserver(LLWebRTCDevicesObserver *observer) void ll_set_device_module_capture_device(rtc::scoped_refptr<webrtc::AudioDeviceModule> device_module, int16_t device) { - device_module->StopRecording(); #if WEBRTC_WIN if (device < 0) { @@ -417,10 +430,9 @@ void ll_set_device_module_capture_device(rtc::scoped_refptr<webrtc::AudioDeviceM // has it at 0 device_module->SetRecordingDevice(device + 1); #endif + device_module->SetStereoRecording(false); device_module->InitMicrophone(); device_module->InitRecording(); - device_module->SetStereoRecording(false); - device_module->StartRecording(); } void LLWebRTCImpl::setCaptureDevice(const std::string &id) @@ -444,18 +456,32 @@ void LLWebRTCImpl::setCaptureDevice(const std::string &id) mRecordingDevice = recordingDevice; if (mTuningMode) { - mWorkerThread->PostTask([this, recordingDevice]() { ll_set_device_module_capture_device(mTuningDeviceModule, recordingDevice); }); + mWorkerThread->PostTask([this, recordingDevice]() + { + ll_set_device_module_capture_device(mTuningDeviceModule, recordingDevice); + }); } else { - mWorkerThread->PostTask([this, recordingDevice]() { ll_set_device_module_capture_device(mPeerDeviceModule, recordingDevice); }); + mWorkerThread->PostTask([this, recordingDevice]() + { + bool recording = mPeerDeviceModule->Recording(); + if (recording) + { + mPeerDeviceModule->StopRecording(); + } + ll_set_device_module_capture_device(mPeerDeviceModule, recordingDevice); + if (recording) + { + mPeerDeviceModule->StartRecording(); + } + }); } } void ll_set_device_module_render_device(rtc::scoped_refptr<webrtc::AudioDeviceModule> device_module, int16_t device) { - device_module->StopPlayout(); #if WEBRTC_WIN if (device < 0) { @@ -468,9 +494,9 @@ void ll_set_device_module_render_device(rtc::scoped_refptr<webrtc::AudioDeviceMo #else device_module->SetPlayoutDevice(device + 1); #endif + device_module->SetStereoPlayout(true); device_module->InitSpeaker(); device_module->InitPlayout(); - device_module->SetStereoPlayout(true); } void LLWebRTCImpl::setRenderDevice(const std::string &id) @@ -506,8 +532,16 @@ void LLWebRTCImpl::setRenderDevice(const std::string &id) mWorkerThread->PostTask( [this, playoutDevice]() { + bool playing = mPeerDeviceModule->Playing(); + if (playing) + { + mPeerDeviceModule->StopPlayout(); + } ll_set_device_module_render_device(mPeerDeviceModule, playoutDevice); - mPeerDeviceModule->StartPlayout(); + if (playing) + { + mPeerDeviceModule->StartPlayout(); + } }); } } @@ -592,6 +626,8 @@ void LLWebRTCImpl::setTuningMode(bool enable) //mTuningDeviceModule->StopPlayout(); ll_set_device_module_render_device(mPeerDeviceModule, mPlayoutDevice); ll_set_device_module_capture_device(mPeerDeviceModule, mRecordingDevice); + mPeerDeviceModule->SetStereoPlayout(true); + mPeerDeviceModule->SetStereoRecording(false); mPeerDeviceModule->InitPlayout(); mPeerDeviceModule->InitRecording(); mPeerDeviceModule->StartPlayout(); @@ -635,6 +671,11 @@ LLWebRTCPeerConnectionInterface *LLWebRTCImpl::newPeerConnection() mPeerConnections.emplace_back(peerConnection); peerConnection->enableSenderTracks(!mMute); + if (mPeerConnections.empty()) + { + setRecording(true); + setPlayout(true); + } return peerConnection.get(); } @@ -649,6 +690,7 @@ void LLWebRTCImpl::freePeerConnection(LLWebRTCPeerConnectionInterface* peer_conn if (mPeerConnections.empty()) { setRecording(false); + setPlayout(false); } } @@ -662,7 +704,7 @@ void LLWebRTCImpl::freePeerConnection(LLWebRTCPeerConnectionInterface* peer_conn LLWebRTCPeerConnectionImpl::LLWebRTCPeerConnectionImpl() : mWebRTCImpl(nullptr), mPeerConnection(nullptr), - mMute(false), + mMute(true), mAnswerReceived(false) { } @@ -684,8 +726,8 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl) } void LLWebRTCPeerConnectionImpl::terminate() { - mWebRTCImpl->PostSignalingTask( - [=]() + mWebRTCImpl->SignalingBlockingCall( + [this]() { if (mPeerConnection) { diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index 9504e6573b..b93a1fdb01 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -278,6 +278,8 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, public webrtc::AudioDeviceS // enables/disables capture via the capture device void setRecording(bool recording); + void setPlayout(bool playing); + protected: LLWebRTCLogSink* mLogSink; diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 5978ab1324..346a7e3aa1 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -7.1.9 +7.1.10 diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp index 44564b7926..086f41c1cb 100644 --- a/indra/newview/gltfscenemanager.cpp +++ b/indra/newview/gltfscenemanager.cpp @@ -357,7 +357,9 @@ void GLTFSceneManager::addGLTFObject(LLViewerObject* obj, LLUUID gltf_id) if (obj->mGLTFAsset) { // object already has a GLTF asset, don't reload it - llassert(std::find(mObjects.begin(), mObjects.end(), obj) != mObjects.end()); + + // TODO: below assertion fails on dupliate requests for assets -- possibly need to touch up asset loading state machine + // llassert(std::find(mObjects.begin(), mObjects.end(), obj) != mObjects.end()); return; } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 9cd3e80f69..8f892025c9 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -40,7 +40,6 @@ #include "llcorehttputil.h" #include <boost/function.hpp> -#include <boost/shared_ptr.hpp> #include <boost/signals2.hpp> extern const bool ANIMATE; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index faa5d801dd..cd4222dddf 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -52,8 +52,6 @@ #include "llwearablelist.h" #include "llfloaterperms.h" -#include <boost/scoped_ptr.hpp> - LLAgentWearables gAgentWearables; bool LLAgentWearables::mInitialWearablesUpdateReceived = false; diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 9a5dd6dca3..7b456cc542 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -408,8 +408,6 @@ extern LLVector3 gRelativeWindVec; extern U32 gPacketsIn; extern bool gPrintMessagesThisFrame; -extern LLUUID gBlackSquareID; - extern bool gRandomizeFramerate; extern bool gPeriodicSlowFrame; diff --git a/indra/newview/llchannelmanager.h b/indra/newview/llchannelmanager.h index 7a4899f1f3..4db7f32b10 100644 --- a/indra/newview/llchannelmanager.h +++ b/indra/newview/llchannelmanager.h @@ -33,7 +33,6 @@ #include "lluuid.h" #include <map> -#include <boost/shared_ptr.hpp> namespace LLNotificationsUI { diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index cb2370f413..b19b6f8dec 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -98,10 +98,7 @@ LLConversationViewSession::~LLConversationViewSession() if (mVoiceClientObserver) { - if (LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(mVoiceClientObserver); - } + LLVoiceClient::removeObserver(mVoiceClientObserver); delete mVoiceClientObserver; } @@ -259,16 +256,15 @@ bool LLConversationViewSession::postBuild() icon->setVisible(true); mSpeakingIndicator->setSpeakerId(gAgentID, LLUUID::null, true); mIsInActiveVoiceChannel = true; - if(LLVoiceClient::instanceExists()) - { + if (mVoiceClientObserver) { - LLVoiceClient::getInstance()->removeObserver(mVoiceClientObserver); + LLVoiceClient::removeObserver(mVoiceClientObserver); delete mVoiceClientObserver; } mVoiceClientObserver = new LLNearbyVoiceClientStatusObserver(this); - LLVoiceClient::getInstance()->addObserver(mVoiceClientObserver); - } + LLVoiceClient::addObserver(mVoiceClientObserver); + break; } default: diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ec70c7ebc0..95f96e85d6 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -62,8 +62,6 @@ S32 LLDrawPoolAvatar::sShadowPass = -1; S32 LLDrawPoolAvatar::sDiffuseChannel = 0; F32 LLDrawPoolAvatar::sMinimumAlpha = 0.2f; -LLUUID gBlackSquareID; - static bool is_deferred_render = false; static bool is_post_deferred_render = false; diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index c3d1f8d270..82a0bfb9bb 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -351,8 +351,6 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture) return; } - llassert(mTexture[ch].notNull()); - if (ch == LLRender::DIFFUSE_MAP) { getViewerObject()->changeTEImage(mTEOffset, new_texture) ; diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index b6f1eea802..7d098b2676 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -775,7 +775,7 @@ bool LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) } } - if (volume->mDrawable.isNull()) + if (volume->mDrawable.isNull() || volume->mDrawable->isDead()) { return true; // No update to complete } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 08e13276b3..abf15ea9cf 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -112,6 +112,18 @@ LLFloaterIMContainer::~LLFloaterIMContainer() { LLIMMgr::getInstance()->removeSessionObserver(this); } + + for (auto& session : mConversationsItems) + { + LLConversationItemSession* session_model = dynamic_cast<LLConversationItemSession*>(session.second.get()); + if (session_model) + { + // Models have overcomplicated double ownership, clear + // and resolve '0 references' ownership now, before owned + // part of the models gets deleted by their owners + session_model->clearAndDeparentModels(); + } + } } void LLFloaterIMContainer::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, bool has_offline_msg) @@ -2432,7 +2444,7 @@ void LLFloaterIMContainer::closeHostedFloater() onClickCloseBtn(); } -void LLFloaterIMContainer::closeAllConversations() +void LLFloaterIMContainer::closeAllConversations(bool app_quitting) { std::vector<LLUUID> ids; for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++) @@ -2447,7 +2459,7 @@ void LLFloaterIMContainer::closeAllConversations() for (std::vector<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it) { LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(*it); - LLFloater::onClickClose(conversationFloater); + LLFloater::onClickClose(conversationFloater, app_quitting); } } @@ -2470,7 +2482,7 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) { if(app_quitting) { - closeAllConversations(); + closeAllConversations(app_quitting); onClickCloseBtn(app_quitting); } else diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index e11445d779..d1cfd3442c 100644 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -117,7 +117,7 @@ public: void assignResizeLimits(); virtual bool handleKeyHere(KEY key, MASK mask ); /*virtual*/ void closeFloater(bool app_quitting = false); - void closeAllConversations(); + void closeAllConversations(bool app_quitting); void closeSelectedConversations(const uuid_vec_t& ids); /*virtual*/ bool isFrontmost(); diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp index 5dd78fe1db..557b3f27c5 100644 --- a/indra/newview/llfloaterimsession.cpp +++ b/indra/newview/llfloaterimsession.cpp @@ -138,8 +138,14 @@ void LLFloaterIMSession::onTearOffClicked() } // virtual -void LLFloaterIMSession::onClickCloseBtn(bool) +void LLFloaterIMSession::onClickCloseBtn(bool app_qutting) { + if (app_qutting) + { + LLFloaterIMSessionTab::onClickCloseBtn(); + return; + } + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); if (session != NULL) @@ -287,10 +293,8 @@ void LLFloaterIMSession::sendMsg(const std::string& msg) LLFloaterIMSession::~LLFloaterIMSession() { mVoiceChannelStateChangeConnection.disconnect(); - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } + + LLVoiceClient::removeObserver(this); LLTransientFloaterMgr::getInstance()->removeControlView(LLTransientFloaterMgr::IM, this); @@ -366,7 +370,7 @@ bool LLFloaterIMSession::postBuild() childSetAction("voice_call_btn", boost::bind(&LLFloaterIMSession::onCallButtonClicked, this)); - LLVoiceClient::getInstance()->addObserver(this); + LLVoiceClient::addObserver(this); //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" //see LLFloaterIMPanel for how it is done (IB) @@ -537,6 +541,7 @@ void LLFloaterIMSession::boundVoiceChannel() LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); if(voice_channel) { + mVoiceChannelStateChangeConnection.disconnect(); mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback( boost::bind(&LLFloaterIMSession::onVoiceChannelStateChanged, this, _1, _2)); diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 2eebb6cc64..2621ce576c 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -547,6 +547,12 @@ void LLFloaterIMSessionTab::closeFloater(bool app_quitting) super::closeFloater(app_quitting); } +void LLFloaterIMSessionTab::deleteAllChildren() +{ + super::deleteAllChildren(); + mVoiceButton = NULL; +} + std::string LLFloaterIMSessionTab::appendTime() { std::string timeStr = "[" + LLTrans::getString("TimeHour") + "]:" diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h index 29e10184b1..6dd8e62482 100644 --- a/indra/newview/llfloaterimsessiontab.h +++ b/indra/newview/llfloaterimsessiontab.h @@ -82,6 +82,7 @@ public: /*virtual*/ void setVisible(bool visible); /*virtual*/ void setFocus(bool focus); /*virtual*/ void closeFloater(bool app_quitting = false); + /*virtual*/ void deleteAllChildren(); // Handle the left hand participant list widgets void addConversationViewParticipant(LLConversationItem* item, bool update_view = true); diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index df4526e69d..891e16a8ef 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -335,6 +335,8 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context) { if (!LLClipboard::instance().hasContents()) return false; + if (gInventory.isObjectDescendentOf(selected.front(), gInventory.getLibraryRootFolderID())) + return false; std::vector<LLUUID> ids; LLClipboard::instance().pasteFromClipboard(ids); diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 7c49db9c54..990a299c50 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -64,7 +64,6 @@ // Boost (for linux/unix command-line execv) #include <boost/tokenizer.hpp> -#include <boost/shared_ptr.hpp> // External utility #include <string> diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 33e6d2d1b2..136b59f3a6 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3861,6 +3861,11 @@ bool LLIMMgr::startCall(const LLUUID& session_id, LLVoiceChannel::EDirection dir { voice_channel->setChannelInfo(voice_channel_info); } + else if (voice_channel->getState() < LLVoiceChannel::STATE_READY) + { + // restart if there wa an error or it was hang up + voice_channel->resetChannelInfo(); + } voice_channel->setCallDirection(direction); voice_channel->activate(); return true; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 65acf8ea52..ca84c30b66 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -85,8 +85,6 @@ #include "llenvironment.h" -#include <boost/shared_ptr.hpp> - void copy_slurl_to_clipboard_callback_inv(const std::string& slurl); const F32 SOUND_GAIN = 1.0f; diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index f37926a938..c54d2c080f 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -57,7 +57,6 @@ #include "llsdserialize.h" #include "lltrans.h" -#include <boost/scoped_ptr.hpp> #include <boost/regex.hpp> #include <sstream> diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 0ec7b3bb24..624408d46d 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -29,7 +29,6 @@ #include "lleventdispatcher.h" #include "lleventapi.h" -#include <boost/scoped_ptr.hpp> #include <boost/function.hpp> #include <memory> // std::shared_ptr #include "llsecapi.h" diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 079a5583d4..65aa1876b0 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -98,10 +98,7 @@ LLPanelGroup::LLPanelGroup() LLPanelGroup::~LLPanelGroup() { LLGroupMgr::getInstance()->removeObserver(this); - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } + LLVoiceClient::removeObserver(this); } void LLPanelGroup::onOpen(const LLSD& key) @@ -196,7 +193,7 @@ bool LLPanelGroup::postBuild() mJoinText = panel_general->getChild<LLUICtrl>("join_cost_text"); } - LLVoiceClient::getInstance()->addObserver(this); + LLVoiceClient::addObserver(this); return true; } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 00fd17badf..a1bf25fb05 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -30,7 +30,6 @@ #include "llpanel.h" #include "llpointer.h" // LLPointer<> #include "llmediactrl.h" // LLMediaCtrlObserver -#include <boost/scoped_ptr.hpp> class LLLineEditor; class LLUIImage; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 8334da1836..2466ee5973 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -239,11 +239,6 @@ bool LLPanelMainInventory::postBuild() } } - mParentSidepanel = getParentSidepanelInventory(); - if (mParentSidepanel) - { - mInboxPanel = mParentSidepanel->getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); - } mFilterEditor = getChild<LLFilterEditor>("inventory search editor"); if (mFilterEditor) diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index c1c7e9a7ab..3347ab904b 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -139,6 +139,9 @@ public: LLInventoryFilter& getCurrentFilter(); + void setParentSidepanel(LLSidepanelInventory* parent_sidepanel) { mParentSidepanel = parent_sidepanel; } + void setInboxPanel(LLPanelMarketplaceInbox* inbox_panel) { mInboxPanel = inbox_panel; } + protected: // // Misc functions diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 107b1cf6cd..25672db318 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -336,7 +336,7 @@ public: LLAvatarTracker::instance().addObserver(this); // For notification when SIP online status changes. - LLVoiceClient::getInstance()->addObserver(this); + LLVoiceClient::addObserver(this); mInvObserver = new LLInventoryFriendCardObserver(this); } @@ -344,10 +344,7 @@ public: { // will be deleted by ~LLInventoryModel //delete mInvObserver; - if (LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } + LLVoiceClient::removeObserver(this); LLAvatarTracker::instance().removeObserver(this); } @@ -575,15 +572,13 @@ LLPanelPeople::~LLPanelPeople() delete mFriendListUpdater; delete mRecentListUpdater; + LLVoiceClient::removeObserver(this); + mNearbyFilterCommitConnection.disconnect(); mFriedsFilterCommitConnection.disconnect(); mGroupsFilterCommitConnection.disconnect(); mRecentFilterCommitConnection.disconnect(); - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } } void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list) @@ -740,7 +735,7 @@ bool LLPanelPeople::postBuild() // Must go after setting commit callback and initializing all pointers to children. mTabContainer->selectTabByName(NEARBY_TAB_NAME); - LLVoiceClient::getInstance()->addObserver(this); + LLVoiceClient::addObserver(this); // call this method in case some list is empty and buttons can be in inconsistent state updateButtons(); diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 8f44b28ebe..08605f7cf4 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -703,10 +703,7 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife() LLAvatarTracker::instance().removeParticularFriendObserver(getAvatarId(), this); } - if (LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); - } + LLVoiceClient::removeObserver((LLVoiceClientStatusObserver*)this); if (mAvatarNameCacheConnection.connected()) { @@ -1055,7 +1052,7 @@ void LLPanelProfileSecondLife::fillAccountStatus(const LLAvatarData* avatar_data std::string caption_text = getString("CaptionTextAcctInfo", args); getChild<LLUICtrl>("account_info")->setValue(caption_text); - const S32 LINDEN_EMPLOYEE_INDEX = 3; + constexpr S32 LINDEN_EMPLOYEE_INDEX = 3; LLDate sl_release; sl_release.fromYMDHMS(2003, 6, 23, 0, 0, 0); std::string customer_lower = avatar_data->customer_type; @@ -1120,7 +1117,7 @@ void LLPanelProfileSecondLife::fillRightsData() // If true - we are viewing friend's profile, enable check boxes and set values. if (relation) { - S32 rights = relation->getRightsGrantedTo(); + const S32 rights = relation->getRightsGrantedTo(); bool can_see_online = LLRelationship::GRANT_ONLINE_STATUS & rights; bool can_see_on_map = LLRelationship::GRANT_MAP_LOCATION & rights; bool can_edit_objects = LLRelationship::GRANT_MODIFY_OBJECTS & rights; @@ -1250,7 +1247,7 @@ void LLPanelProfileSecondLife::setAvatarId(const LLUUID& avatar_id) void LLPanelProfileSecondLife::updateOnlineStatus() { const LLRelationship* relationship = LLAvatarTracker::instance().getBuddyInfo(getAvatarId()); - if (relationship != NULL) + if (relationship) { // For friend let check if he allowed me to see his status bool online = relationship->isOnline(); @@ -1331,7 +1328,7 @@ void LLProfileImagePicker::notify(const std::vector<std::string>& filenames) // generate a temp texture file for coroutine std::string temp_file = gDirUtilp->getTempFilename(); U32 codec = LLImageBase::getCodecFromExtension(gDirUtilp->getExtension(file_path)); - const S32 MAX_DIM = 256; + constexpr S32 MAX_DIM = 256; if (!LLViewerTextureList::createUploadFile(file_path, temp_file, codec, MAX_DIM)) { LLSD notif_args; @@ -1645,7 +1642,7 @@ void LLPanelProfileSecondLife::onDiscardDescriptionChanges() void LLPanelProfileSecondLife::onShowAgentPermissionsDialog() { - LLFloater *floater = mFloaterPermissionsHandle.get(); + LLFloater* floater = mFloaterPermissionsHandle.get(); if (!floater) { LLFloater* parent_floater = gFloaterView->getParentFloater(this); @@ -1673,7 +1670,7 @@ void LLPanelProfileSecondLife::onShowAgentProfileTexture() return; } - LLFloater *floater = mFloaterProfileTextureHandle.get(); + LLFloater* floater = mFloaterProfileTextureHandle.get(); if (!floater) { LLFloater* parent_floater = gFloaterView->getParentFloater(this); @@ -1783,17 +1780,20 @@ void LLPanelProfileSecondLife::onCommitProfileImage(const LLUUID& id) mSecondLifePic->setValue(id); - LLFloater *floater = mFloaterProfileTextureHandle.get(); + LLFloater* floater = mFloaterProfileTextureHandle.get(); if (floater) { - LLFloaterProfileTexture * texture_view = dynamic_cast<LLFloaterProfileTexture*>(floater); - if (id == LLUUID::null) + LLFloaterProfileTexture* texture_view = dynamic_cast<LLFloaterProfileTexture*>(floater); + if (texture_view) { - texture_view->resetAsset(); - } - else - { - texture_view->loadAsset(id); + if (id.isNull()) + { + texture_view->resetAsset(); + } + else + { + texture_view->loadAsset(id); + } } } } @@ -1803,8 +1803,9 @@ void LLPanelProfileSecondLife::onCommitProfileImage(const LLUUID& id) LLPanelProfileWeb::LLPanelProfileWeb() : LLPanelProfileTab() - , mWebBrowser(NULL) + , mWebBrowser(nullptr) , mAvatarNameCacheConnection() + , mFirstNavigate(false) { } diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 5e7bc4fb3b..84a62b3cbf 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -35,7 +35,6 @@ #include <boost/bind.hpp> #include <boost/function.hpp> -#include <boost/shared_ptr.hpp> #include <boost/signals2.hpp> #include "llagent.h" diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 18b6a31845..d838a1a51c 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -29,7 +29,6 @@ #include <string> -#include <boost/shared_ptr.hpp> #include <boost/function.hpp> #include <boost/signals2.hpp> diff --git a/indra/newview/llpathfindingnavmeshzone.cpp b/indra/newview/llpathfindingnavmeshzone.cpp index 012cc11eee..e9ef170176 100644 --- a/indra/newview/llpathfindingnavmeshzone.cpp +++ b/indra/newview/llpathfindingnavmeshzone.cpp @@ -30,20 +30,9 @@ #include "llpathfindingnavmeshzone.h" -#include <vector> - -#include <boost/bind.hpp> -#include <boost/function.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/signals2.hpp> - #include "llagent.h" #include "llpathfindingmanager.h" -#include "llpathfindingnavmesh.h" -#include "llpathfindingnavmeshstatus.h" #include "llpathinglib.h" -#include "llsd.h" -#include "lluuid.h" #include "llviewercontrol.h" #include "llviewerregion.h" diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index a2c8691391..e770efa0d0 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -29,7 +29,6 @@ #include <vector> -#include <boost/shared_ptr.hpp> #include <boost/function.hpp> #include <boost/signals2.hpp> diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index 17f12efd83..79a796dd60 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -29,7 +29,6 @@ #include <string> -#include <boost/shared_ptr.hpp> #include <boost/function.hpp> #include <boost/signals2.hpp> diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 654423183e..cfcd43dc1d 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -30,8 +30,6 @@ #include <string> #include <map> -#include <boost/shared_ptr.hpp> - #include "llpathfindingobject.h" class LLPathfindingObjectList; diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp index 3526004071..f083747bfe 100644 --- a/indra/newview/llreflectionmapmanager.cpp +++ b/indra/newview/llreflectionmapmanager.cpp @@ -80,6 +80,9 @@ void load_exr(const std::string& filename) gGL.getTexUnit(0)->bind(gEXRImage); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGBA, GL_FLOAT, out); + + LLImageGLMemory::alloc_tex_image(width, height, GL_RGB16F, 1); + free(out); // release memory of image data glGenerateMipmap(GL_TEXTURE_2D); diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 22fb41e559..651483dbe3 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -30,7 +30,6 @@ #include "lltoast.h" #include <map> -#include <boost/shared_ptr.hpp> namespace LLNotificationsUI { diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9b7289df67..5693f2808c 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -161,6 +161,8 @@ bool LLSidepanelInventory::postBuild() mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); + mPanelMainInventory->setParentSidepanel(this); + mPanelMainInventory->setInboxPanel(getChild<LLPanelMarketplaceInbox>("marketplace_inbox")); //LLTabContainer* tabs = mPanelMainInventory->getChild<LLTabContainer>("inventory filter tabs"); //tabs->setCommitCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this)); diff --git a/indra/newview/llspeakingindicatormanager.cpp b/indra/newview/llspeakingindicatormanager.cpp index ca99d351bb..a9ef5e244d 100644 --- a/indra/newview/llspeakingindicatormanager.cpp +++ b/indra/newview/llspeakingindicatormanager.cpp @@ -182,7 +182,7 @@ void SpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker SpeakingIndicatorManager::SpeakingIndicatorManager() { LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1)); - LLVoiceClient::getInstance()->addObserver(this); + LLVoiceClient::addObserver(this); } SpeakingIndicatorManager::~SpeakingIndicatorManager() @@ -193,10 +193,7 @@ void SpeakingIndicatorManager::cleanupSingleton() { // Don't use LLVoiceClient::getInstance() here without a check, // singleton MAY have already been destroyed. - if (LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } + LLVoiceClient::removeObserver(this); } void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/) diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 9eaee2e326..bda53f66eb 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -525,9 +525,9 @@ void LLGLTexMemBar::draw() F64 raw_image_bytes_MB = raw_image_bytes / (1024.0 * 1024.0); F64 saved_raw_image_bytes_MB = saved_raw_image_bytes / (1024.0 * 1024.0); F64 aux_raw_image_bytes_MB = aux_raw_image_bytes / (1024.0 * 1024.0); - F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 1024.0 * 1.3333f; // add 33% for mipmaps - F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 1024.0; - F64 render_bytes_alloc = LLRenderTarget::sBytesAllocated / 1024.0 / 1024.0; + F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 512.0; + F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 512.0; + F64 render_bytes_alloc = LLRenderTarget::sBytesAllocated / 1024.0 / 512.0; //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; @@ -579,7 +579,7 @@ void LLGLTexMemBar::draw() texture_bytes_alloc, vertex_bytes_alloc, render_bytes_alloc, - texture_bytes_alloc+vertex_bytes_alloc+render_bytes_alloc); + texture_bytes_alloc+vertex_bytes_alloc); LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height * 6, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -836,7 +836,7 @@ void LLTextureView::draw() for (LLViewerTextureList::image_list_t::iterator iter = gTextureList.mImageList.begin(); iter != gTextureList.mImageList.end(); ) { - LLPointer<LLViewerFetchedTexture> imagep = *iter++; + LLViewerFetchedTexture* imagep = *iter++; if(!imagep->hasFetcher()) { continue ; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 50171ffcb0..d76c033ef3 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1755,9 +1755,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ bool javascript_enabled = gSavedSettings.getBOOL("BrowserJavascriptEnabled"); media_source->setJavascriptEnabled(javascript_enabled || clean_browser); - // collect 'web security disabled' (see Chrome --web-security-disabled) setting from prefs and send to embedded browser - bool web_security_disabled = gSavedSettings.getBOOL("BrowserWebSecurityDisabled"); - media_source->setWebSecurityDisabled(web_security_disabled || clean_browser); + media_source->setWebSecurityDisabled(clean_browser); // collect setting indicates if local file access from file URLs is allowed from prefs and send to embedded browser bool file_access_from_file_urls = gSavedSettings.getBOOL("BrowserFileAccessFromFileUrls"); diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 7c8067ede3..a857887247 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -42,10 +42,7 @@ #include <functional> #include <map> #include <set> - -#ifdef LL_WINDOWS -#pragma warning (3 : 4702) // we like level 3, not 4 -#endif +#include <vector> // Library headers from llcommon project: #include "indra_constants.h" diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 98da378c0d..4922df6738 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -497,11 +497,10 @@ void LLViewerTexture::updateClass() F64 texture_bytes_alloc = LLImageGL::getTextureBytesAllocated() / 1024.0 / 512.0; F64 vertex_bytes_alloc = LLVertexBuffer::getBytesAllocated() / 1024.0 / 512.0; - F64 render_bytes_alloc = LLRenderTarget::sBytesAllocated / 1024.0 / 512.0; // get an estimate of how much video memory we're using // NOTE: our metrics miss about half the vram we use, so this biases high but turns out to typically be within 5% of the real number - F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc + render_bytes_alloc); + F32 used = (F32)ll_round(texture_bytes_alloc + vertex_bytes_alloc); F32 budget = max_vram_budget == 0 ? (F32)gGLManager.mVRAM : (F32)max_vram_budget; @@ -846,7 +845,7 @@ S32 LLViewerTexture::getTotalNumFaces() const S32 LLViewerTexture::getNumFaces(U32 ch) const { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); - return mNumFaces[ch]; + return ch < LLRender::NUM_TEXTURE_CHANNELS ? mNumFaces[ch] : 0; } @@ -1083,8 +1082,6 @@ void LLViewerFetchedTexture::init(bool firstinit) mKeptSavedRawImageTime = 0.f; mLastCallBackActiveTime = 0.f; mForceCallbackFetch = false; - mInDebug = false; - mUnremovable = false; mFTType = FTT_UNKNOWN; } @@ -1234,32 +1231,6 @@ bool LLViewerFetchedTexture::isDeleted() return mTextureState == DELETED; } -bool LLViewerFetchedTexture::isInactive() -{ - return mTextureState == INACTIVE; -} - -bool LLViewerFetchedTexture::isDeletionCandidate() -{ - return mTextureState == DELETION_CANDIDATE; -} - -void LLViewerFetchedTexture::setDeletionCandidate() -{ - if(mGLTexturep.notNull() && mGLTexturep->getTexName() && (mTextureState == INACTIVE)) - { - mTextureState = DELETION_CANDIDATE; - } -} - -//set the texture inactive -void LLViewerFetchedTexture::setInactive() -{ - if(mTextureState == ACTIVE && mGLTexturep.notNull() && mGLTexturep->getTexName() && !mGLTexturep->getBoundRecently()) - { - mTextureState = INACTIVE; - } -} bool LLViewerFetchedTexture::isFullyLoaded() const { @@ -1778,20 +1749,6 @@ S32 LLViewerFetchedTexture::getCurrentDiscardLevelForFetching() return current_discard; } -bool LLViewerFetchedTexture::setDebugFetching(S32 debug_level) -{ - if(debug_level < 0) - { - mInDebug = false; - return false; - } - mInDebug = true; - - mDesiredDiscardLevel = debug_level; - - return true; -} - bool LLViewerFetchedTexture::isActiveFetching() { static LLCachedControl<bool> monitor_enabled(gSavedSettings,"DebugShowTextureInfo"); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index ada818c220..9046daeab2 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -146,8 +146,6 @@ public: virtual F32 getMaxVirtualSize() ; - LLFrameTimer* getLastReferencedTimer() {return &mLastReferencedTimer ;} - S32 getFullWidth() const { return mFullWidth; } S32 getFullHeight() const { return mFullHeight; } /*virtual*/ void setKnownDrawSize(S32 width, S32 height); @@ -197,7 +195,6 @@ protected: mutable F32 mMaxVirtualSize = 0.f; // The largest virtual size of the image, in pixels - how much data to we need? mutable S32 mMaxVirtualSizeResetCounter; mutable S32 mMaxVirtualSizeResetInterval; - LLFrameTimer mLastReferencedTimer; ll_face_list_t mFaceList[LLRender::NUM_TEXTURE_CHANNELS]; //reverse pointer pointing to the faces using this image as texture U32 mNumFaces[LLRender::NUM_TEXTURE_CHANNELS]; @@ -339,11 +336,6 @@ public: void setBoostLevel(S32 level) override; bool updateFetch(); - bool setDebugFetching(S32 debug_level); - bool isInDebug() const { return mInDebug; } - - void setUnremovable(bool value) { mUnremovable = value; } - bool isUnremovable() const { return mUnremovable; } void clearFetchedResults(); //clear all fetched results, for debug use. @@ -378,10 +370,6 @@ public: const std::string& getUrl() const {return mUrl;} //--------------- bool isDeleted() ; - bool isInactive() ; - bool isDeletionCandidate(); - void setDeletionCandidate() ; - void setInactive() ; bool getUseDiscard() const { return mUseMipMaps && !mDontDiscard; } //--------------- @@ -434,8 +422,6 @@ private: private: bool mFullyLoaded; - bool mInDebug; - bool mUnremovable; bool mInFastCacheList; bool mForceCallbackFetch; @@ -586,6 +572,10 @@ public: /*virtual*/ void removeFace(U32 ch, LLFace* facep) ; /*virtual*/ F32 getMaxVirtualSize() ; + + // get the timer that tracks the last time reinit was called + LLFrameTimer* getLastReferencedTimer() { return &mLastReferencedTimer; } + private: void switchTexture(U32 ch, LLFace* facep) ; bool findFaces() ; @@ -606,6 +596,9 @@ private: bool mIsPlaying ; U32 mUpdateVirtualSizeTime ; + // tracks last time reinit was called + LLFrameTimer mLastReferencedTimer; + public: static void updateClass() ; static void cleanUpClass() ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 7047ce7d29..1ac97a20cf 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -187,13 +187,6 @@ void LLViewerTextureList::doPreloadImages() image->setAddressMode(LLTexUnit::TAM_CLAMP); mImagePreloads.insert(image); } - - LLPointer<LLImageRaw> img_blak_square_tex(new LLImageRaw(2, 2, 3)); - memset(img_blak_square_tex->getData(), 0, img_blak_square_tex->getDataSize()); - LLPointer<LLViewerFetchedTexture> img_blak_square(new LLViewerFetchedTexture(img_blak_square_tex, FTT_DEFAULT, false)); - gBlackSquareID = img_blak_square->getID(); - img_blak_square->setUnremovable(true); - addImage(img_blak_square, TEX_LIST_STANDARD); } static std::string get_texture_list_name() @@ -725,6 +718,7 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) size_t count = 0; if (image->isInImageList()) { + image->setInImageList(false); count = mImageList.erase(image) ; if(count != 1) { @@ -761,8 +755,6 @@ void LLViewerTextureList::removeImageFromList(LLViewerFetchedTexture *image) << LL_ENDL; } } - - image->setInImageList(false) ; } void LLViewerTextureList::addImage(LLViewerFetchedTexture *new_image, ETexListType tex_type) @@ -808,15 +800,6 @@ void LLViewerTextureList::deleteImage(LLViewerFetchedTexture *image) /////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// - -void LLViewerTextureList::dirtyImage(LLViewerFetchedTexture *image) -{ - mDirtyTextureList.insert(image); -} - -//////////////////////////////////////////////////////////////////////////// - void LLViewerTextureList::updateImages(F32 max_time) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; @@ -857,12 +840,6 @@ void LLViewerTextureList::updateImages(F32 max_time) //handle results from decode threads updateImagesCreateTextures(remaining_time); - if (!mDirtyTextureList.empty()) - { - gPipeline.dirtyPoolObjectTextures(mDirtyTextureList); - mDirtyTextureList.clear(); - } - bool didone = false; for (image_list_t::iterator iter = mCallbackList.begin(); iter != mCallbackList.end(); ) @@ -906,12 +883,6 @@ extern bool gCubeSnapshot; void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imagep, bool flush_images) { - if (imagep->isInDebug() || imagep->isUnremovable()) - { - //update_counter--; - return; //is in debug, ignore. - } - llassert(!gCubeSnapshot); static LLCachedControl<F32> bias_distance_scale(gSavedSettings, "TextureBiasDistanceScale", 1.f); @@ -926,7 +897,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag } LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - bool onFace = false; for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi) @@ -935,7 +905,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag if (face && face->getViewerObject()) { - onFace = true; F32 radius; F32 cos_angle_to_view_dir; static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f); @@ -983,24 +952,17 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag volume->updateSpotLightPriority(); } - //imagep->setDebugText(llformat("%.3f - %d", sqrtf(imagep->getMaxVirtualSize()), imagep->getBoostLevel())); - - F32 lazy_flush_timeout = 30.f; // stop decoding - F32 max_inactive_time = 20.f; // actually delete - S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, 1 for local reference + F32 max_inactive_time = 20.f; // inactive time before deleting saved raw image + S32 min_refs = 3; // 1 for mImageList, 1 for mUUIDMap, and 1 for "entries" in updateImagesFetchTextures // // Flush formatted images using a lazy flush // S32 num_refs = imagep->getNumRefs(); - if (num_refs == min_refs && flush_images) + if (num_refs <= min_refs && flush_images) { - if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > lazy_flush_timeout) - { - // Remove the unused image from the image list - deleteImage(imagep); - imagep = NULL; // should destroy the image - } + // Remove the unused image from the image list + deleteImage(imagep); return; } else @@ -1017,27 +979,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { return; } - else if (imagep->isDeletionCandidate()) - { - imagep->destroyTexture(); - return; - } - else if (imagep->isInactive()) - { - if (imagep->getLastReferencedTimer()->getElapsedTimeF32() > max_inactive_time) - { - imagep->setDeletionCandidate(); - } - return; - } - else - { - imagep->getLastReferencedTimer()->reset(); - - //reset texture state. - if(!onFace) - imagep->setInactive(); - } } if (!imagep->isInImageList()) @@ -1052,20 +993,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag imagep->processTextureStats(); } -void LLViewerTextureList::setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level) -{ - LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - if(!tex->setDebugFetching(debug_level)) - { - return; - } - - const F32 DEBUG_PRIORITY = 100000.f; - removeImageFromList(tex); - tex->mMaxVirtualSize = DEBUG_PRIORITY; - addImageToList(tex); -} - F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; @@ -1169,21 +1096,12 @@ F32 LLViewerTextureList::updateImagesLoadingFastCache(F32 max_time) void LLViewerTextureList::forceImmediateUpdate(LLViewerFetchedTexture* imagep) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - if(!imagep) + if(!imagep || gCubeSnapshot) { return ; } - if(imagep->isInImageList()) - { - removeImageFromList(imagep); - } - if (!gCubeSnapshot) - { // never call processTextureStats in a cube snapshot - imagep->processTextureStats(); - } - imagep->sMaxVirtualSize = LLViewerFetchedTexture::sMaxVirtualSize; - addImageToList(imagep); + imagep->processTextureStats(); return ; } @@ -1198,12 +1116,15 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) // update N textures at beginning of mImageList U32 update_count = 0; static const S32 MIN_UPDATE_COUNT = gSavedSettings.getS32("TextureFetchUpdateMinCount"); // default: 32 - // WIP -- dumb code here + + // NOTE: a texture may be deleted as a side effect of some of these updates + // Deletion rules check ref count, so be careful not to hold any LLPointer references to the textures here other than the one in entries. + //update MIN_UPDATE_COUNT or 5% of other textures, whichever is greater update_count = llmax((U32) MIN_UPDATE_COUNT, (U32) mUUIDMap.size()/20); update_count = llmin(update_count, (U32) mUUIDMap.size()); - { + { // copy entries out of UUID map to avoid iterator invalidation from deletion inside updateImageDecodeProiroty or updateFetch below LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vtluift - copy"); // copy entries out of UUID map for updating @@ -1226,30 +1147,22 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) LLTimer timer; - LLPointer<LLViewerTexture> last_imagep = nullptr; - for (auto& imagep : entries) { - if (imagep->getNumRefs() > 1) // make sure this image hasn't been deleted before attempting to update (may happen as a side effect of some other image updating) + mLastUpdateKey = LLTextureKey(imagep->getID(), (ETexListType)imagep->getTextureListType()); + if (imagep->getNumRefs() > 1) // make sure this image hasn't been deleted before attempting to update (may happen as a side effect of some other image updating) { updateImageDecodePriority(imagep); imagep->updateFetch(); } - last_imagep = imagep; - if (timer.getElapsedTimeF32() > max_time) { break; } } - if (last_imagep) - { - mLastUpdateKey = LLTextureKey(last_imagep->getID(), (ETexListType)last_imagep->getTextureListType()); - } - return timer.getElapsedTimeF32(); } diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index b614753b4f..7c7112f4cf 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -122,8 +122,6 @@ public: LLViewerFetchedTexture *findImage(const LLUUID &image_id, ETexListType tex_type); LLViewerFetchedTexture *findImage(const LLTextureKey &search_key); - void dirtyImage(LLViewerFetchedTexture *image); - // Using image stats, determine what images are necessary, and perform image updates. void updateImages(F32 max_time); void forceImmediateUpdate(LLViewerFetchedTexture* imagep) ; @@ -142,7 +140,6 @@ public: void doPrefetchImages(); void clearFetchingRequests(); - void setDebugFetching(LLViewerFetchedTexture* tex, S32 debug_level); // do some book keeping on the specified texture // - updates decode priority @@ -223,9 +220,6 @@ public: image_list_t mCallbackList; image_list_t mFastCacheList; - // Note: just raw pointers because they are never referenced, just compared against - std::set<LLViewerFetchedTexture*> mDirtyTextureList; - bool mForceResetTextureStats; // to make "for (auto& imagep : gTextureList)" work diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 395d8c78da..1b995ea650 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -50,7 +50,6 @@ #include <boost/function.hpp> #include <boost/signals2.hpp> -#include <boost/scoped_ptr.hpp> class LLView; class LLViewerObject; diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 5914303e80..eb1cd00940 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -81,10 +81,7 @@ LLVoiceChannel::~LLVoiceChannel() { sCurrentVoiceChannel = NULL; // Must check instance exists here, the singleton MAY have already been destroyed. - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } + LLVoiceClient::removeObserver(this); } sVoiceChannelMap.erase(mSessionID); @@ -118,6 +115,12 @@ void LLVoiceChannel::setChannelInfo(const LLSD &channelInfo) } } +void LLVoiceChannel::resetChannelInfo() +{ + mChannelInfo = LLSD(); + mState = STATE_NO_CHANNEL_INFO; +} + void LLVoiceChannel::onChange(EStatusType type, const LLSD& channelInfo, bool proximal) { LL_DEBUGS("Voice") << "Incoming channel info: " << channelInfo << LL_ENDL; @@ -219,7 +222,7 @@ void LLVoiceChannel::deactivate() LLVoiceClient::getInstance()->setUserPTTState(false); } } - LLVoiceClient::getInstance()->removeObserver(this); + LLVoiceClient::removeObserver(this); if (sCurrentVoiceChannel == this) { @@ -259,7 +262,7 @@ void LLVoiceChannel::activate() setState(STATE_CALL_STARTED); } - LLVoiceClient::getInstance()->addObserver(this); + LLVoiceClient::addObserver(this); //do not send earlier, channel should be initialized, should not be in STATE_NO_CHANNEL_INFO state sCurrentVoiceChannelChangedSignal(this->mSessionID); @@ -751,7 +754,7 @@ void LLVoiceChannelProximal::deactivate() { setState(STATE_HUNG_UP); } - LLVoiceClient::getInstance()->removeObserver(this); + LLVoiceClient::removeObserver(this); LLVoiceClient::getInstance()->activateSpatialChannel(false); } @@ -918,6 +921,12 @@ void LLVoiceChannelP2P::setChannelInfo(const LLSD& channel_info) } } +void LLVoiceChannelP2P::resetChannelInfo() +{ + mChannelInfo = LLVoiceClient::getInstance()->getP2PChannelInfoTemplate(mOtherUserID); + mState = STATE_NO_CHANNEL_INFO; // we have template, not full info +} + void LLVoiceChannelP2P::setState(EState state) { LL_INFOS("Voice") << "P2P CALL STATE CHANGE: incoming=" << int(mReceivedCall) << " oldstate=" << mState << " newstate=" << state << LL_ENDL; diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index d50a6f589a..4d7bf551e1 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -72,7 +72,8 @@ public: virtual void handleError(EStatusType status); virtual void deactivate(); virtual void activate(); - virtual void setChannelInfo(const LLSD &channelInfo); + virtual void setChannelInfo(const LLSD& channelInfo); + virtual void resetChannelInfo(); virtual void requestChannelInfo(); virtual bool isActive() const; virtual bool callStarted() const; @@ -189,6 +190,7 @@ class LLVoiceChannelP2P : public LLVoiceChannelGroup void requestChannelInfo() override; void deactivate() override; void setChannelInfo(const LLSD& channel_info) override; + void resetChannelInfo() override; protected: void setState(EState state) override; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 21f469abb3..5af7528ada 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -796,8 +796,14 @@ void LLVoiceClient::addObserver(LLVoiceClientStatusObserver* observer) void LLVoiceClient::removeObserver(LLVoiceClientStatusObserver* observer) { - LLVivoxVoiceClient::getInstance()->removeObserver(observer); - LLWebRTCVoiceClient::getInstance()->removeObserver(observer); + if (LLVivoxVoiceClient::instanceExists()) + { + LLVivoxVoiceClient::getInstance()->removeObserver(observer); + } + if (LLWebRTCVoiceClient::instanceExists()) + { + LLWebRTCVoiceClient::getInstance()->removeObserver(observer); + } } void LLVoiceClient::addObserver(LLFriendObserver* observer) @@ -808,8 +814,14 @@ void LLVoiceClient::addObserver(LLFriendObserver* observer) void LLVoiceClient::removeObserver(LLFriendObserver* observer) { - LLVivoxVoiceClient::getInstance()->removeObserver(observer); - LLWebRTCVoiceClient::getInstance()->removeObserver(observer); + if (LLVivoxVoiceClient::instanceExists()) + { + LLVivoxVoiceClient::getInstance()->removeObserver(observer); + } + if (LLWebRTCVoiceClient::instanceExists()) + { + LLWebRTCVoiceClient::getInstance()->removeObserver(observer); + } } void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) @@ -820,8 +832,14 @@ void LLVoiceClient::addObserver(LLVoiceClientParticipantObserver* observer) void LLVoiceClient::removeObserver(LLVoiceClientParticipantObserver* observer) { - LLVivoxVoiceClient::getInstance()->removeObserver(observer); - LLWebRTCVoiceClient::getInstance()->removeObserver(observer); + if (LLVivoxVoiceClient::instanceExists()) + { + LLVivoxVoiceClient::getInstance()->removeObserver(observer); + } + if (LLWebRTCVoiceClient::instanceExists()) + { + LLWebRTCVoiceClient::getInstance()->removeObserver(observer); + } } std::string LLVoiceClient::sipURIFromID(const LLUUID &id) const diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index 2221bc6df4..d53f512d82 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -38,7 +38,6 @@ class LLVOAvatar; #include "llcallingcard.h" // for LLFriendObserver #include "llsecapi.h" #include "llcontrol.h" -#include <boost/shared_ptr.hpp> // devices @@ -482,12 +481,12 @@ public: void onRegionChanged(); - void addObserver(LLVoiceClientStatusObserver* observer); - void removeObserver(LLVoiceClientStatusObserver* observer); - void addObserver(LLFriendObserver* observer); - void removeObserver(LLFriendObserver* observer); - void addObserver(LLVoiceClientParticipantObserver* observer); - void removeObserver(LLVoiceClientParticipantObserver* observer); + static void addObserver(LLVoiceClientStatusObserver* observer); + static void removeObserver(LLVoiceClientStatusObserver* observer); + static void addObserver(LLFriendObserver* observer); + static void removeObserver(LLFriendObserver* observer); + static void addObserver(LLVoiceClientParticipantObserver* observer); + static void removeObserver(LLVoiceClientParticipantObserver* observer); std::string sipURIFromID(const LLUUID &id) const; LLSD getP2PChannelInfoTemplate(const LLUUID& id) const; diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index e0130a9416..4d4f5dc9e9 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -236,11 +236,26 @@ LLWebRTCVoiceClient::LLWebRTCVoiceClient() : LLWebRTCVoiceClient::~LLWebRTCVoiceClient() { +} + +void LLWebRTCVoiceClient::cleanupSingleton() +{ if (mAvatarNameCacheConnection.connected()) { mAvatarNameCacheConnection.disconnect(); } + sShuttingDown = true; + if (mSession) + { + mSession->shutdownAllConnections(); + } + if (mNextSession) + { + mNextSession->shutdownAllConnections(); + } + cleanUp(); + sessionState::clearSessions(); } //--------------------------------------------------- @@ -253,6 +268,7 @@ void LLWebRTCVoiceClient::init(LLPumpIO* pump) mWebRTCDeviceInterface = llwebrtc::getDeviceInterface(); mWebRTCDeviceInterface->setDevicesObserver(this); mMainQueue = LL::WorkQueue::getInstance("mainloop"); + refreshDeviceLists(); } void LLWebRTCVoiceClient::terminate() @@ -621,7 +637,7 @@ void LLWebRTCVoiceClient::clearCaptureDevices() void LLWebRTCVoiceClient::addCaptureDevice(const LLVoiceDevice& device) { - LL_DEBUGS("Voice") << "display: '" << device.display_name << "' device: '" << device.full_name << "'" << LL_ENDL; + LL_INFOS("Voice") << "Voice Capture Device: '" << device.display_name << "' (" << device.full_name << ")" << LL_ENDL; mCaptureDevices.push_back(device); } @@ -654,6 +670,10 @@ void LLWebRTCVoiceClient::OnDevicesChanged(const llwebrtc::LLWebRTCVoiceDeviceLi void LLWebRTCVoiceClient::OnDevicesChangedImpl(const llwebrtc::LLWebRTCVoiceDeviceList &render_devices, const llwebrtc::LLWebRTCVoiceDeviceList &capture_devices) { + if (sShuttingDown) + { + return; + } LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; std::string inputDevice = gSavedSettings.getString("VoiceInputAudioDevice"); std::string outputDevice = gSavedSettings.getString("VoiceOutputAudioDevice"); @@ -686,7 +706,7 @@ void LLWebRTCVoiceClient::clearRenderDevices() void LLWebRTCVoiceClient::addRenderDevice(const LLVoiceDevice& device) { - LL_DEBUGS("Voice") << "display: '" << device.display_name << "' device: '" << device.full_name << "'" << LL_ENDL; + LL_INFOS("Voice") << "Voice Render Device: '" << device.display_name << "' (" << device.full_name << ")" << LL_ENDL; mRenderDevices.push_back(device); } @@ -1705,7 +1725,7 @@ void LLWebRTCVoiceClient::predSetUserMute(const LLWebRTCVoiceClient::sessionStat //------------------------------------------------------------------------ // Sessions -std::map<std::string, LLWebRTCVoiceClient::sessionState::ptr_t> LLWebRTCVoiceClient::sessionState::mSessions; +std::map<std::string, LLWebRTCVoiceClient::sessionState::ptr_t> LLWebRTCVoiceClient::sessionState::sSessions; LLWebRTCVoiceClient::sessionState::sessionState() : @@ -1792,13 +1812,19 @@ void LLWebRTCVoiceClient::sessionState::addSession( const std::string & channelID, LLWebRTCVoiceClient::sessionState::ptr_t& session) { - mSessions[channelID] = session; + sSessions[channelID] = session; } LLWebRTCVoiceClient::sessionState::~sessionState() { LL_DEBUGS("Voice") << "Destroying session CHANNEL=" << mChannelID << LL_ENDL; + if (!mShuttingDown) + { + shutdownAllConnections(); + } + mWebRTCConnections.clear(); + removeAllParticipants(); } @@ -1808,8 +1834,8 @@ LLWebRTCVoiceClient::sessionState::ptr_t LLWebRTCVoiceClient::sessionState::matc sessionStatePtr_t result; // *TODO: My kingdom for a lambda! - std::map<std::string, ptr_t>::iterator it = mSessions.find(channel_id); - if (it != mSessions.end()) + std::map<std::string, ptr_t>::iterator it = sSessions.find(channel_id); + if (it != sSessions.end()) { result = (*it).second; } @@ -1818,17 +1844,17 @@ LLWebRTCVoiceClient::sessionState::ptr_t LLWebRTCVoiceClient::sessionState::matc void LLWebRTCVoiceClient::sessionState::for_each(sessionFunc_t func) { - std::for_each(mSessions.begin(), mSessions.end(), boost::bind(for_eachPredicate, _1, func)); + std::for_each(sSessions.begin(), sSessions.end(), boost::bind(for_eachPredicate, _1, func)); } void LLWebRTCVoiceClient::sessionState::reapEmptySessions() { std::map<std::string, ptr_t>::iterator iter; - for (iter = mSessions.begin(); iter != mSessions.end();) + for (iter = sSessions.begin(); iter != sSessions.end();) { if (iter->second->isEmpty()) { - iter = mSessions.erase(iter); + iter = sSessions.erase(iter); } else { @@ -1874,6 +1900,11 @@ LLWebRTCVoiceClient::sessionStatePtr_t LLWebRTCVoiceClient::addSession(const std } } +void LLWebRTCVoiceClient::sessionState::clearSessions() +{ + sSessions.clear(); +} + LLWebRTCVoiceClient::sessionStatePtr_t LLWebRTCVoiceClient::findP2PSession(const LLUUID &agent_id) { sessionStatePtr_t result = sessionState::matchSessionByChannelID(agent_id.asString()); @@ -1913,14 +1944,14 @@ void LLWebRTCVoiceClient::sessionState::processSessionStates() { LL_PROFILE_ZONE_SCOPED_CATEGORY_VOICE; - auto iter = mSessions.begin(); - while (iter != mSessions.end()) + auto iter = sSessions.begin(); + while (iter != sSessions.end()) { if (!iter->second->processConnectionStates() && iter->second->mShuttingDown) { // if the connections associated with a session are gone, // and this session is shutting down, remove it. - iter = mSessions.erase(iter); + iter = sSessions.erase(iter); } else { @@ -2121,8 +2152,10 @@ LLVoiceWebRTCConnection::LLVoiceWebRTCConnection(const LLUUID ®ionID, const s mOutstandingRequests(0), mChannelID(channelID), mRegionID(regionID), + mPrimary(true), mRetryWaitPeriod(0) { + // retries wait a short period...randomize it so // all clients don't try to reconnect at once. mRetryWaitSecs = static_cast<F32>(rand()) / static_cast<F32>(RAND_MAX) + 0.5f; @@ -2368,6 +2401,12 @@ void LLVoiceWebRTCConnection::OnPeerConnectionClosed() setVoiceConnectionState(VOICE_STATE_CLOSED); mOutstandingRequests--; } + else if (LLWebRTCVoiceClient::isShuttingDown()) + { + // disconnect was initialized by llwebrtc::terminate() instead of connectionStateMachine + LL_INFOS("Voice") << "Peer connection has closed, but state is " << mVoiceConnectionState << LL_ENDL; + setVoiceConnectionState(VOICE_STATE_CLOSED); + } }); } @@ -2474,7 +2513,11 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro(connectionPtr_t connectio LLSD result = httpAdapter->postAndSuspend(httpRequest, url, body, httpOpts); connection->mOutstandingRequests--; - connection->setVoiceConnectionState(VOICE_STATE_SESSION_EXIT); + + if (connection->getVoiceConnectionState() == VOICE_STATE_WAIT_FOR_EXIT) + { + connection->setVoiceConnectionState(VOICE_STATE_SESSION_EXIT); + } } // Tell the simulator to tell the Secondlife WebRTC server that we want a voice @@ -2707,7 +2750,18 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() case VOICE_STATE_SESSION_UP: { mRetryWaitPeriod = 0; - mRetryWaitSecs = static_cast<F32>(rand()) / static_cast<F32>(RAND_MAX) + 0.5f; + mRetryWaitSecs = (F32)((F32) rand() / (RAND_MAX)) + 0.5f; + LLUUID agentRegionID; + if (isSpatial() && gAgent.getRegion()) + { + + bool primary = (mRegionID == gAgent.getRegion()->getRegionID()); + if (primary != mPrimary) + { + mPrimary = primary; + sendJoin(); + } + } // we'll stay here as long as the session remains up. if (mShutDown) @@ -2736,9 +2790,18 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() break; case VOICE_STATE_DISCONNECT: - setVoiceConnectionState(VOICE_STATE_WAIT_FOR_EXIT); - LLCoros::instance().launch("LLVoiceWebRTCConnection::breakVoiceConnectionCoro", - boost::bind(&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this->shared_from_this())); + if (!LLWebRTCVoiceClient::isShuttingDown()) + { + setVoiceConnectionState(VOICE_STATE_WAIT_FOR_EXIT); + LLCoros::instance().launch("LLVoiceWebRTCConnection::breakVoiceConnectionCoro", + boost::bind(&LLVoiceWebRTCConnection::breakVoiceConnectionCoro, this->shared_from_this())); + } + else + { + // llwebrtc::terminate() is already shuting down the connection. + setVoiceConnectionState(VOICE_STATE_WAIT_FOR_CLOSE); + mOutstandingRequests++; + } break; case VOICE_STATE_WAIT_FOR_EXIT: @@ -2748,7 +2811,11 @@ bool LLVoiceWebRTCConnection::connectionStateMachine() { setVoiceConnectionState(VOICE_STATE_WAIT_FOR_CLOSE); mOutstandingRequests++; - mWebRTCPeerConnectionInterface->shutdownConnection(); + if (!LLWebRTCVoiceClient::isShuttingDown()) + { + mWebRTCPeerConnectionInterface->shutdownConnection(); + } + // else was already posted by llwebrtc::terminate(). break; case VOICE_STATE_WAIT_FOR_CLOSE: break; @@ -2978,7 +3045,7 @@ void LLVoiceWebRTCConnection::sendJoin() boost::json::object root; boost::json::object join_obj; LLUUID regionID = gAgent.getRegion()->getRegionID(); - if ((regionID == mRegionID) || !isSpatial()) + if (mPrimary) { join_obj["p"] = true; } @@ -2996,6 +3063,10 @@ LLVoiceWebRTCSpatialConnection::LLVoiceWebRTCSpatialConnection(const LLUUID ® LLVoiceWebRTCConnection(regionID, channelID), mParcelLocalID(parcelLocalID) { + if (gAgent.getRegion()) + { + mPrimary = (regionID == gAgent.getRegion()->getRegionID()); + } } LLVoiceWebRTCSpatialConnection::~LLVoiceWebRTCSpatialConnection() diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index c8dbb64574..32127f9b17 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -70,6 +70,7 @@ class LLWebRTCVoiceClient : public LLSingleton<LLWebRTCVoiceClient>, virtual ~LLWebRTCVoiceClient(); public: + void cleanupSingleton() override; /// @name LLVoiceModuleInterface virtual implementations /// @see LLVoiceModuleInterface //@{ @@ -300,6 +301,7 @@ public: static void for_each(sessionFunc_t func); static void reapEmptySessions(); + static void clearSessions(); bool isEmpty() { return mWebRTCConnections.empty(); } @@ -319,7 +321,7 @@ public: participantUUIDMap mParticipantsByUUID; static bool hasSession(const std::string &sessionID) - { return mSessions.find(sessionID) != mSessions.end(); } + { return sSessions.find(sessionID) != sSessions.end(); } bool mHangupOnLastLeave; // notify observers after the session becomes empty. bool mNotifyOnFirstJoin; // notify observers when the first peer joins. @@ -330,7 +332,7 @@ public: private: - static std::map<std::string, ptr_t> mSessions; // canonical list of outstanding sessions. + static std::map<std::string, ptr_t> sSessions; // canonical list of outstanding sessions. static void for_eachPredicate(const std::pair<std::string, LLWebRTCVoiceClient::sessionState::wptr_t> &a, @@ -620,7 +622,7 @@ class LLVoiceWebRTCConnection : bool connectionStateMachine(); - virtual bool isSpatial() = 0; + virtual bool isSpatial() { return false; } LLUUID getRegionID() { return mRegionID; } @@ -684,6 +686,7 @@ class LLVoiceWebRTCConnection : LLVoiceClientStatusObserver::EStatusType mCurrentStatus; LLUUID mRegionID; + bool mPrimary; LLUUID mViewerSession; std::string mChannelID; diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index 6221d67b26..ebcdd537a5 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -43,7 +43,6 @@ #include "stringize.h" #include <typeinfo> #include <map> -#include <boost/scoped_ptr.hpp> #include <boost/bind.hpp> LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter) diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 7c7bd98bcd..92e6c88752 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -34,10 +34,6 @@ // STL headers #include <map> #include <set> -// std headers -// external library headers -#include <boost/scoped_ptr.hpp> -#include <boost/range.hpp> // boost::begin(), boost::end() #include "curl/curl.h" @@ -334,7 +330,7 @@ public: // need to wake up the loginCoro now llcoro::suspend(); - // Because mTransaction is a boost::scoped_ptr, deleting this object + // Because mTransaction is a std::unique_ptr, deleting this object // frees our LLXMLRPCTransaction object. // Because mBoundListener is an LLTempBoundListener, deleting this // object disconnects it from "mainloop". diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index 875ca9ad89..bf5cd3f853 100644 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -44,7 +44,6 @@ #include <typeinfo> // external library headers #include <boost/bind.hpp> -#include <boost/shared_ptr.hpp> #include <boost/assign/list_of.hpp> // other Linden headers #include "tests/listener.h" // must PRECEDE lltut.h diff --git a/indra/test/test.cpp b/indra/test/test.cpp index e0a43b2e08..6e280819df 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -56,10 +56,6 @@ #include <boost/iostreams/tee.hpp> #include <boost/iostreams/stream.hpp> -#include <boost/scoped_ptr.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/make_shared.hpp> -#include <boost/foreach.hpp> #include <fstream> |