remove protobuf (part 2)

This commit is contained in:
Paulchen-Panther
2018-12-30 22:07:53 +01:00
parent 559311e18c
commit 38950edf35
54 changed files with 1441 additions and 377 deletions

View File

@@ -4,8 +4,8 @@ project(hyperion-aml)
find_package(Qt5Widgets REQUIRED)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/protoserver
${PROTOBUF_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}/../../libsrc/flatbufserver
${FLATBUFFERS_INCLUDE_DIRS}
)
set(Hyperion_AML_HEADERS
@@ -27,9 +27,11 @@ target_link_libraries(${PROJECT_NAME}
commandline
blackborder
hyperion-utils
protoclient
flatbufserver
flatbuffers
amlogic-grabber
framebuffer-grabber
ssdp
Qt5::Core
Qt5::Gui
Qt5::Network

View File

@@ -4,12 +4,15 @@
#include <QCoreApplication>
#include <QImage>
#include <protoserver/ProtoConnectionWrapper.h>
#include <flatbufserver/FlatBufferConnection.h>
#include "AmlogicWrapper.h"
#include "HyperionConfig.h"
#include <commandline/Parser.h>
// ssdp discover
#include <ssdp/SSDPDiscover.h>
using namespace commandline;
// save the image as screenshot
@@ -32,7 +35,7 @@ int main(int argc, char ** argv)
try
{
// create the option parser and initialize all parser
Parser parser("AmLogic capture application for Hyperion");
Parser parser("AmLogic capture application for Hyperion. Will automatically search a Hyperion server if -a option isn't used. Please note that if you have more than one server running it's more or less random which one will be used.");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
@@ -62,11 +65,26 @@ int main(int argc, char ** argv)
}
else
{
// Create the Proto-connection with hyperiond
ProtoConnectionWrapper protoWrapper(argAddress.value(parser), argPriority.getInt(parser), 1000, parser.isSet(argSkipReply));
// server searching by ssdp
QString address;
if(parser.isSet(argAddress))
{
address = argAddress.value(parser);
}
else
{
SSDPDiscover discover;
address = discover.getFirstService(STY_FLATBUFSERVER);
if(address.isEmpty())
{
address = argAddress.value(parser);
}
}
// Create the Flabuf-connection
FlatBufferConnection flatbuf("AML Standalone", address, argPriority.getInt(parser), parser.isSet(argSkipReply));
// Connect the screen capturing to the proto processing
QObject::connect(&amlWrapper, SIGNAL(sig_screenshot(const Image<ColorRgb> &)), &protoWrapper, SLOT(receiveImage(Image<ColorRgb>)));
// Connect the screen capturing to flatbuf connection processing
QObject::connect(&amlWrapper, SIGNAL(sig_screenshot(const Image<ColorRgb> &)), &flatbuf, SLOT(setImage(Image<ColorRgb>)));
// Start the capturing
amlWrapper.start();