Merge branch 'master' of github.com:highfidelity/hifi into MS20089_interruptRecording

This commit is contained in:
Zach Fox 2018-12-18 10:31:32 -08:00
commit fce4c252e7
13 changed files with 171 additions and 11 deletions

View file

@ -759,7 +759,7 @@ void Agent::processAgentAvatarAudio() {
int16_t numAvailableSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; int16_t numAvailableSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL;
const int16_t* nextSoundOutput = NULL; const int16_t* nextSoundOutput = NULL;
if (_avatarSound) { if (_avatarSound && _avatarSound->isReady()) {
if (isPlayingRecording && !_shouldMuteRecordingAudio) { if (isPlayingRecording && !_shouldMuteRecordingAudio) {
_shouldMuteRecordingAudio = true; _shouldMuteRecordingAudio = true;
} }

View file

@ -206,7 +206,7 @@ endif()
link_hifi_libraries( link_hifi_libraries(
shared workload task octree ktx gpu gl procedural graphics graphics-scripting render shared workload task octree ktx gpu gl procedural graphics graphics-scripting render
pointers pointers
recording hfm fbx networking model-networking entities avatars trackers recording hfm fbx networking model-networking model-baker entities avatars trackers
audio audio-client animation script-engine physics audio audio-client animation script-engine physics
render-utils entities-renderer avatars-renderer ui qml auto-updater midi render-utils entities-renderer avatars-renderer ui qml auto-updater midi
controllers plugins image trackers controllers plugins image trackers

View file

@ -5261,7 +5261,12 @@ void Application::resumeAfterLoginDialogActionTaken() {
nodeList->getDomainHandler().resetting(); nodeList->getDomainHandler().resetting();
if (!accountManager->isLoggedIn()) { if (!accountManager->isLoggedIn()) {
if (arguments().contains("--url")) {
auto reply = SandboxUtils::getStatus();
connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });
} else {
addressManager->goToEntry(); addressManager->goToEntry();
}
} else { } else {
QVariant testProperty = property(hifi::properties::TEST); QVariant testProperty = property(hifi::properties::TEST);
if (testProperty.isValid()) { if (testProperty.isValid()) {
@ -5274,7 +5279,8 @@ void Application::resumeAfterLoginDialogActionTaken() {
connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); }); connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });
} }
} else { } else {
addressManager->loadSettings(); auto reply = SandboxUtils::getStatus();
connect(reply, &QNetworkReply::finished, this, [this, reply] { handleSandboxStatus(reply); });
} }
} }

View file

@ -0,0 +1,8 @@
set(TARGET_NAME model-baker)
setup_hifi_library()
link_hifi_libraries(shared task)
include_hifi_library_headers(gpu)
include_hifi_library_headers(graphics)
include_hifi_library_headers(hfm)

View file

@ -0,0 +1,38 @@
//
// Baker.cpp
// model-baker/src/model-baker
//
// Created by Sabrina Shanman on 2018/12/04.
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include "Baker.h"
namespace baker {
class BakerEngineBuilder {
public:
using Unused = int;
using Input = hfm::Model::Pointer;
using Output = hfm::Model::Pointer;
using JobModel = Task::ModelIO<BakerEngineBuilder, Input, Output>;
void build(JobModel& model, const Varying& in, Varying& out) {
out = in;
}
};
Baker::Baker(const hfm::Model::Pointer& hfmModel) :
_engine(std::make_shared<Engine>(BakerEngineBuilder::JobModel::create("Baker"), std::make_shared<BakeContext>())) {
_engine->feedInput<BakerEngineBuilder::Input>(hfmModel);
}
void Baker::run() {
_engine->run();
hfmModel = _engine->getOutput().get<BakerEngineBuilder::Output>();
}
};

View file

@ -0,0 +1,36 @@
//
// Baker.h
// model-baker/src/model-baker
//
// Created by Sabrina Shanman on 2018/12/04.
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_baker_Baker_h
#define hifi_baker_Baker_h
#include <hfm/HFM.h>
#include "Engine.h"
namespace baker {
class Baker {
public:
Baker(const hfm::Model::Pointer& hfmModel);
void run();
// Outputs, available after run() is called
hfm::Model::Pointer hfmModel;
protected:
EnginePointer _engine;
};
};
#endif //hifi_baker_Baker_h

View file

@ -0,0 +1,32 @@
//
// Engine.h
// model-baker/src/model-baker
//
// Created by Sabrina Shanman on 2018/12/04.
// Copyright 2018 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_baker_Engine_h
#define hifi_baker_Engine_h
#include <task/Task.h>
namespace baker {
class BakeContext : public task::JobContext {
public:
// No context settings yet for model prep
};
using BakeContextPointer = std::shared_ptr<BakeContext>;
Task_DeclareCategoryTimeProfilerClass(BakerTimeProfiler, trace_baker);
Task_DeclareTypeAliases(BakeContext, BakerTimeProfiler)
using EnginePointer = std::shared_ptr<Engine>;
};
#endif // hifi_baker_Engine_h

View file

@ -1,5 +1,6 @@
set(TARGET_NAME model-networking) set(TARGET_NAME model-networking)
setup_hifi_library() setup_hifi_library()
link_hifi_libraries(shared shaders networking graphics fbx ktx image gl) link_hifi_libraries(shared shaders networking graphics fbx ktx image gl model-baker)
include_hifi_library_headers(gpu) include_hifi_library_headers(gpu)
include_hifi_library_headers(hfm) include_hifi_library_headers(hfm)
include_hifi_library_headers(task)

View file

@ -27,6 +27,7 @@
#include <FBXSerializer.h> #include <FBXSerializer.h>
#include <OBJSerializer.h> #include <OBJSerializer.h>
#include <GLTFSerializer.h> #include <GLTFSerializer.h>
#include <model-baker/Baker.h>
Q_LOGGING_CATEGORY(trace_resource_parse_geometry, "trace.resource.parse.geometry") Q_LOGGING_CATEGORY(trace_resource_parse_geometry, "trace.resource.parse.geometry")
@ -277,8 +278,12 @@ void GeometryDefinitionResource::downloadFinished(const QByteArray& data) {
} }
void GeometryDefinitionResource::setGeometryDefinition(HFMModel::Pointer hfmModel) { void GeometryDefinitionResource::setGeometryDefinition(HFMModel::Pointer hfmModel) {
// Assume ownership of the HFMModel pointer // Do processing on the model
_hfmModel = hfmModel; baker::Baker modelBaker(hfmModel);
modelBaker.run();
// Assume ownership of the processed HFMModel
_hfmModel = modelBaker.hfmModel;
// Copy materials // Copy materials
QHash<QString, size_t> materialIDAtlas; QHash<QString, size_t> materialIDAtlas;

View file

@ -29,6 +29,7 @@ Q_LOGGING_CATEGORY(trace_simulation_physics, "trace.simulation.physics")
Q_LOGGING_CATEGORY(trace_simulation_physics_detail, "trace.simulation.physics.detail") Q_LOGGING_CATEGORY(trace_simulation_physics_detail, "trace.simulation.physics.detail")
Q_LOGGING_CATEGORY(trace_startup, "trace.startup") Q_LOGGING_CATEGORY(trace_startup, "trace.startup")
Q_LOGGING_CATEGORY(trace_workload, "trace.workload") Q_LOGGING_CATEGORY(trace_workload, "trace.workload")
Q_LOGGING_CATEGORY(trace_baker, "trace.baker")
#if defined(NSIGHT_FOUND) #if defined(NSIGHT_FOUND)
#include "nvToolsExt.h" #include "nvToolsExt.h"

View file

@ -34,6 +34,7 @@ Q_DECLARE_LOGGING_CATEGORY(trace_simulation_physics)
Q_DECLARE_LOGGING_CATEGORY(trace_simulation_physics_detail) Q_DECLARE_LOGGING_CATEGORY(trace_simulation_physics_detail)
Q_DECLARE_LOGGING_CATEGORY(trace_startup) Q_DECLARE_LOGGING_CATEGORY(trace_startup)
Q_DECLARE_LOGGING_CATEGORY(trace_workload) Q_DECLARE_LOGGING_CATEGORY(trace_workload)
Q_DECLARE_LOGGING_CATEGORY(trace_baker)
class Duration { class Duration {
public: public:

View file

@ -11,7 +11,7 @@ if (WIN32 AND (NOT USE_GLES))
setup_hifi_plugin(Gui Qml Multimedia) setup_hifi_plugin(Gui Qml Multimedia)
link_hifi_libraries(shared task gl qml networking controllers ui link_hifi_libraries(shared task gl qml networking controllers ui
plugins display-plugins ui-plugins input-plugins script-engine plugins display-plugins ui-plugins input-plugins script-engine
audio-client render-utils graphics shaders gpu render model-networking hfm fbx ktx image procedural ${PLATFORM_GL_BACKEND}) audio-client render-utils graphics shaders gpu render model-networking model-baker hfm fbx ktx image procedural ${PLATFORM_GL_BACKEND})
include_hifi_library_headers(octree) include_hifi_library_headers(octree)
target_openvr() target_openvr()

View file

@ -77,7 +77,7 @@ local packet_types = {
[22] = "ICEServerPeerInformation", [22] = "ICEServerPeerInformation",
[23] = "ICEServerQuery", [23] = "ICEServerQuery",
[24] = "OctreeStats", [24] = "OctreeStats",
[25] = "UNUSED_PACKET_TYPE_1", [25] = "SetAvatarTraits",
[26] = "AvatarIdentityRequest", [26] = "AvatarIdentityRequest",
[27] = "AssignmentClientStatus", [27] = "AssignmentClientStatus",
[28] = "NoisyMute", [28] = "NoisyMute",
@ -257,6 +257,11 @@ function p_hfudt.dissector(buf, pinfo, tree)
subtree:add(f_message_part_number, buf(8, 4):le_uint()) subtree:add(f_message_part_number, buf(8, 4):le_uint())
end end
if obfuscation_bits ~= 0 then
local newbuf = deobfuscate(message_bit, buf, obfuscation_bits)
buf = newbuf:tvb("Unobfuscated")
end
-- read the type -- read the type
local packet_type = buf(payload_offset, 1):le_uint() local packet_type = buf(payload_offset, 1):le_uint()
local ptype = subtree:add_le(f_type, buf(payload_offset, 1)) local ptype = subtree:add_le(f_type, buf(payload_offset, 1))
@ -316,3 +321,30 @@ function p_hfudt.init()
udp_dissector_table:add(port, p_hfudt) udp_dissector_table:add(port, p_hfudt)
end end
end end
function deobfuscate(message_bit, buf, level)
local out = ByteArray.new()
out:set_size(buf:len())
if (level == 1) then
key = ByteArray.new("6362726973736574")
elseif level == 2 then
key = ByteArray.new("7362697261726461")
elseif level == 3 then
key = ByteArray.new("72687566666d616e")
else
return
end
local start = 4
if message_bit == 1 then
local start = 12
end
local p = 0
for i = start, buf:len() - 1 do
out:set_index(i, bit.bxor(buf(i, 1):le_uint(), key:get_index(7 - (p % 8))) )
p = p + 1
end
return out
end