63 lines
2.4 KiB
C++
63 lines
2.4 KiB
C++
/*
|
|
* Copyright (c) 2014 Amlogic, Inc. All rights reserved.
|
|
*
|
|
* This source code is subject to the terms and conditions defined in the
|
|
* file 'LICENSE' which is part of this source code package.
|
|
*
|
|
* Description: header file
|
|
*/
|
|
|
|
#ifndef _TV_UTILS_H_
|
|
#define _TV_UTILS_H_
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <string>
|
|
#include <map>
|
|
#include <pthread.h>
|
|
|
|
#ifndef DVB_SUCCESS
|
|
#define DVB_SUCCESS (0)
|
|
#endif
|
|
|
|
#ifndef DVB_FAILURE
|
|
#define DVB_FAILURE (-1)
|
|
#endif
|
|
|
|
#define SYS_STR_LEN 1024
|
|
#define PROPERTY_VALUE_MAX 92
|
|
#define SYS_VIDEO_INUSE_PATH "/sys/class/video/video_inuse"
|
|
#define AUDIO_STD_PATH "/sys/kernel/debug/aml_atvdemod/aud_std"
|
|
#define AUDIO_OUTMODE_PATH "/sys/kernel/debug/aml_atvdemod/aud_mode"
|
|
#define ATVDEMODE_DEBUG_PATH "/sys/class/aml_atvdemod/atvdemod_debug"
|
|
#define AUDIO_STREAM_OUTMODE_PATH "/sys/kernel/debug/aml_atvdemod/signal_audmode"
|
|
|
|
static pthread_mutex_t ukey_write_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
#define CC_ONE_SECTION_SIZE (0x1000)
|
|
#define CS_KEY_DATA_LIST_DEV_PATH "/sys/class/unifykeys/list"
|
|
#define CS_KEY_DATA_NAME_DEV_PATH "/sys/class/unifykeys/name"
|
|
#define CS_PANEL_INI_SPI_INFO_NAME "lcd_tcon_spi"
|
|
|
|
#define DI_RPOC_ENABLE_PATH "/sys/class/di_process/di_proc_enable"
|
|
|
|
int readUKeyData(const char *key_name, unsigned char data_buf[], int rd_size);
|
|
int writeUKeyData(const char *key_name, unsigned char data_buf[], int wr_size);
|
|
|
|
int tvReadSysfs(const char *path, char *value);
|
|
int tvWriteSysfs(const char *path, const char *value);
|
|
int tvWriteSysfs(const char *path, int value, int base=10);
|
|
extern bool isFileExist(const char *file_name);
|
|
extern int readSysfs(const char *path, char *value);
|
|
extern void writeSysfs(const char *path, const char *value);
|
|
extern int GetFileAttrIntValue(const char *fp, int flag = O_RDWR);
|
|
int ReadDataFromFile(char *fileName, int offset, int nsize, char *dataBuf);
|
|
int SaveDataToFile(char *fileName, int offset, int nsize, char *dataBuf);
|
|
int GetFileSize(char *fileName);
|
|
void UenvInit(void);
|
|
const char* GetUenv(const char *key);
|
|
int SetUenv (const char *name, const char *value);
|
|
bool hasFileWithSubstring(const std::string& directory, const std::string& substring);
|
|
bool isDiBackend();
|
|
#endif //_TV_UTILS_H_
|