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
assignment-client/src
interface
libraries
model-baker
model-networking
CMakeLists.txt
src/model-networking
shared/src
plugins/openvr
tools/dissectors

View file

@ -759,11 +759,11 @@ void Agent::processAgentAvatarAudio() {
int16_t numAvailableSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL;
const int16_t* nextSoundOutput = NULL;
if (_avatarSound) {
if (_avatarSound && _avatarSound->isReady()) {
if (isPlayingRecording && !_shouldMuteRecordingAudio) {
_shouldMuteRecordingAudio = true;
}
auto audioData = _avatarSound->getAudioData();
nextSoundOutput = reinterpret_cast<const int16_t*>(audioData->rawData()
+ _numAvatarSoundSentBytes);

View file

@ -206,7 +206,7 @@ endif()
link_hifi_libraries(
shared workload task octree ktx gpu gl procedural graphics graphics-scripting render
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
render-utils entities-renderer avatars-renderer ui qml auto-updater midi
controllers plugins image trackers

View file

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

View file

@ -27,6 +27,7 @@
#include <FBXSerializer.h>
#include <OBJSerializer.h>
#include <GLTFSerializer.h>
#include <model-baker/Baker.h>
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) {
// Assume ownership of the HFMModel pointer
_hfmModel = hfmModel;
// Do processing on the model
baker::Baker modelBaker(hfmModel);
modelBaker.run();
// Assume ownership of the processed HFMModel
_hfmModel = modelBaker.hfmModel;
// Copy materials
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_startup, "trace.startup")
Q_LOGGING_CATEGORY(trace_workload, "trace.workload")
Q_LOGGING_CATEGORY(trace_baker, "trace.baker")
#if defined(NSIGHT_FOUND)
#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_startup)
Q_DECLARE_LOGGING_CATEGORY(trace_workload)
Q_DECLARE_LOGGING_CATEGORY(trace_baker)
class Duration {
public:

View file

@ -11,7 +11,7 @@ if (WIN32 AND (NOT USE_GLES))
setup_hifi_plugin(Gui Qml Multimedia)
link_hifi_libraries(shared task gl qml networking controllers ui
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)
target_openvr()

View file

@ -77,7 +77,7 @@ local packet_types = {
[22] = "ICEServerPeerInformation",
[23] = "ICEServerQuery",
[24] = "OctreeStats",
[25] = "UNUSED_PACKET_TYPE_1",
[25] = "SetAvatarTraits",
[26] = "AvatarIdentityRequest",
[27] = "AssignmentClientStatus",
[28] = "NoisyMute",
@ -229,7 +229,7 @@ function p_hfudt.dissector(buf, pinfo, tree)
-- read the obfuscation level
local obfuscation_bits = bit32.band(0x03, bit32.rshift(first_word, 27))
subtree:add(f_obfuscation_level, obfuscation_bits)
-- read the sequence number
subtree:add(f_sequence_number, bit32.band(first_word, SEQUENCE_NUMBER_MASK))
@ -257,6 +257,11 @@ function p_hfudt.dissector(buf, pinfo, tree)
subtree:add(f_message_part_number, buf(8, 4):le_uint())
end
if obfuscation_bits ~= 0 then
local newbuf = deobfuscate(message_bit, buf, obfuscation_bits)
buf = newbuf:tvb("Unobfuscated")
end
-- read the type
local packet_type = buf(payload_offset, 1):le_uint()
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)
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