Skip to content

Commit

Permalink
Remove protobuf component
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Nov 18, 2021
1 parent 03cc611 commit 2368398
Show file tree
Hide file tree
Showing 25 changed files with 8 additions and 981 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

env:
USE_CACHE: "1"
RESET_CACHE: "0"
RESET_CACHE: "1"

jobs:

Expand Down
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
path = dependencies/external/flatbuffers
url = https://github.com/google/flatbuffers
branch = master
[submodule "dependencies/external/protobuf"]
path = dependencies/external/protobuf
url = https://github.com/protocolbuffers/protobuf.git
branch = 3.14.x
[submodule "dependencies/external/mbedtls"]
path = dependencies/external/mbedtls
url = https://github.com/ARMmbed/mbedtls
Expand Down
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,6 @@ message(STATUS "ENABLE_CEC = ${ENABLE_CEC}")
SET ( FLATBUFFERS_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/flatbuf )
SET ( FLATBUFFERS_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/flatbuf )

SET ( PROTOBUF_INSTALL_BIN_DIR ${CMAKE_BINARY_DIR}/proto )
SET ( PROTOBUF_INSTALL_LIB_DIR ${CMAKE_BINARY_DIR}/proto )

find_package(GitVersion)

# configure a header file to pass some of the CMake settings
Expand Down
19 changes: 0 additions & 19 deletions assets/webconfig/js/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ $(document).ready( function() {
var conf_editor = null;
var conf_editor_net = null;
var conf_editor_json = null;
var conf_editor_proto = null;
var conf_editor_fbs = null;
var conf_editor_bobl = null;
var conf_editor_forw = null;
Expand All @@ -27,10 +26,6 @@ $(document).ready( function() {
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_fbs_heading_title"), 'editor_container_fbserver', 'btn_submit_fbserver'));
$('#conf_cont').append(createHelpTable(window.schema.flatbufServer.properties, $.i18n("edt_conf_fbs_heading_title")));

//protoserver
$('#conf_cont').append(createOptPanel('fa-sitemap', $.i18n("edt_conf_pbs_heading_title"), 'editor_container_protoserver', 'btn_submit_protoserver'));
$('#conf_cont').append(createHelpTable(window.schema.protoServer.properties, $.i18n("edt_conf_pbs_heading_title")));

//boblight
if (BOBLIGHT_ENABLED)
{
Expand Down Expand Up @@ -104,19 +99,6 @@ $(document).ready( function() {
requestWriteConfig(conf_editor_fbs.getValue());
});

//protobuffer
conf_editor_proto = createJsonEditor('editor_container_protoserver', {
protoServer : window.schema.protoServer
}, true, true);

conf_editor_proto.on('change',function() {
conf_editor_proto.validate().length || window.readOnlyMode ? $('#btn_submit_protoserver').attr('disabled', true) : $('#btn_submit_protoserver').attr('disabled', false);
});

$('#btn_submit_protoserver').off().on('click',function() {
requestWriteConfig(conf_editor_proto.getValue());
});

//boblight
if (BOBLIGHT_ENABLED)
{
Expand Down Expand Up @@ -156,7 +138,6 @@ $(document).ready( function() {
createHint("intro", $.i18n('conf_network_net_intro'), "editor_container_net");
createHint("intro", $.i18n('conf_network_json_intro'), "editor_container_jsonserver");
createHint("intro", $.i18n('conf_network_fbs_intro'), "editor_container_fbserver");
createHint("intro", $.i18n('conf_network_proto_intro'), "editor_container_protoserver");

if (BOBLIGHT_ENABLED)
{
Expand Down
122 changes: 1 addition & 121 deletions dependencies/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,136 +86,16 @@ function(compile_flattbuffer_schema SRC_FBS OUTPUT_DIR)
endfunction()

#=============================================================================
# PROTOBUFFER
# DISABLE EXTERNAL WARNINGS
#=============================================================================

set(USE_SYSTEM_PROTO_LIBS ${DEFAULT_USE_SYSTEM_PROTO_LIBS} CACHE BOOL "use protobuf library from system")

if (USE_SYSTEM_PROTO_LIBS)
find_package(Protobuf REQUIRED)
else ()
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf with tests")
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Build protobuf shared")

if (WIN32)
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Build protobuf static")
endif()

add_subdirectory(external/protobuf/cmake)

if(CMAKE_CROSSCOMPILING)
# when crosscompiling import the protoc executable targets from a file generated by a native build
option(IMPORT_PROTOC "Protoc export file (protoc_export.cmake) from a native build" "IMPORT_PROTOC-FILE_NOT_FOUND")
include(${IMPORT_PROTOC})
else()
# export the protoc compiler so it can be used when cross compiling
export(TARGETS protoc FILE "${CMAKE_BINARY_DIR}/protoc_export.cmake")
endif()

# define the include for the protobuf library at the parent scope
set(PROTOBUF_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/external/protobuf/src")

# define the protoc executable at the parent scope
set(PROTOBUF_PROTOC_EXECUTABLE "$<TARGET_FILE:protoc>")
endif()
option(protobuf_BUILD_TESTS "" OFF)
set(PROTOBUF_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE} PARENT_SCOPE)
set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS} PARENT_SCOPE)
include_directories(${PROTOBUF_INCLUDE_DIRS})

if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
target_compile_options(turbojpeg PRIVATE "-w")
target_compile_options(protoc PRIVATE "-w")
target_compile_options(libprotoc PRIVATE "-w")
target_compile_options(libprotobuf PRIVATE "-w")
target_compile_options(libprotobuf-lite PRIVATE "-w")
endif()
if ( MSVC )
target_compile_options(turbojpeg PRIVATE "/W0")
target_compile_options(protoc PRIVATE "/W0")
target_compile_options(libprotoc PRIVATE "/W0")
target_compile_options(libprotobuf PRIVATE "/W0")
target_compile_options(libprotobuf-lite PRIVATE "/W0")
endif()

message(STATUS "Using protobuf compiler: " ${PROTOBUF_PROTOC_EXECUTABLE})

#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009-2011 Philip Lowman <[email protected]>
# Copyright 2008 Esben Mose Hansen, Ange Optimization ApS
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
function(PROTOBUF_GENERATE_CPP SRCS HDRS)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
return()
endif()

if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
# Create an include path for each file specified
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(ABS_PATH ${ABS_FIL} PATH)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
else()
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()

if(DEFINED PROTOBUF_IMPORT_DIRS)
foreach(DIR ${PROTOBUF_IMPORT_DIRS})
get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
endif()

if(CMAKE_CROSSCOMPILING OR USE_SYSTEM_PROTO_LIBS)
set(PROTOC_DEPENDENCY ${PROTOBUF_PROTOC_EXECUTABLE})
else()
set(PROTOC_DEPENDENCY protoc)
endif()

set(${SRCS})
set(${HDRS})
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)

list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${PROTOC_DEPENDENCY}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM
)
set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc" PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h" PROPERTY SKIP_AUTOMOC ON)
endforeach()

set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
endfunction()

#=============================================================================
# MBEDTLS
Expand Down
1 change: 0 additions & 1 deletion dependencies/external/protobuf
Submodule protobuf deleted from 89b14b
69 changes: 0 additions & 69 deletions include/protoserver/ProtoServer.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/ssdp/SSDPHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SSDPHandler : public SSDPServer
{
Q_OBJECT
public:
SSDPHandler(WebServer* webserver, quint16 flatBufPort, quint16 protoBufPort, quint16 jsonServerPort, quint16 sslPort, const QString &name, QObject * parent = nullptr);
SSDPHandler(WebServer* webserver, quint16 flatBufPort,quint16 jsonServerPort, quint16 sslPort, const QString &name, QObject * parent = nullptr);
~SSDPHandler() override;

///
Expand Down
11 changes: 1 addition & 10 deletions include/ssdp/SSDPServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,7 @@ class SSDPServer : public QObject
quint16 getFlatBufPort() const
{
return _fbsPort.toInt();
}
///
/// @brief set new protobuf server port
///
void setProtoBufPort( quint16 port ) { _pbsPort = QString::number( port ); }

///
/// @brief Get current protobuf server port
///
quint16 getProtoBufPort() const { return _pbsPort.toInt(); }
}
///
/// @brief set new json server port
///
Expand Down
3 changes: 0 additions & 3 deletions include/utils/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace settings {
VIDEODETECTION,
NETWORK,
FLATBUFSERVER,
PROTOSERVER,
INVALID
};

Expand Down Expand Up @@ -67,7 +66,6 @@ namespace settings {
case type::VIDEODETECTION:return "videoDetection";
case type::NETWORK: return "network";
case type::FLATBUFSERVER: return "flatbufServer";
case type::PROTOSERVER: return "protoServer";
default: return "invalid";
}
}
Expand Down Expand Up @@ -102,7 +100,6 @@ namespace settings {
else if (type == "videoDetection") return type::VIDEODETECTION;
else if (type == "network") return type::NETWORK;
else if (type == "flatbufServer") return type::FLATBUFSERVER;
else if (type == "protoServer") return type::PROTOSERVER;
else return type::INVALID;
}
}
1 change: 0 additions & 1 deletion libsrc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_subdirectory(commandline)
add_subdirectory(blackborder)
add_subdirectory(jsonserver)
add_subdirectory(flatbufserver)
add_subdirectory(protoserver)
add_subdirectory(ssdp)
if(ENABLE_BOBLIGHT)
add_subdirectory(boblightserver)
Expand Down
2 changes: 1 addition & 1 deletion libsrc/db/SettingsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool SettingsTable::isSettingGlobal(const QString& type) const
// list of global settings
QStringList list;
// server port services
list << settings::typeToString(settings::type::JSONSERVER) << settings::typeToString(settings::type::PROTOSERVER)
list << settings::typeToString(settings::type::JSONSERVER)
<< settings::typeToString(settings::type::FLATBUFSERVER) << settings::typeToString(settings::type::NETWORK)
<< settings::typeToString(settings::type::NETFORWARD) << settings::typeToString(settings::type::WEBSERVER)
<< settings::typeToString(settings::type::VIDEOGRABBER) << settings::typeToString(settings::type::SYSTEMGRABBER)
Expand Down
21 changes: 1 addition & 20 deletions libsrc/hyperhdrbase/SettingsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,7 @@ SettingsManager::SettingsManager(quint8 instance, QObject* parent, bool readonly
// get default config
QJsonObject defaultConfig;
for (settings::type selector = settings::type::SNDEFFECT; selector != settings::type::INVALID; selector = settings::type(((int)selector) + 1))
{
if (selector == settings::type::VIDEOGRABBER)
{
if(!_sTable->recordExist(typeToString(selector)) && _sTable->recordExist("grabberV4L2"))
{
auto oldVideo = _sTable->getSettingsRecord("grabberV4L2").object();

oldVideo["device"] = oldVideo["available_devices"];

oldVideo["videoEncoding"] = oldVideo["v4l2Encoding"];
oldVideo["videoMode"] = QString("%1x%2").arg(oldVideo["width"].toInt()).arg(oldVideo["height"].toInt());

defaultConfig.insert(typeToString(selector), oldVideo);
_sTable->deleteSettingsRecordString("grabberV4L2");

Warning(_log, "Found old V4L2 configuration. Migrating defaults to the new structures.");
continue;
}
}

{
if (selector != settings::type::LEDS)
defaultConfig.insert(typeToString(selector), QJsonObject());
else
Expand Down
4 changes: 0 additions & 4 deletions libsrc/hyperhdrbase/hyperhdr.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
{
"$ref": "schema-flatbufServer.json"
},
"protoServer" :
{
"$ref": "schema-protoServer.json"
},
"boblightServer" :
{
"$ref": "schema-boblightServer.json"
Expand Down
Loading

0 comments on commit 2368398

Please sign in to comment.