mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
hdmi cec optimize timings
Origin commit data
------------------
Branch: master
Commit: bf970ab3a7
Author: TangoCash <eric@loxat.de>
Date: 2020-06-13 (Sat, 13 Jun 2020)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -43,8 +43,6 @@
|
|||||||
#define GREEN "\x1B[32m"
|
#define GREEN "\x1B[32m"
|
||||||
#define NORMAL "\x1B[0m"
|
#define NORMAL "\x1B[0m"
|
||||||
|
|
||||||
#define WAITTIME 20
|
|
||||||
|
|
||||||
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, this, args)
|
#define hal_debug(args...) _hal_debug(HAL_DEBUG_INIT, this, args)
|
||||||
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, this, args)
|
#define hal_info(args...) _hal_info(HAL_DEBUG_INIT, this, args)
|
||||||
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
|
#define hal_debug_c(args...) _hal_debug(HAL_DEBUG_INIT, NULL, args)
|
||||||
@@ -139,7 +137,9 @@ bool hdmi_cec::SetCECMode(VIDEO_HDMI_CEC_MODE _deviceType)
|
|||||||
if (hdmiFd >= 0)
|
if (hdmiFd >= 0)
|
||||||
{
|
{
|
||||||
fallback = true;
|
fallback = true;
|
||||||
|
#if BOXMODEL_VUPLUS_ALL
|
||||||
hal_info(RED"[CEC] fallback on %s\n"NORMAL, __func__);
|
hal_info(RED"[CEC] fallback on %s\n"NORMAL, __func__);
|
||||||
|
#endif
|
||||||
|
|
||||||
__u32 monitor = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER;
|
__u32 monitor = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER;
|
||||||
struct cec_caps caps = {};
|
struct cec_caps caps = {};
|
||||||
@@ -302,7 +302,7 @@ void hdmi_cec::ReportPhysicalAddress()
|
|||||||
SendCECMessage(txmessage);
|
SendCECMessage(txmessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hdmi_cec::SendCECMessage(struct cec_message &txmessage)
|
void hdmi_cec::SendCECMessage(struct cec_message &txmessage, int sleeptime)
|
||||||
{
|
{
|
||||||
if (hdmiFd >= 0)
|
if (hdmiFd >= 0)
|
||||||
{
|
{
|
||||||
@@ -331,7 +331,7 @@ void hdmi_cec::SendCECMessage(struct cec_message &txmessage)
|
|||||||
::write(hdmiFd, &message, 2 + message.length);
|
::write(hdmiFd, &message, 2 + message.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
usleep(WAITTIME*10000);
|
usleep(sleeptime * 10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -652,7 +652,7 @@ void hdmi_cec::Receive(int what)
|
|||||||
|
|
||||||
switch (rxmessage.opcode)
|
switch (rxmessage.opcode)
|
||||||
{
|
{
|
||||||
case CEC_OPCODE_ACTIVE_SOURCE:
|
//case CEC_OPCODE_ACTIVE_SOURCE:
|
||||||
case CEC_OPCODE_REQUEST_ACTIVE_SOURCE:
|
case CEC_OPCODE_REQUEST_ACTIVE_SOURCE:
|
||||||
{
|
{
|
||||||
txmessage.destination = CEC_LOG_ADDR_BROADCAST; //rxmessage.initiator;
|
txmessage.destination = CEC_LOG_ADDR_BROADCAST; //rxmessage.initiator;
|
||||||
@@ -790,13 +790,13 @@ void hdmi_cec::send_key(unsigned char key, unsigned char destination)
|
|||||||
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_PRESSED;
|
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_PRESSED;
|
||||||
txmessage.data[1] = key;
|
txmessage.data[1] = key;
|
||||||
txmessage.length = 2;
|
txmessage.length = 2;
|
||||||
SendCECMessage(txmessage);
|
SendCECMessage(txmessage, 1);
|
||||||
|
|
||||||
txmessage.destination = destination;
|
txmessage.destination = destination;
|
||||||
txmessage.initiator = logicalAddress;
|
txmessage.initiator = logicalAddress;
|
||||||
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_RELEASE;
|
txmessage.data[0] = CEC_OPCODE_USER_CONTROL_RELEASE;
|
||||||
txmessage.length = 1;
|
txmessage.length = 1;
|
||||||
SendCECMessage(txmessage);
|
SendCECMessage(txmessage, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hdmi_cec::request_audio_status()
|
void hdmi_cec::request_audio_status()
|
||||||
@@ -806,7 +806,7 @@ void hdmi_cec::request_audio_status()
|
|||||||
txmessage.initiator = logicalAddress;
|
txmessage.initiator = logicalAddress;
|
||||||
txmessage.data[0] = CEC_OPCODE_GIVE_AUDIO_STATUS;
|
txmessage.data[0] = CEC_OPCODE_GIVE_AUDIO_STATUS;
|
||||||
txmessage.length = 1;
|
txmessage.length = 1;
|
||||||
SendCECMessage(txmessage);
|
SendCECMessage(txmessage, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hdmi_cec::vol_up()
|
void hdmi_cec::vol_up()
|
||||||
|
@@ -88,7 +88,7 @@ public:
|
|||||||
void SetCECAutoView(bool);
|
void SetCECAutoView(bool);
|
||||||
void SetCECAutoStandby(bool);
|
void SetCECAutoStandby(bool);
|
||||||
void GetCECAddressInfo();
|
void GetCECAddressInfo();
|
||||||
void SendCECMessage(struct cec_message &message);
|
void SendCECMessage(struct cec_message &message, int sleeptime = 10);
|
||||||
void SetCECState(bool state);
|
void SetCECState(bool state);
|
||||||
void ReportPhysicalAddress();
|
void ReportPhysicalAddress();
|
||||||
bool standby_cec_activ;
|
bool standby_cec_activ;
|
||||||
|
Reference in New Issue
Block a user