cec: allow to override the TV vendor id via the initial configuration
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 14 Feb 2012 01:09:49 +0000 (02:09 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 14 Feb 2012 01:09:49 +0000 (02:09 +0100)
include/cectypes.h
src/lib/CECProcessor.cpp

index 1cdb3ea8c619c23cbe72f171c7211dc631cff6d9..0a0270f23f43a6b8869a42cd2701e486ef5f2eae 100644 (file)
@@ -923,6 +923,7 @@ typedef struct libcec_configuration
   uint16_t             iPhysicalAddress;     /*!< the physical address of the CEC adapter */
   cec_logical_address  baseDevice;           /*!< the logical address of the device to which the adapter is connected. only used when iPhysicalAddress = 0 */
   uint8_t              iHDMIPort;            /*!< the HDMI port to which the adapter is connected. only used when iPhysicalAddress = 0 */
+  cec_vendor_id        tvVendor;             /*!< the vendor ID of the TV. leave this untouched to autodetect */
   cec_client_version   clientVersion;        /*!< the version of the client that is connecting */
 
   // player specific settings
@@ -944,6 +945,7 @@ typedef struct libcec_configuration
     iPhysicalAddress = 0;
     baseDevice       = (cec_logical_address)CEC_DEFAULT_BASE_DEVICE;
     iHDMIPort        = CEC_DEFAULT_HDMI_PORT;
+    tvVendor         = CEC_VENDOR_UNKNOWN;
     clientVersion    = CEC_CLIENT_VERSION_PRE_1_5;
 
     bGetSettingsFromROM  = 0;
index ebd17729f4e0355f3ad77ab8f2a30a3a85f70188..f4e485ac3b6da0a7e3c01462780c037fc744c290 100644 (file)
@@ -64,6 +64,11 @@ CCECProcessor::CCECProcessor(CLibCEC *controller, const libcec_configuration *co
 {
   m_logicalAddresses.Clear();
   CreateBusDevices();
+  if (configuration->tvVendor != CEC_VENDOR_UNKNOWN)
+  {
+    m_busDevices[CECDEVICE_TV]->SetVendorId((uint64_t)configuration->tvVendor);
+    m_busDevices[CECDEVICE_TV]->ReplaceHandler(false);
+  }
 }
 
 CCECProcessor::CCECProcessor(CLibCEC *controller, const char *strDeviceName, const cec_device_type_list &types, uint16_t iPhysicalAddress, cec_client_version clientVersion) :