mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
remove protobuf (part 2)
This commit is contained in:
@@ -4,8 +4,8 @@ project(hyperion-v4l2)
|
||||
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_V4L2_HEADERS
|
||||
@@ -28,7 +28,9 @@ target_link_libraries(${PROJECT_NAME}
|
||||
commandline
|
||||
blackborder
|
||||
hyperion-utils
|
||||
protoclient
|
||||
flatbufserver
|
||||
flatbuffers
|
||||
ssdp
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Network
|
||||
|
@@ -12,9 +12,8 @@
|
||||
// grabber includes
|
||||
#include "grabber/V4L2Grabber.h"
|
||||
|
||||
// proto includes
|
||||
#include "protoserver/ProtoConnection.h"
|
||||
#include "protoserver/ProtoConnectionWrapper.h"
|
||||
// flatbuf includes
|
||||
#include <flatbufserver/FlatBufferConnection.h>
|
||||
|
||||
// hyperion-v4l2 includes
|
||||
#include "ScreenshotHandler.h"
|
||||
@@ -22,6 +21,9 @@
|
||||
#include "HyperionConfig.h"
|
||||
#include <commandline/Parser.h>
|
||||
|
||||
// ssdp discover
|
||||
#include <ssdp/SSDPDiscover.h>
|
||||
|
||||
using namespace commandline;
|
||||
|
||||
// save the image as screenshot
|
||||
@@ -54,7 +56,7 @@ int main(int argc, char** argv)
|
||||
try
|
||||
{
|
||||
// create the option parser and initialize all parameters
|
||||
Parser parser("V4L capture application for Hyperion");
|
||||
Parser parser("V4L 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.");
|
||||
|
||||
Option & argDevice = parser.add<Option> ('d', "device", "The device to use, can be /dev/video0 [default: %1 (auto detected)]", "auto");
|
||||
SwitchOption<VideoStandard> & argVideoStandard= parser.add<SwitchOption<VideoStandard>>('v', "video-standard", "The used video standard. Valid values are PAL, NTSC, SECAM or no-change. [default: %1]", "no-change");
|
||||
@@ -188,8 +190,28 @@ int main(int argc, char** argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
ProtoConnectionWrapper protoWrapper(argAddress.value(parser), argPriority.getInt(parser), 1000, parser.isSet(argSkipReply));
|
||||
QObject::connect(&grabber, SIGNAL(newFrame(Image<ColorRgb>)), &protoWrapper, SLOT(receiveImage(Image<ColorRgb>)));
|
||||
// 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 Flatbuf-connection
|
||||
FlatBufferConnection flatbuf("V4L2 Standalone", address, argPriority.getInt(parser), parser.isSet(argSkipReply));
|
||||
|
||||
// Connect the screen capturing to flatbuf connection processing
|
||||
QObject::connect(&grabber, SIGNAL(newFrame(const Image<ColorRgb> &)), &flatbuf, SLOT(setImage(Image<ColorRgb>)));
|
||||
|
||||
if (grabber.start())
|
||||
QCoreApplication::exec();
|
||||
grabber.stop();
|
||||
|
Reference in New Issue
Block a user