implement proto forwarding for hyperiond internal v4l2 grabber

cleanup


Former-commit-id: 669f139386633e3435cdc33639134819464afd4d
This commit is contained in:
redpanther
2016-02-16 15:41:40 +01:00
parent 738bafee99
commit 629461b944
8 changed files with 62 additions and 40 deletions

View File

@@ -94,6 +94,9 @@ void V4L2Wrapper::newFrame(const Image<ColorRgb> &image)
// process the new image
_processor->process(image, _ledColors);
// forward to other hyperions
emit emitImage(_priority, image, _timeout_ms);
// send colors to Hyperion
emit emitColors(_priority, _ledColors, _timeout_ms);
}

View File

@@ -6,7 +6,6 @@ SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion)
# Group the headers that go through the MOC compiler
SET(Hyperion_QT_HEADERS
${CURRENT_HEADER_DIR}/Hyperion.h
${CURRENT_HEADER_DIR}/MessageForwarder.h
${CURRENT_SOURCE_DIR}/LinearColorSmoothing.h
)
@@ -19,6 +18,7 @@ SET(Hyperion_HEADERS
${CURRENT_HEADER_DIR}/PriorityMuxer.h
${CURRENT_SOURCE_DIR}/MultiColorTransform.h
${CURRENT_HEADER_DIR}/MessageForwarder.h
)
SET(Hyperion_SOURCES

View File

@@ -35,10 +35,6 @@ void MessageForwarder::addProtoSlave(std::string slave)
_protoSlaves << QString(slave.c_str());
}
void MessageForwarder::sendMessage()
{
}
QStringList MessageForwarder::getProtoSlaves()
{
return _protoSlaves;

View File

@@ -70,6 +70,12 @@ void ProtoServer::newMessage(const proto::HyperionRequest * message)
_proxy_connections.at(i)->sendMessage(*message);
}
void ProtoServer::sendImageToProtoSlaves(int priority, const Image<ColorRgb> & image, int duration_ms)
{
for (int i = 0; i < _proxy_connections.size(); ++i)
_proxy_connections.at(i)->setImage(image, priority, duration_ms);
}
void ProtoServer::closedConnection(ProtoClientConnection *connection)
{
std::cout << "Proto connection closed" << std::endl;