Permalink
Browse files

rebased PR1794 + fixes for Frodo

  • Loading branch information...
opdenkamp committed Feb 28, 2013
1 parent a1a93b5 commit a21144018000437f9863780bf5c3ccf67bca2d73
Showing with 377 additions and 343 deletions.
  1. +14 −0 XBMC.xcodeproj/project.pbxproj
  2. +2 −38 configure.in
  3. +1 −1 lib/libcec/Makefile
  4. +1 −1 project/BuildDependencies/scripts/libcec_d.txt
  5. +2 −0 project/VS2010Express/XBMC.vcxproj
  6. +6 −0 project/VS2010Express/XBMC.vcxproj.filters
  7. +7 −24 system/peripherals.xml
  8. +3 −3 tools/android/depends/libcec/Makefile
  9. +1 −1 tools/darwin/depends/libcec/Makefile
  10. +75 −1 xbmc/peripherals/PeripheralTypes.h
  11. +30 −32 xbmc/peripherals/Peripherals.cpp
  12. +3 −4 xbmc/peripherals/Peripherals.h
  13. +2 −2 xbmc/peripherals/bus/Makefile.in
  14. +18 −63 xbmc/peripherals/bus/PeripheralBus.cpp
  15. +1 −22 xbmc/peripherals/bus/PeripheralBus.h
  16. +0 −69 xbmc/peripherals/bus/linux/PeripheralBusRPi.cpp
  17. +2 −1 xbmc/peripherals/bus/linux/PeripheralBusUSBLibUSB.cpp
  18. +2 −2 xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp
  19. +1 −0 xbmc/peripherals/bus/osx/PeripheralBusUSB.cpp
  20. +116 −0 xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
  21. +22 −5 xbmc/peripherals/bus/{linux/PeripheralBusRPi.h → virtual/PeripheralBusCEC.h}
  22. +3 −2 xbmc/peripherals/bus/win32/PeripheralBusUSB.cpp
  23. +22 −28 xbmc/peripherals/devices/Peripheral.cpp
  24. +4 −2 xbmc/peripherals/devices/Peripheral.h
  25. +2 −2 xbmc/peripherals/devices/PeripheralBluetooth.cpp
  26. +1 −1 xbmc/peripherals/devices/PeripheralBluetooth.h
  27. +14 −20 xbmc/peripherals/devices/PeripheralCecAdapter.cpp
  28. +1 −1 xbmc/peripherals/devices/PeripheralCecAdapter.h
  29. +3 −2 xbmc/peripherals/devices/PeripheralDisk.cpp
  30. +1 −1 xbmc/peripherals/devices/PeripheralDisk.h
  31. +3 −2 xbmc/peripherals/devices/PeripheralHID.cpp
  32. +1 −1 xbmc/peripherals/devices/PeripheralHID.h
  33. +2 −2 xbmc/peripherals/devices/PeripheralImon.cpp
  34. +1 −1 xbmc/peripherals/devices/PeripheralImon.h
  35. +3 −2 xbmc/peripherals/devices/PeripheralNIC.cpp
  36. +1 −1 xbmc/peripherals/devices/PeripheralNIC.h
  37. +2 −2 xbmc/peripherals/devices/PeripheralNyxboard.cpp
  38. +1 −1 xbmc/peripherals/devices/PeripheralNyxboard.h
  39. +2 −2 xbmc/peripherals/devices/PeripheralTuner.cpp
  40. +1 −1 xbmc/peripherals/devices/PeripheralTuner.h
@@ -25,6 +25,7 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 041998BC16EA2958000B326D /* PeripheralBusCEC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 041998BB16EA2958000B326D /* PeripheralBusCEC.cpp */; };
183FDF8A11AF0B0500B81E9C /* PluginSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 183FDF8811AF0B0500B81E9C /* PluginSource.cpp */; };
18404DA61396C31B00863BBA /* SlingboxLib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 18404DA51396C31B00863BBA /* SlingboxLib.a */; };
1840B74D13993D8A007C848B /* JSONVariantParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1840B74B13993D8A007C848B /* JSONVariantParser.cpp */; };
@@ -1065,6 +1066,8 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
+ 041998BB16EA2958000B326D /* PeripheralBusCEC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PeripheralBusCEC.cpp; sourceTree = "<group>"; };
+ 041998BD16EA2964000B326D /* PeripheralBusCEC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeripheralBusCEC.h; sourceTree = "<group>"; };
18308CB41303370800AA309E /* stat_utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stat_utf8.h; sourceTree = "<group>"; };
18308CB51303370800AA309E /* stdio_utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = stdio_utf8.h; sourceTree = "<group>"; };
183FDF8811AF0B0500B81E9C /* PluginSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginSource.cpp; sourceTree = "<group>"; };
@@ -3731,6 +3734,15 @@
name = Products;
sourceTree = "<group>";
};
+ 1DAFDB7916DFDCA7007F8C68 /* virtual */ = {
+ isa = PBXGroup;
+ children = (
+ 041998BD16EA2964000B326D /* PeripheralBusCEC.h */,
+ 041998BB16EA2958000B326D /* PeripheralBusCEC.cpp */,
+ );
+ path = virtual;
+ sourceTree = "<group>";
+ };
38F4E56013CCCB3B00664821 /* platform */ = {
isa = PBXGroup;
children = (
@@ -6371,6 +6383,7 @@
F5E1050D140AA38000175026 /* bus */ = {
isa = PBXGroup;
children = (
+ 1DAFDB7916DFDCA7007F8C68 /* virtual */,
F5E10512140AA38000175026 /* osx */,
F5E10515140AA38000175026 /* PeripheralBus.cpp */,
F5E10516140AA38000175026 /* PeripheralBus.h */,
@@ -7724,6 +7737,7 @@
DFB02DEA16629DBA00F37752 /* PyContext.cpp in Sources */,
DF07252E168734D7008DCAAD /* karaokevideobackground.cpp in Sources */,
DF072534168734ED008DCAAD /* FFmpegVideoDecoder.cpp in Sources */,
+ 041998BC16EA2958000B326D /* PeripheralBusCEC.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -157,8 +157,6 @@ libusb_disabled="== libusb disabled. Plug and play USB device support will not b
libusb_disabled_udev_found="== libusb disabled. =="
libcec_enabled="== libcec enabled. =="
libcec_disabled="== libcec disabled. CEC adapter support will not be available. =="
-libcec_disabled_missing_libs="== libcec disabled because it either needs libudev, or libusb a compatible version of the RPi API. CEC adapter support will not be available. =="
-cec_rpi_api_missing="== no compatible RPi API found =="
# External library message strings
external_libraries_enabled="== Use of all supported external libraries enabled. =="
@@ -1455,46 +1453,18 @@ fi
# libcec
USE_LIBCEC=0
-USE_CEC_RPI_API=0
-use_rpi_cec_api="auto"
if test "x$use_libcec" != "xno"; then
- case "${host_cpu}" in
- arm*)
- echo "will check for RPi support"
- AC_CHECK_HEADER(interface/vmcs_host/vc_cec.h,,use_rpi_cec_api="no")
- ;;
- *)
- echo "will not check for RPi support (unsupported cpu: ${host_cpu})"
- use_rpi_cec_api="no"
- ;;
- esac
-
- # libcec needs libudev, libusb or the RPi API under linux, or the device will never be detected.
- if test "$host_vendor" != "apple" && test "$use_libusb" = "no" && test "$use_libudev" = "no" && test "$use_rpi_cec_api" = "no"; then
- if test "x$use_libcec" != "xauto"; then
- AC_MSG_ERROR($libcec_disabled_missing_libs)
- else
- use_libcec="no"
- AC_MSG_NOTICE($libcec_disabled_missing_libs)
- fi
- fi
-
# libcec is dyloaded, so we need to check for its headers and link any depends.
if test "x$use_libcec" != "xno"; then
if test "x$use_libcec" != "xauto"; then
- PKG_CHECK_MODULES([CEC],[libcec >= 2.0.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
+ PKG_CHECK_MODULES([CEC],[libcec >= 2.1.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
else
- PKG_CHECK_MODULES([CEC],[libcec >= 2.0.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
+ PKG_CHECK_MODULES([CEC],[libcec >= 2.1.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
fi
if test "x$use_libcec" != "xno"; then
INCLUDES="$INCLUDES $CEC_CFLAGS"
USE_LIBCEC=1;AC_DEFINE([HAVE_LIBCEC],[1],["Define to 1 if libcec is installed"])
- if test "x$use_rpi_cec_api" != "xno"; then
- LIBS+=" -lvcos -lvchiq_arm"
- AC_DEFINE([HAVE_CEC_RPI_API],[1],["Define to 1 if the CEC RPi API is installed"])
- USE_CEC_RPI_API=1
- fi
XB_FIND_SONAME([LIBCEC],[cec],[use_libcec])
AC_MSG_NOTICE($libcec_enabled)
else
@@ -2255,11 +2225,6 @@ fi
if test "x$use_libcec" != "xno"; then
final_message="$final_message\n libcec support:\tYes"
- if test "x$use_rpi_cec_api" != "xno"; then
- final_message="$final_message\n libcec RPi support:\tYes"
- else
- final_message="$final_message\n libcec RPi support:\tNo"
- fi
else
final_message="$final_message\n libcec support:\tNo"
fi
@@ -2451,7 +2416,6 @@ AC_SUBST(USE_AIRTUNES)
AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
-AC_SUBST(USE_CEC_RPI_API)
AC_SUBST(USE_MYSQL)
AC_SUBST(USE_WEB_SERVER)
AC_SUBST(USE_UPNP)
View
@@ -7,7 +7,7 @@
# lib name, version
LIBNAME=libcec
-VERSION=2.0.3
+VERSION=2.1.1
SOURCE=$(LIBNAME)-$(VERSION)
# download location and format
@@ -1,3 +1,3 @@
; filename source of the file
-libcec-2.0.5.zip http://mirrors.xbmc.org/build-deps/win32/
+libcec-2.1.1.zip http://mirrors.xbmc.org/build-deps/win32/
@@ -857,6 +857,7 @@
<ClCompile Include="..\..\xbmc\PartyModeManager.cpp" />
<ClCompile Include="..\..\xbmc\PasswordManager.cpp" />
<ClCompile Include="..\..\xbmc\peripherals\bus\PeripheralBus.cpp" />
+ <ClCompile Include="..\..\xbmc\peripherals\bus\virtual\PeripheralBusCEC.cpp" />
<ClCompile Include="..\..\xbmc\peripherals\bus\win32\PeripheralBusUSB.cpp" />
<ClCompile Include="..\..\xbmc\peripherals\devices\Peripheral.cpp" />
<ClCompile Include="..\..\xbmc\peripherals\devices\PeripheralBluetooth.cpp" />
@@ -1082,6 +1083,7 @@
<ClInclude Include="..\..\xbmc\interfaces\python\PyContext.h" />
<ClInclude Include="..\..\xbmc\interfaces\python\pythreadstate.h" />
<ClInclude Include="..\..\xbmc\music\karaoke\karaokevideobackground.h" />
+ <ClInclude Include="..\..\xbmc\peripherals\bus\virtual\PeripheralBusCEC.h" />
<ClInclude Include="..\..\xbmc\video\FFmpegVideoDecoder.h" />
<ClInclude Include="..\..\xbmc\interfaces\python\swig.h" />
<ClInclude Include="..\..\xbmc\interfaces\python\XBPython.h" />
@@ -2957,6 +2957,9 @@
<ClCompile Include="..\..\xbmc\interfaces\python\PyContext.cpp">
<Filter>interfaces\python</Filter>
</ClCompile>
+ <ClCompile Include="..\..\xbmc\peripherals\bus\virtual\PeripheralBusCEC.cpp">
+ <Filter>peripherals\bus</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\xbmc\win32\pch.h">
@@ -5773,6 +5776,9 @@
<ClInclude Include="..\..\xbmc\interfaces\python\PyContext.h">
<Filter>interfaces\python</Filter>
</ClInclude>
+ <ClInclude Include="..\..\xbmc\peripherals\bus\virtual\PeripheralBusCEC.h">
+ <Filter>peripherals\bus</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\xbmc\win32\XBMC_PC.rc">
View
@@ -7,30 +7,7 @@
<setting key="flip_remote" value="Dialog.Close(virtualkeyboard)" label="36003" order="4" />
</peripheral>
- <peripheral vendor_product="2708:1001" bus="rpi" name="Raspberry Pi CEC Adapter" mapTo="cec">
- <setting key="enabled" type="bool" value="1" label="305" order="1" />
- <setting key="activate_source" type="bool" value="1" label="36020" order="2" />
- <setting key="wake_devices" type="enum" value="36037" label="36007" lvalues="36037|36038|36039|231" order="3" />
- <setting key="standby_devices" type="enum" value="36037" label="36008" lvalues="36037|36038|36039|231" order="4" />
- <setting key="send_inactive_source" type="bool" value="1" label="36025" order="5" />
- <setting key="cec_standby_screensaver" type="bool" value="0" label="36009" order="7" />
- <setting key="standby_pc_on_tv_standby" type="enum" value="13011" label="36029" order="7" lvalues="36028|13005|13011" />
- <setting key="standby_tv_on_pc_standby" type="bool" value="1" label="36026" order="8" />
- <setting key="use_tv_menu_language" type="bool" value="1" label="36018" order="9" />
- <setting key="physical_address" type="string" label="36021" value="0" order="10" />
-
- <setting key="tv_vendor" type="int" value="0" configurable="0" />
- <setting key="device_name" type="string" value="XBMC" configurable="0" />
- <setting key="device_type" type="int" value="1" configurable="0" />
- <setting key="cec_hdmi_port" type="int" value="1" label="36015" configurable="0" />
- <setting key="connected_device" type="int" label="36019" value="0" configurable="0" />
- <setting key="port" type="string" value="" label="36022" configurable="0" />
- <setting key="wake_devices_advanced" type="string" value="" configurable="0" />
- <setting key="standby_devices_advanced" type="string" value="" configurable="0" />
- <setting key="double_tap_timeout_ms" type="int" min="0" value="2000" configurable="0" />
- </peripheral>
-
- <peripheral vendor_product="2548:1001,2548:1002" bus="usb" name="Pulse-Eight CEC Adapter" mapTo="cec">
+ <peripheral bus="cec" name="CEC Adapter" mapTo="cec">
<setting key="enabled" type="bool" value="1" label="305" order="1" />
<setting key="activate_source" type="bool" value="1" label="36020" order="2" />
<setting key="wake_devices" type="enum" value="36037" label="36007" lvalues="36037|36038|36039|231" order="3" />
@@ -54,6 +31,12 @@
<setting key="double_tap_timeout_ms" type="int" min="0" value="2000" configurable="0" />
</peripheral>
+ <peripheral vendor_product="2548:1001,2548:1002" bus="usb" name="Pulse-Eight CEC Adapter" mapTo="cec">
+ <!-- This entry will not create a CPeripheralCecAdapter instance, since it's filtered out in CPeripherals::CreatePeripheral,
+ but it will ensure that a warning is displayed when an adapter is inserted, but libCEC is not present or couldn't be loaded.
+ Since libCEC is now used to scan for devices, the warning will not be displayed without this mapping -->
+ </peripheral>
+
<peripheral vendor_product="15C2:32,15C2:33,15C2:34,15C2:35,15C2:36,15C2:37,15C2:38,15C2:39,15C2:3A,15C2:3B,15C2:3C,15C2:3D,15C2:3E,15C2:3F,15C2:41,15C2:42,15C2:43,15C2:44,15C2:45,15C2:46" bus="usb" name="iMON HID device" mapTo="imon">
<setting key="do_not_use_custom_keymap" type="bool" value="1" label="35009" configurable="0"/>
<setting key="disable_winjoystick" type="bool" value="1" label="35102" order="1" />
@@ -3,15 +3,15 @@ DEPS= ../Makefile.include Makefile
# lib name, version
LIBNAME=libcec
-VERSION=2.0.5-3
+VERSION=2.1.1
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
# configuration settings
CONFIGURE=./configure --prefix=$(PREFIX) --host=$(HOST) \
ac_cv_search_dlopen=yes
-LIBDYLIB=$(PLATFORM)/src/lib/.libs/libcec.so.2.0.0
+LIBDYLIB=$(PLATFORM)/src/lib/.libs/libcec.so.2.0.1
all: .installed-$(PLATFORM)
@@ -30,7 +30,7 @@ $(LIBDYLIB): $(PLATFORM)
.installed-$(PLATFORM): $(LIBDYLIB)
$(MAKE) -C $(PLATFORM)/src/lib install
rm -f $(PREFIX)/lib/libcec.la $(PREFIX)/lib/libcec.so $(PREFIX)/lib/libcec.so.2
- mv -f $(PREFIX)/lib/libcec.so.2.0.0 $(PREFIX)/lib/libcec.so
+ mv -f $(PREFIX)/lib/libcec.so.2.0.1 $(PREFIX)/lib/libcec.so
$(RPL) -e "libcec.so.2" "libcec.so\x00\x00" $(PREFIX)/lib/libcec.so
-$(READELF) --dynamic $(PREFIX)/lib/libcec.so | grep ibrary
touch $@
@@ -3,7 +3,7 @@ include ../config.site.mk
# lib name, version
LIBNAME=libcec
-VERSION=2.0.5-3
+VERSION=2.1.1
SOURCE=$(LIBNAME)-$(VERSION)
ARCHIVE=$(SOURCE).tar.gz
@@ -35,7 +35,8 @@ namespace PERIPHERALS
PERIPHERAL_BUS_UNKNOWN = 0,
PERIPHERAL_BUS_USB,
PERIPHERAL_BUS_PCI,
- PERIPHERAL_BUS_RPI
+ PERIPHERAL_BUS_RPI,
+ PERIPHERAL_BUS_CEC
};
enum PeripheralFeature
@@ -143,6 +144,8 @@ namespace PERIPHERALS
return "pci";
case PERIPHERAL_BUS_RPI:
return "rpi";
+ case PERIPHERAL_BUS_CEC:
+ return "cec";
default:
return "unknown";
}
@@ -159,6 +162,8 @@ namespace PERIPHERALS
return PERIPHERAL_BUS_PCI;
else if (strTypeLowerCase.Equals("rpi"))
return PERIPHERAL_BUS_RPI;
+ else if (strTypeLowerCase.Equals("cec"))
+ return PERIPHERAL_BUS_CEC;
return PERIPHERAL_BUS_UNKNOWN;
};
@@ -180,4 +185,73 @@ namespace PERIPHERALS
strHexString.Format("%04X", iVal);
};
};
+
+ class PeripheralScanResult
+ {
+ public:
+ PeripheralScanResult(const PeripheralBusType busType) :
+ m_type(PERIPHERAL_UNKNOWN),
+ m_iVendorId(0),
+ m_iProductId(0),
+ m_mappedType(PERIPHERAL_UNKNOWN),
+ m_busType(busType),
+ m_mappedBusType(busType),
+ m_iSequence(0) {}
+
+ PeripheralScanResult(void) :
+ m_type(PERIPHERAL_UNKNOWN),
+ m_iVendorId(0),
+ m_iProductId(0),
+ m_mappedType(PERIPHERAL_UNKNOWN),
+ m_busType(PERIPHERAL_BUS_UNKNOWN),
+ m_mappedBusType(PERIPHERAL_BUS_UNKNOWN),
+ m_iSequence(0) {}
+
+ bool operator ==(const PeripheralScanResult& right) const
+ {
+ return m_iVendorId == right.m_iVendorId &&
+ m_iProductId == right.m_iProductId &&
+ m_type == right.m_type &&
+ m_busType == right.m_busType &&
+ m_strLocation.Equals(right.m_strLocation);
+ }
+
+ bool operator !=(const PeripheralScanResult& right) const
+ {
+ return !(*this == right);
+ }
+
+ PeripheralType m_type;
+ CStdString m_strLocation;
+ int m_iVendorId;
+ int m_iProductId;
+ PeripheralType m_mappedType;
+ CStdString m_strDeviceName;
+ PeripheralBusType m_busType;
+ PeripheralBusType m_mappedBusType;
+ unsigned int m_iSequence; // when more than one adapter of the same type is found
+ };
+
+ struct PeripheralScanResults
+ {
+ bool GetDeviceOnLocation(const CStdString& strLocation, PeripheralScanResult* result) const
+ {
+ for (std::vector<PeripheralScanResult>::const_iterator it = m_results.begin(); it != m_results.end(); it++)
+ {
+ if ((*it).m_strLocation == strLocation)
+ {
+ *result = *it;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool ContainsResult(const PeripheralScanResult& result) const
+ {
+ return std::find(m_results.begin(), m_results.end(), result) != m_results.end();
+ }
+
+ std::vector<PeripheralScanResult> m_results;
+ };
}
Oops, something went wrong.

0 comments on commit a211440

Please sign in to comment.