Merge branch 'HEAD' of https://github.com/tvdzwan/hyperion.git into multi_colortransform

Former-commit-id: fb4ab6331b5428bd34f5cc7ac7eba3fade5ef7dc
This commit is contained in:
T. van der Zwan 2013-11-20 08:26:09 +00:00
commit b967f51f38
14 changed files with 51 additions and 14 deletions

View File

@ -1,9 +1,20 @@
project(hyperion)
# define the minimum cmake version (as required by cmake) # define the minimum cmake version (as required by cmake)
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
#set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake) #set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake)
# set the build options
option (ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX})
# Createt the configuration file
# configure a header file to pass some of the CMake settings
# to the source code
configure_file ("${PROJECT_SOURCE_DIR}/HyperionConfig.h.in" "${PROJECT_BINARY_DIR}/HyperionConfig.h")
include_directories("${PROJECT_BINARY_DIR}")
# Define the main-project name # Define the main-project name
project(Hyperion) project(Hyperion)
@ -37,8 +48,9 @@ find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED QUIET)
# add protocol buffers # add protocol buffers
find_package(Protobuf REQUIRED) find_package(Protobuf REQUIRED)
#add libusb #add libusb and pthreads
find_package(libusb-1.0 REQUIRED) find_package(libusb-1.0 REQUIRED)
find_package(Threads REQUIRED)
#SET(QT_DONT_USE_QTGUI TRUE) #SET(QT_DONT_USE_QTGUI TRUE)
#SET(QT_USE_QTCONSOLE TRUE) #SET(QT_USE_QTCONSOLE TRUE)

4
HyperionConfig.h.in Normal file
View File

@ -0,0 +1,4 @@
// Generated config file
// Define to enable the dispmanx grabber
#cmakedefine ENABLE_DISPMANX

View File

@ -1 +1 @@
2361db3581db887d5f2de0077d0ef6a16a5bb582 97f01ae47416100223417becca5c3a50a773fbfa

Binary file not shown.

View File

@ -1 +1 @@
d59ae219a9dad5cd6138c23122df5e3313e473cb 5031f4b1d3a2682b6df94ba6671bcc97f9b5a4d1

View File

@ -4,10 +4,13 @@ SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc)
add_subdirectory(bootsequence) add_subdirectory(bootsequence)
add_subdirectory(dispmanx-grabber)
add_subdirectory(hyperion) add_subdirectory(hyperion)
add_subdirectory(jsonserver) add_subdirectory(jsonserver)
add_subdirectory(protoserver) add_subdirectory(protoserver)
add_subdirectory(boblightserver) add_subdirectory(boblightserver)
add_subdirectory(utils) add_subdirectory(utils)
add_subdirectory(xbmcvideochecker) add_subdirectory(xbmcvideochecker)
if (ENABLE_DISPMANX)
add_subdirectory(dispmanx-grabber)
endif (ENABLE_DISPMANX)

View File

@ -24,7 +24,7 @@ BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, cons
const unsigned duration_ms = jsonConfig["duration_ms"].asUInt(); const unsigned duration_ms = jsonConfig["duration_ms"].asUInt();
return new RainbowBootSequence(hyperion, duration_ms); return new RainbowBootSequence(hyperion, duration_ms);
} }
else if (type == "knightrider" || type == "knight rider") else if (type == "knightrider" || type == "knight rider" || "knight_rider")
{ {
std::cout << "SELECTED BOOT SEQUENCE: " << "KITT" << std::endl; std::cout << "SELECTED BOOT SEQUENCE: " << "KITT" << std::endl;
const unsigned duration_ms = jsonConfig["duration_ms"].asUInt(); const unsigned duration_ms = jsonConfig["duration_ms"].asUInt();
@ -34,5 +34,3 @@ BootSequence * BootSequenceFactory::createBootSequence(Hyperion * hyperion, cons
std::cerr << "Unknown boot-sequence selected; boot-sequence disabled." << std::endl; std::cerr << "Unknown boot-sequence selected; boot-sequence disabled." << std::endl;
return nullptr; return nullptr;
} }

View File

@ -82,4 +82,5 @@ target_link_libraries(hyperion
hyperion-utils hyperion-utils
serialport serialport
${QT_LIBRARIES} ${QT_LIBRARIES}
${LIBUSB_1_LIBRARIES}) ${LIBUSB_1_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})

View File

@ -168,7 +168,7 @@ void JsonClientConnection::handleServerInfoCommand(const Json::Value &message)
item["priority"] = priority; item["priority"] = priority;
if (priorityInfo.timeoutTime_ms != -1) if (priorityInfo.timeoutTime_ms != -1)
{ {
item["duration_ms"] = priorityInfo.timeoutTime_ms - now; item["duration_ms"] = Json::Value::UInt(priorityInfo.timeoutTime_ms - now);
} }
} }

View File

@ -7,7 +7,7 @@ public enum BootSequence {
/** The rainbow boot sequence */ /** The rainbow boot sequence */
rainbow, rainbow,
/** The Knight Rider (or KITT) boot sequence */ /** The Knight Rider (or KITT) boot sequence */
knight_rider; knightrider;
/** /**
* Returns a string representation of the BootSequence * Returns a string representation of the BootSequence
@ -19,7 +19,7 @@ public enum BootSequence {
switch(this) { switch(this) {
case rainbow: case rainbow:
return "Rainbow"; return "Rainbow";
case knight_rider: case knightrider:
return "Kinght Rider"; return "Kinght Rider";
} }
return "None"; return "None";

View File

@ -62,7 +62,7 @@ public class MiscConfig {
StringBuffer strBuf = new StringBuffer(); StringBuffer strBuf = new StringBuffer();
strBuf.append("\t/// The boot-sequence configuration, contains the following items: \n"); strBuf.append("\t/// The boot-sequence configuration, contains the following items: \n");
strBuf.append("\t/// * type : The type of the boot-sequence ('rainbow', 'knight_rider', 'none') \n"); strBuf.append("\t/// * type : The type of the boot-sequence ('rainbow', 'knightrider', 'none') \n");
strBuf.append("\t/// * duration_ms : The length of the boot-sequence [ms]\n"); strBuf.append("\t/// * duration_ms : The length of the boot-sequence [ms]\n");
String bootPreamble = mBootsequenceEnabled? "\t" : "//\t"; String bootPreamble = mBootsequenceEnabled? "\t" : "//\t";

View File

@ -5,8 +5,11 @@ add_executable(hyperiond
target_link_libraries(hyperiond target_link_libraries(hyperiond
bootsequence bootsequence
hyperion hyperion
dispmanx-grabber
xbmcvideochecker xbmcvideochecker
jsonserver jsonserver
protoserver protoserver
boblightserver) boblightserver)
if (ENABLE_DISPMANX)
target_link_libraries(hyperiond dispmanx-grabber)
endif (ENABLE_DISPMANX)

View File

@ -6,6 +6,9 @@
#include <QCoreApplication> #include <QCoreApplication>
#include <QResource> #include <QResource>
// config includes
#include "HyperionConfig.h"
// Json-Schema includes // Json-Schema includes
#include <utils/jsonschema/JsonFactory.h> #include <utils/jsonschema/JsonFactory.h>
@ -15,8 +18,10 @@
// Bootsequence includes // Bootsequence includes
#include <bootsequence/BootSequenceFactory.h> #include <bootsequence/BootSequenceFactory.h>
#ifdef ENABLE_DISPMANX
// Dispmanx grabber includes // Dispmanx grabber includes
#include <dispmanx-grabber/DispmanxWrapper.h> #include <dispmanx-grabber/DispmanxWrapper.h>
#endif
// XBMC Video checker includes // XBMC Video checker includes
#include <xbmcvideochecker/XBMCVideoChecker.h> #include <xbmcvideochecker/XBMCVideoChecker.h>
@ -118,6 +123,7 @@ int main(int argc, char** argv)
std::cout << "XBMC video checker created and started" << std::endl; std::cout << "XBMC video checker created and started" << std::endl;
} }
#ifdef ENABLE_DISPMANX
// Construct and start the frame-grabber if the configuration is present // Construct and start the frame-grabber if the configuration is present
DispmanxWrapper * dispmanx = nullptr; DispmanxWrapper * dispmanx = nullptr;
if (config.isMember("framegrabber")) if (config.isMember("framegrabber"))
@ -137,6 +143,12 @@ int main(int argc, char** argv)
dispmanx->start(); dispmanx->start();
std::cout << "Frame grabber created and started" << std::endl; std::cout << "Frame grabber created and started" << std::endl;
} }
#else
if (config.isMember("framegrabber"))
{
std::cerr << "The dispmanx framegrabber can not be instantiated, becuse it has been left out from the build" << std::endl;
}
#endif
// Create Json server if configuration is present // Create Json server if configuration is present
JsonServer * jsonServer = nullptr; JsonServer * jsonServer = nullptr;
@ -171,7 +183,9 @@ int main(int argc, char** argv)
// Delete all component // Delete all component
delete bootSequence; delete bootSequence;
#ifdef ENABLE_DISPMANX
delete dispmanx; delete dispmanx;
#endif
delete xbmcVideoChecker; delete xbmcVideoChecker;
delete jsonServer; delete jsonServer;
delete protoServer; delete protoServer;

View File

@ -27,7 +27,9 @@ add_executable(test_image2ledsmap
target_link_libraries(test_image2ledsmap target_link_libraries(test_image2ledsmap
hyperion) hyperion)
add_subdirectory(dispmanx2png) if (ENABLE_DISPMANX)
add_subdirectory(dispmanx2png)
endif (ENABLE_DISPMANX)
add_executable(test_blackborderdetector add_executable(test_blackborderdetector
TestBlackBorderDetector.cpp) TestBlackBorderDetector.cpp)