diff --git a/configure.ac b/configure.ac index 4ceecf734..355bdca99 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,7 @@ lib/libnet/Makefile lib/xmltree/Makefile lib/sectionsdclient/Makefile lib/timerdclient/Makefile +lib/libcoolstream/Makefile lib/libtriple/Makefile lib/libtuxtxt/Makefile lib/libdvbsub/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index 0b444f7bb..098777bc5 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -21,4 +21,8 @@ if BOXTYPE_TRIPLE SUBDIRS += \ libtriple endif +if BOXTYPE_COOL +SUBDIRS += \ + libcoolstream +endif endif diff --git a/lib/libcoolstream/Makefile.am b/lib/libcoolstream/Makefile.am new file mode 100644 index 000000000..6709b6dc6 --- /dev/null +++ b/lib/libcoolstream/Makefile.am @@ -0,0 +1,6 @@ +noinst_LIBRARIES = libhwcaps.a + +AM_CXXFLAGS = -fno-rtti -fno-exceptions -fno-strict-aliasing + +libhwcaps_a_SOURCES = \ + hardware_caps.cpp diff --git a/lib/libcoolstream/hardware_caps.cpp b/lib/libcoolstream/hardware_caps.cpp new file mode 100644 index 000000000..619029162 --- /dev/null +++ b/lib/libcoolstream/hardware_caps.cpp @@ -0,0 +1,37 @@ +/* + * determine the capabilities of the hardware. + * part of libstb-hal + * + * (C) 2010-2012 Stefan Seyfried + * + * License: GPL v2 or later + */ +#include "hardware_caps.h" +static int initialized = 0; +static hw_caps_t caps; + +hw_caps_t *get_hwcaps(void) { + if (initialized) + return ∩︀ + caps.has_fan = (cs_get_revision() < 8); + caps.has_HDMI = 1; + caps.has_SCART = (cs_get_revision() != 10); + caps.has_SCART_input = 0; + caps.has_YUV_cinch = 1; + caps.can_shutdown = (cs_get_revision() > 7); + caps.can_cec = 1; + caps.display_type = HW_DISPLAY_LINE_TEXT; + caps.display_xres = 12; + caps.display_yres = 0; + caps.can_set_display_brightness = 1; + strcpy(caps.boxvendor, "Coolstream"); + if (cs_get_revision() < 8) + strcpy(caps.boxname, "HD1"); + else if (cs_get_revision() == 10) + strcpy(caps.boxname, "ZEE"); + else + strcpy(caps.boxname, "NEO"); + initialized = 1; + return ∩︀ +} + diff --git a/lib/libcoolstream/hardware_caps.h b/lib/libcoolstream/hardware_caps.h index fe9cf36b4..f91821da5 100644 --- a/lib/libcoolstream/hardware_caps.h +++ b/lib/libcoolstream/hardware_caps.h @@ -10,10 +10,8 @@ #define __HARDWARE_CAPS_H__ #include "cs_api.h" +#include -#ifdef __cplusplus -extern "C" { -#endif typedef enum { HW_DISPLAY_NONE, @@ -40,34 +38,5 @@ typedef struct hw_caps char boxname[64]; } hw_caps_t; -hw_caps_t *get_hwcaps(void) { - static int initialized = 0; - static hw_caps_t caps; - if (initialized) - return ∩︀ - caps.has_fan = (cs_get_revision() < 8); - caps.has_HDMI = 1; - caps.has_SCART = (cs_get_revision() != 10); - caps.has_SCART_input = 0; - caps.has_YUV_cinch = 1; - caps.can_shutdown = (cs_get_revision() > 7); - caps.can_cec = 1; - caps.display_type = HW_DISPLAY_LINE_TEXT; - caps.display_xres = 12; - caps.display_yres = 0; - caps.can_set_display_brightness = 1; - strcpy(caps.boxvendor, "Coolstream"); - if (cs_get_revision() < 8) - strcpy(caps.boxname, "HD1"); - else if (cs_get_revision() == 10) - strcpy(caps.boxname, "ZEE"); - else - strcpy(caps.boxname, "NEO"); - initialized = 1; - return ∩︀ -} - -#ifdef __cplusplus -} -#endif +hw_caps_t *get_hwcaps(void); #endif diff --git a/src/Makefile.am b/src/Makefile.am index e646660ec..ff2055afe 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -114,6 +114,7 @@ endif if BOXTYPE_COOL neutrino_LDADD += \ + $(top_builddir)/lib/libcoolstream/libhwcaps.a \ -lcoolstream-mt \ -lnxp