mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 15:02:58 +02:00
libarmbox: move hdmi_cec to own class, add basic cec-remote support
cec-remote will print received commands in log for now Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
66
libarmbox/hdmi_cec.h
Normal file
66
libarmbox/hdmi_cec.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
Copyright (C) 2018 TangoCash
|
||||
|
||||
License: GPLv2
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation;
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include <OpenThreads/Thread>
|
||||
#include <OpenThreads/Condition>
|
||||
|
||||
#include "video_lib.h"
|
||||
|
||||
struct cec_message
|
||||
{
|
||||
unsigned char address;
|
||||
unsigned char length;
|
||||
unsigned char data[256];
|
||||
} __attribute__((packed));
|
||||
|
||||
struct addressinfo
|
||||
{
|
||||
unsigned char logical;
|
||||
unsigned char physical[2];
|
||||
unsigned char type;
|
||||
};
|
||||
|
||||
class hdmi_cec : public OpenThreads::Thread
|
||||
{
|
||||
private:
|
||||
hdmi_cec();
|
||||
static hdmi_cec *hdmi_cec_instance;
|
||||
void run();
|
||||
bool Start();
|
||||
bool Stop();
|
||||
void Receive();
|
||||
unsigned char physicalAddress[2];
|
||||
bool autoview_cec_activ;
|
||||
unsigned char deviceType, logicalAddress;
|
||||
int hdmiFd;
|
||||
long translateKey(unsigned char code);
|
||||
protected:
|
||||
bool running;
|
||||
public:
|
||||
~hdmi_cec();
|
||||
static hdmi_cec* getInstance();
|
||||
bool SetCECMode(VIDEO_HDMI_CEC_MODE);
|
||||
void SetCECAutoView(bool);
|
||||
void SetCECAutoStandby(bool);
|
||||
void GetCECAddressInfo();
|
||||
void SendCECMessage(struct cec_message &message);
|
||||
void SetCECState(bool state);
|
||||
void ReportPhysicalAddress();
|
||||
bool standby_cec_activ;
|
||||
};
|
Reference in New Issue
Block a user