Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitsubprojects
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- mode: cmake -*-
git_subproject(ZeroEQ https://github.com/HBPVIS/ZeroEQ.git 505caf8)
git_subproject(Deflect https://github.com/BlueBrain/Deflect.git 7ebb0a5)
git_subproject(Deflect https://github.com/BlueBrain/Deflect.git f9ad032)
git_subproject(TUIO https://github.com/BlueBrain/TUIO.git 67a65ad)
git_subproject(VirtualKeyboard https://github.com/rdumusc/QtFreeVirtualKeyboard.git b2f79e3)
2 changes: 2 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Changelog {#changelog}

# Release 1.3 (git master)

* [122](https://github.com/BlueBrain/Tide/pull/122):
Added passive stereo rendering mode for pixel streams sent by Deflect 0.13.
* [121](https://github.com/BlueBrain/Tide/pull/121):
Pretty print FFMPEG log messages using Tide log style and reduced verbosity.
* [119](https://github.com/BlueBrain/Tide/pull/119):
Expand Down
16 changes: 16 additions & 0 deletions examples/configuration_stereo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<configuration>
<dimensions numTilesWidth="2" numTilesHeight="1" screenWidth="960" screenHeight="540" mullionWidth="-60" mullionHeight="0"/>
<masterProcess host="localhost" display=":0" headless="false"/>
<process host="localhost" display=":0" stereo="left">
<screen x="0" y="0" i="0" j="0"/>
</process>
<process host="localhost" display=":0" stereo="right">
<screen x="0" y="800" i="0" j="0"/>
</process>
<process host="localhost" display=":0" stereo="left">
<screen x="900" y="0" i="1" j="0"/>
</process>
<process host="localhost" display=":0" stereo="right">
<screen x="900" y="800" i="1" j="0"/>
</process>
</configuration>
41 changes: 41 additions & 0 deletions tests/cpp/core/ConfigurationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

#define CONFIG_TEST_FILENAME "./configuration.xml"
#define CONFIG_TEST_FILENAME_II "./configuration_default.xml"
#define CONFIG_TEST_FILENAME_STEREO "./configuration_stereo.xml"

#define CONFIG_EXPECTED_BACKGROUND "/nfs4/bbp.epfl.ch/visualization/DisplayWall/media/background.png"
#define CONFIG_EXPECTED_BACKGROUND_COLOR "#242424"
Expand Down Expand Up @@ -117,6 +118,46 @@ BOOST_AUTO_TEST_CASE( test_wall_configuration )
BOOST_CHECK_EQUAL( config.getProcessCountForHost(), 3 );
BOOST_CHECK_EQUAL( config.getGlobalScreenIndex(), QPoint( 0, 2 ));
BOOST_CHECK_EQUAL( config.getWindowPos(), QPoint( 0, 2160 ));
BOOST_CHECK( config.getStereoMode() == deflect::View::mono );
}

BOOST_AUTO_TEST_CASE( test_stereo_configuration )
{
Configuration config( CONFIG_TEST_FILENAME_STEREO );

BOOST_CHECK_EQUAL( config.getMullionHeight(), 0 );
BOOST_CHECK_EQUAL( config.getMullionWidth(), -60 );

BOOST_CHECK_EQUAL( config.getScreenWidth(), 1920 );
BOOST_CHECK_EQUAL( config.getScreenHeight(), 1200 );

BOOST_CHECK_EQUAL( config.getTotalWidth(), 1920 * 2 - 60 );
BOOST_CHECK_EQUAL( config.getTotalHeight(), 1200 );

BOOST_CHECK_EQUAL( config.getTotalScreenCountX(), 2 );
BOOST_CHECK_EQUAL( config.getTotalScreenCountY(), 1 );

const auto processIndexLeft = 1; // note: starts from 1, not 0
WallConfiguration configLeft( CONFIG_TEST_FILENAME_STEREO, processIndexLeft );
BOOST_REQUIRE_EQUAL( configLeft.getProcessIndex(), processIndexLeft );

BOOST_CHECK_EQUAL( configLeft.getHost().toStdString(), "localhost" );
BOOST_CHECK_EQUAL( configLeft.getDisplay().toStdString(), ":0.0" );
BOOST_CHECK_EQUAL( configLeft.getProcessCountForHost(), 4 );
BOOST_CHECK_EQUAL( configLeft.getGlobalScreenIndex(), QPoint( 0, 0 ));
BOOST_CHECK_EQUAL( configLeft.getWindowPos(), QPoint( 0, 0 ));
BOOST_CHECK( configLeft.getStereoMode() == deflect::View::left_eye );

const auto processIndexRight = 2; // note: starts from 1, not 0
WallConfiguration configRight( CONFIG_TEST_FILENAME_STEREO, processIndexRight );
BOOST_REQUIRE_EQUAL( configRight.getProcessIndex(), processIndexRight );

BOOST_CHECK_EQUAL( configRight.getHost().toStdString(), "localhost" );
BOOST_CHECK_EQUAL( configRight.getDisplay().toStdString(), ":0.1" );
BOOST_CHECK_EQUAL( configRight.getProcessCountForHost(), 4 );
BOOST_CHECK_EQUAL( configRight.getGlobalScreenIndex(), QPoint( 0, 0 ));
BOOST_CHECK_EQUAL( configRight.getWindowPos(), QPoint( 0, 0 ));
BOOST_CHECK( configRight.getStereoMode() == deflect::View::right_eye );
}

BOOST_AUTO_TEST_CASE( test_master_configuration )
Expand Down
30 changes: 29 additions & 1 deletion tests/cpp/core/DeflectSerializationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <boost/test/unit_test.hpp>
namespace ut = boost::unit_test;

#include "serialization/includes.h"
#include "serialization/deflectTypes.h"

#include <boost/archive/binary_oarchive.hpp>
Expand All @@ -56,7 +57,6 @@ BOOST_AUTO_TEST_CASE( testSegementParametersSerialization )
params.width = 78;
params.compressed = false;


// serialize
std::stringstream stream;
{
Expand All @@ -78,3 +78,31 @@ BOOST_AUTO_TEST_CASE( testSegementParametersSerialization )
BOOST_CHECK_EQUAL( params.compressed, paramsDeserialized.compressed );
}

BOOST_AUTO_TEST_CASE( testFrameSerialization )
{
deflect::Frame frame;
frame.segments.push_back( deflect::Segment() );
frame.segments.push_back( deflect::Segment() );
frame.uri = "SomeUri";
frame.view = deflect::View::right_eye;

// serialize
std::stringstream stream;
{
boost::archive::binary_oarchive oa( stream );
oa << frame;
}

// deserialize
deflect::Frame frameDeserialized;
{
boost::archive::binary_iarchive ia( stream );
ia >> frameDeserialized;
}

BOOST_CHECK_EQUAL( frame.segments.size(),
frameDeserialized.segments.size( ));
BOOST_CHECK_EQUAL( frame.uri.toStdString(),
frameDeserialized.uri.toStdString() );
BOOST_CHECK_EQUAL( (int)frame.view, (int)frameDeserialized.view );
}
1 change: 1 addition & 0 deletions tests/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(TEST_RESOURCES
select_test.htm
configuration.xml
configuration_default.xml
configuration_stereo.xml
legacy.dcx
reference_screenshot.png
state_v0.dcx
Expand Down
16 changes: 16 additions & 0 deletions tests/resources/configuration_stereo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<configuration>
<dimensions numTilesWidth="2" numTilesHeight="1" screenWidth="1920" screenHeight="1200" mullionWidth="-60" mullionHeight="0"/>
<masterProcess host="localhost" display=":0" headless="true"/>
<process host="localhost" display=":0.0" stereo="left">
<screen x="0" y="0" i="0" j="0"/>
</process>
<process host="localhost" display=":0.1" stereo="right">
<screen x="0" y="0" i="0" j="0"/>
</process>
<process host="localhost" display=":1.0" stereo="left">
<screen x="0" y="0" i="1" j="0"/>
</process>
<process host="localhost" display=":1.1" stereo="right">
<screen x="0" y="0" i="1" j="0"/>
</process>
</configuration>
17 changes: 13 additions & 4 deletions tide/core/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,28 @@ bool Configuration::getInt( const QXmlQuery& query, int& value ) const
return ok;
}

bool Configuration::getBool( const QXmlQuery& query, bool& value ) const
bool Configuration::getString( const QXmlQuery& query, QString& value ) const
{
QString queryResult;
if( !query.evaluateTo( &queryResult ))
return false;

queryResult = queryResult.remove( QRegExp( TRIM_REGEX ));
if( queryResult == "true" )
value = queryResult.remove( QRegExp( TRIM_REGEX ));
return true;
}

bool Configuration::getBool( const QXmlQuery& query, bool& value ) const
{
QString result;
if( !getString( query, result ))
return false;

if( result == "true" )
{
value = true;
return true;
}
if( queryResult == "false" )
if( result == "false" )
{
value = false;
return true;
Expand Down
1 change: 1 addition & 0 deletions tide/core/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class Configuration
/** Evaluate the querry and set the result to value on success. */
bool getDouble( const QXmlQuery& query, double& value ) const;
bool getInt( const QXmlQuery& query, int& value ) const;
bool getString( const QXmlQuery& query, QString& value ) const;
bool getBool( const QXmlQuery& query, bool& value ) const;

private:
Expand Down
3 changes: 2 additions & 1 deletion tide/core/serialization/deflectTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ namespace serialization
{

template<class Archive>
void serialize( Archive & ar, deflect::Frame& frame, const unsigned int )
void serialize( Archive& ar, deflect::Frame& frame, const unsigned int )
{
ar & frame.segments;
ar & frame.uri;
ar & frame.view;
}

template< class Archive >
Expand Down
86 changes: 40 additions & 46 deletions tide/master/MasterApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
#endif

#include <deflect/EventReceiver.h>
#include <deflect/FrameDispatcher.h>
#include <deflect/qt/QuickRenderer.h>
#include <deflect/Server.h>

Expand Down Expand Up @@ -139,8 +138,15 @@ void MasterApplication::load( const QString sessionFile )
void MasterApplication::_init()
{
_displayGroup.reset( new DisplayGroup( _config->getTotalSize( )));

_pixelStreamWindowManager.reset(
new PixelStreamWindowManager( *_displayGroup ));
_pixelStreamWindowManager->setAutoFocusNewWindows(
_options->getAutoFocusPixelStreams( ));
connect( _options.get(), &Options::autoFocusPixelStreamsChanged,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::setAutoFocusNewWindows );

_pixelStreamerLauncher.reset(
new PixelStreamerLauncher( *_pixelStreamWindowManager, *_config ));

Expand Down Expand Up @@ -244,17 +250,41 @@ void MasterApplication::_startDeflectServer()
return;
}

auto& dispatcher = _deflectServer->getPixelStreamDispatcher();

connect( &dispatcher, &deflect::FrameDispatcher::openPixelStream,
connect( _deflectServer.get(), &deflect::Server::pixelStreamOpened,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::handleStreamStart );
connect( &dispatcher, &deflect::FrameDispatcher::deletePixelStream,

connect( _deflectServer.get(), &deflect::Server::pixelStreamClosed,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::handleStreamEnd );

connect( _pixelStreamWindowManager.get(),
&PixelStreamWindowManager::streamWindowClosed,
&dispatcher, &deflect::FrameDispatcher::deleteStream );
_deflectServer.get(), &deflect::Server::closePixelStream );

connect( _deflectServer.get(), &deflect::Server::receivedFrame,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::updateStreamDimensions );

connect( _pixelStreamWindowManager.get(),
&PixelStreamWindowManager::requestFirstFrame,
_deflectServer.get(), &deflect::Server::requestFrame );

connect( _deflectServer.get(), &deflect::Server::registerToEvents,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::registerEventReceiver );

connect( _pixelStreamWindowManager.get(),
&PixelStreamWindowManager::eventRegistrationReply,
_deflectServer.get(), &deflect::Server::replyToEventRegistration );

connect( _deflectServer.get(), &deflect::Server::receivedSizeHints,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::updateSizeHints );

connect( _deflectServer.get(), &deflect::Server::receivedData,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::sendDataToWindow );
}

void MasterApplication::_setupMPIConnections()
Expand Down Expand Up @@ -284,48 +314,12 @@ void MasterApplication::_setupMPIConnections()
{ _masterToWallChannel->sendAsync( markers ); },
Qt::DirectConnection );

connect( &_deflectServer->getPixelStreamDispatcher(),
&deflect::FrameDispatcher::sendFrame,
_masterToWallChannel.get(),
&MasterToWallChannel::send );
connect( &_deflectServer->getPixelStreamDispatcher(),
&deflect::FrameDispatcher::sendFrame,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::updateStreamDimensions );
connect( _deflectServer.get(),
&deflect::Server::registerToEvents,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::registerEventReceiver );
connect( _deflectServer.get(), &deflect::Server::receivedSizeHints,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::updateSizeHints );
connect( _deflectServer.get(), &deflect::Server::receivedData,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::sendDataToWindow );

connect( _pixelStreamWindowManager.get(),
&PixelStreamWindowManager::streamWindowClosed,
_deflectServer.get(), &deflect::Server::onPixelStreamerClosed );
connect( _pixelStreamWindowManager.get(),
&PixelStreamWindowManager::eventRegistrationReply,
_deflectServer.get(),
&deflect::Server::onEventRegistrationReply );
connect( _pixelStreamWindowManager.get(),
&PixelStreamWindowManager::requestFirstFrame,
&_deflectServer->getPixelStreamDispatcher(),
&deflect::FrameDispatcher::requestFrame );

_pixelStreamWindowManager->setAutoFocusNewWindows(
_options->getAutoFocusPixelStreams( ));
connect( _options.get(),
&Options::autoFocusPixelStreamsChanged,
_pixelStreamWindowManager.get(),
&PixelStreamWindowManager::setAutoFocusNewWindows );

connect( _masterFromWallChannel.get(),
&MasterFromWallChannel::receivedRequestFrame,
&_deflectServer->getPixelStreamDispatcher(),
&deflect::FrameDispatcher::requestFrame );
_deflectServer.get(), &deflect::Server::requestFrame );

connect( _deflectServer.get(), &deflect::Server::receivedFrame,
_masterToWallChannel.get(), &MasterToWallChannel::send );

connect( _masterFromWallChannel.get(),
&MasterFromWallChannel::receivedScreenshot,
Expand Down
Loading