summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--tv_callback.h7
-rw-r--r--tv_input.cpp96
-rw-r--r--tvapi/android/include/ITv.h34
-rw-r--r--tvapi/android/include/ITvClient.h12
-rw-r--r--tvapi/android/include/ITvService.h18
-rw-r--r--tvapi/android/include/TvClient.h5
-rw-r--r--tvapi/android/include/tvcmd.h1180
-rw-r--r--tvapi/android/jni/cfbc_jni.cpp214
-rw-r--r--tvapi/android/jni/cfbc_test.cpp64
-rw-r--r--tvapi/android/jni/com_droidlogic_app_tv_TvControlManager.cpp666
-rw-r--r--tvapi/android/libtvbinder/ITv.cpp246
-rw-r--r--tvapi/android/libtvbinder/ITvClient.cpp78
-rw-r--r--tvapi/android/libtvbinder/ITvService.cpp56
-rw-r--r--tvapi/android/libtvbinder/TvClient.cpp54
-rw-r--r--tvapi/android/tv/TvPlay.cpp36
-rw-r--r--tvapi/android/tv/TvPlay.h2
-rw-r--r--tvapi/android/tvserver/TvService.cpp8700
-rw-r--r--tvapi/android/tvserver/TvService.h107
-rw-r--r--tvapi/android/tvserver/main.cpp12
-rw-r--r--tvapi/android/tvserver/tv_callback.h25
-rw-r--r--tvapi/libtv/audio/CAudioCustomerCtrl.cpp170
-rw-r--r--tvapi/libtv/audio/CAudioCustomerCtrl.h32
-rw-r--r--tvapi/libtv/audio/CTvAudio.h52
-rw-r--r--tvapi/libtv/audio/audio_alsa.cpp1004
-rw-r--r--tvapi/libtv/audio/audio_alsa.h164
-rw-r--r--tvapi/libtv/audio/audio_effect.cpp82
-rw-r--r--tvapi/libtv/audio/audio_effect.h34
-rw-r--r--tvapi/libtv/include/amstream.h142
-rw-r--r--tvapi/libtv/include/cm.h188
-rw-r--r--tvapi/libtv/include/hdmirx_cec.h492
-rw-r--r--tvapi/libtv/include/ve.h342
-rw-r--r--tvapi/libtv/tv/AutoBackLight.cpp280
-rw-r--r--tvapi/libtv/tv/AutoBackLight.h44
-rw-r--r--tvapi/libtv/tv/CAutoPQparam.cpp172
-rw-r--r--tvapi/libtv/tv/CAutoPQparam.h26
-rw-r--r--tvapi/libtv/tv/CAv.cpp612
-rw-r--r--tvapi/libtv/tv/CAv.h188
-rw-r--r--tvapi/libtv/tv/CFbcCommunication.cpp2670
-rw-r--r--tvapi/libtv/tv/CFbcCommunication.h716
-rw-r--r--tvapi/libtv/tv/CFrontEnd.cpp964
-rw-r--r--tvapi/libtv/tv/CFrontEnd.h236
-rw-r--r--tvapi/libtv/tv/CTv.cpp2174
-rw-r--r--tvapi/libtv/tv/CTv.h1470
-rw-r--r--tvapi/libtv/tv/CTvBooking.cpp170
-rw-r--r--tvapi/libtv/tv/CTvBooking.h94
-rw-r--r--tvapi/libtv/tv/CTvDmx.cpp8
-rw-r--r--tvapi/libtv/tv/CTvDmx.h12
-rw-r--r--tvapi/libtv/tv/CTvEpg.cpp258
-rw-r--r--tvapi/libtv/tv/CTvEpg.h276
-rw-r--r--tvapi/libtv/tv/CTvEv.cpp2
-rw-r--r--tvapi/libtv/tv/CTvEv.h322
-rw-r--r--tvapi/libtv/tv/CTvRecord.cpp368
-rw-r--r--tvapi/libtv/tv/CTvRecord.h70
-rw-r--r--tvapi/libtv/tv/CTvScanner.cpp1934
-rw-r--r--tvapi/libtv/tv/CTvScanner.h418
-rw-r--r--tvapi/libtv/tv/CTvScreenCapture.cpp1228
-rw-r--r--tvapi/libtv/tv/CTvScreenCapture.h142
-rw-r--r--tvapi/libtv/tv/CTvSubtitle.cpp708
-rw-r--r--tvapi/libtv/tv/CTvSubtitle.h430
-rw-r--r--tvapi/libtv/tv/CTvTime.h134
-rw-r--r--tvapi/libtv/tv/CTvVchipCheck.cpp250
-rw-r--r--tvapi/libtv/tv/CTvVchipCheck.h40
-rw-r--r--tvapi/libtv/tv/CUpgradeFBC.cpp974
-rw-r--r--tvapi/libtv/tv/CUpgradeFBC.h104
-rw-r--r--tvapi/libtv/tv/ScreenCatch.cpp638
-rw-r--r--tvapi/libtv/tvconfig/CIniFile.cpp558
-rw-r--r--tvapi/libtv/tvconfig/CIniFile.h76
-rw-r--r--tvapi/libtv/tvconfig/tvconfig.cpp28
-rw-r--r--tvapi/libtv/tvdb/CTvChannel.cpp408
-rw-r--r--tvapi/libtv/tvdb/CTvChannel.h478
-rw-r--r--tvapi/libtv/tvdb/CTvDatabase.cpp302
-rw-r--r--tvapi/libtv/tvdb/CTvDatabase.h112
-rw-r--r--tvapi/libtv/tvdb/CTvDimension.cpp714
-rw-r--r--tvapi/libtv/tvdb/CTvDimension.h134
-rw-r--r--tvapi/libtv/tvdb/CTvEvent.cpp322
-rw-r--r--tvapi/libtv/tvdb/CTvEvent.h112
-rw-r--r--tvapi/libtv/tvdb/CTvGroup.cpp4
-rw-r--r--tvapi/libtv/tvdb/CTvGroup.h14
-rw-r--r--tvapi/libtv/tvdb/CTvProgram.cpp1322
-rw-r--r--tvapi/libtv/tvdb/CTvProgram.h988
-rw-r--r--tvapi/libtv/tvdb/CTvRegion.cpp228
-rw-r--r--tvapi/libtv/tvdb/CTvRegion.h30
-rw-r--r--tvapi/libtv/tvin/CHDMIRxCEC.cpp830
-rw-r--r--tvapi/libtv/tvin/CSourceConnectDetect.cpp438
-rw-r--r--tvapi/libtv/tvin/CSourceConnectDetect.h76
-rw-r--r--tvapi/libtv/tvin/CTvin.cpp4452
-rw-r--r--tvapi/libtv/tvin/CTvin.h2116
-rw-r--r--tvapi/libtv/tvsetting/CBlobDevice.cpp6
-rw-r--r--tvapi/libtv/tvsetting/CBlobDevice.h72
-rw-r--r--tvapi/libtv/tvsetting/CBlobDeviceE2prom.cpp12
-rw-r--r--tvapi/libtv/tvsetting/CBlobDeviceE2prom.h48
-rw-r--r--tvapi/libtv/tvsetting/CBlobDeviceFile.cpp66
-rw-r--r--tvapi/libtv/tvsetting/CBlobDeviceFile.h20
-rw-r--r--tvapi/libtv/tvsetting/CBlobDeviceRam.cpp146
-rw-r--r--tvapi/libtv/tvsetting/CBlobDeviceRam.h40
-rw-r--r--tvapi/libtv/tvsetting/CTvSetting.cpp2168
-rw-r--r--tvapi/libtv/tvsetting/CTvSettingDeviceFactory.cpp38
-rw-r--r--tvapi/libtv/tvsetting/CTvSettingDeviceFactory.h8
-rw-r--r--tvapi/libtv/tvsetting/TvKeyData.cpp1792
-rw-r--r--tvapi/libtv/tvsetting/audio_cfg.cpp958
-rw-r--r--tvapi/libtv/tvutils/CCondition.h84
-rw-r--r--tvapi/libtv/tvutils/CFile.cpp261
-rw-r--r--tvapi/libtv/tvutils/CFile.h50
-rw-r--r--tvapi/libtv/tvutils/CHdmiCecCmd.cpp6
-rw-r--r--tvapi/libtv/tvutils/CHdmiCecCmd.h6
-rw-r--r--tvapi/libtv/tvutils/CMsgQueue.cpp146
-rw-r--r--tvapi/libtv/tvutils/CMsgQueue.h40
-rw-r--r--tvapi/libtv/tvutils/CMutex.h112
-rw-r--r--tvapi/libtv/tvutils/CSerialCommunication.cpp118
-rw-r--r--tvapi/libtv/tvutils/CSerialCommunication.h60
-rw-r--r--tvapi/libtv/tvutils/CSerialPort.cpp568
-rw-r--r--tvapi/libtv/tvutils/CSerialPort.h42
-rw-r--r--tvapi/libtv/tvutils/CSqlite.cpp126
-rw-r--r--tvapi/libtv/tvutils/CSqlite.h288
-rw-r--r--tvapi/libtv/tvutils/CThread.cpp212
-rw-r--r--tvapi/libtv/tvutils/CThread.h76
-rw-r--r--tvapi/libtv/tvutils/CTvInput.cpp204
-rw-r--r--tvapi/libtv/tvutils/CTvInput.h46
-rw-r--r--tvapi/libtv/tvutils/serial_base.cpp560
-rw-r--r--tvapi/libtv/tvutils/serial_operate.cpp336
-rw-r--r--tvapi/libtv/tvutils/serial_operate.h42
-rw-r--r--tvapi/libtv/tvutils/tvutils.cpp2813
-rw-r--r--tvapi/libtv/tvutils/tvutils.h44
-rw-r--r--tvapi/libtv/tvutils/zepoll.cpp66
-rw-r--r--tvapi/libtv/tvutils/zepoll.h54
-rw-r--r--tvapi/libtv/version/version.cpp50
-rw-r--r--tvapi/libtv/vpp/CPQdb.cpp618
-rw-r--r--tvapi/libtv/vpp/CPQdb.h232
-rw-r--r--tvapi/libtv/vpp/CVpp.cpp724
-rw-r--r--tvapi/libtv/vpp/CVpp.h676
-rw-r--r--tvapi/libtv/vpp/pqdata.cpp216
-rw-r--r--tvapi/tvtests/comm_test.cpp42
-rw-r--r--tvapi/tvtests/ssm_test.cpp320
-rw-r--r--tvapi/tvtests/tvconfig_test.cpp560
134 files changed, 31073 insertions, 30287 deletions
diff --git a/tvapi/tvtests/tvconfig_test.cpp b/tvapi/tvtests/tvconfig_test.cpp
index 5bfe97f..ea90dd7 100644
--- a/tvapi/tvtests/tvconfig_test.cpp
+++ b/tvapi/tvtests/tvconfig_test.cpp
@@ -24,334 +24,334 @@ static int GetAudioAVOutMuteGPIOCFG(char gpio_grp_str[], int *mute_gpio_addr, in
static int GetWriteProtectGPIOCFG(char gpio_grp_str[], int *protect_gpio_addr, int *protect_on_val, int *protect_off_val);
typedef struct tagTvServerInfo {
- int power_on_off_channel;
- int last_source_select;
- int system_language;
+ int power_on_off_channel;
+ int last_source_select;
+ int system_language;
} TvServerInfo;
int main(int argc, char **argv)
{
- int i, j;
- char key_buf[CC_CFG_KEY_STR_MAX_LEN];
- char cfg_buf[CC_CFG_VALUE_STR_MAX_LEN];
+ int i, j;
+ char key_buf[CC_CFG_KEY_STR_MAX_LEN];
+ char cfg_buf[CC_CFG_VALUE_STR_MAX_LEN];
- config_set_log_level (CC_LOG_LEVEL_ALL);
+ config_set_log_level (CC_LOG_LEVEL_ALL);
- config_init((char *) "tvconfig.conf");
+ config_init((char *) "tvconfig.conf");
- strcpy(key_buf, "media.amplayer.enable-acodecs");
- config_get(key_buf, cfg_buf, (char *) "");
- LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
+ strcpy(key_buf, "media.amplayer.enable-acodecs");
+ config_get(key_buf, cfg_buf, (char *) "");
+ LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
- strcpy(key_buf, "media.amplayer.enable-acodecs");
- strcpy(cfg_buf, "shorthoho");
- config_set(key_buf, cfg_buf);
+ strcpy(key_buf, "media.amplayer.enable-acodecs");
+ strcpy(cfg_buf, "shorthoho");
+ config_set(key_buf, cfg_buf);
- strcpy(key_buf, "media.amplayer.enable-acodecs");
- config_get(key_buf, cfg_buf, (char *) "");
- LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
+ strcpy(key_buf, "media.amplayer.enable-acodecs");
+ config_get(key_buf, cfg_buf, (char *) "");
+ LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
- strcpy(key_buf, "media.amplayer.enable-acodecs");
- config_get(key_buf, cfg_buf, (char *) "");
- LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
+ strcpy(key_buf, "media.amplayer.enable-acodecs");
+ config_get(key_buf, cfg_buf, (char *) "");
+ LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
- strcpy(key_buf, "media.amplayer.enable-acodecs");
- strcpy(cfg_buf, "asf,wav,aac,mp3,m4a,ape,flac,alac,hohoho");
- config_set(key_buf, cfg_buf);
+ strcpy(key_buf, "media.amplayer.enable-acodecs");
+ strcpy(cfg_buf, "asf,wav,aac,mp3,m4a,ape,flac,alac,hohoho");
+ config_set(key_buf, cfg_buf);
- strcpy(key_buf, "media.amplayer.enable-acodecs");
- config_get(key_buf, cfg_buf, (char *) "");
- LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
+ strcpy(key_buf, "media.amplayer.enable-acodecs");
+ config_get(key_buf, cfg_buf, (char *) "");
+ LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
- strcpy(key_buf, "shoufu.zhao.test");
- config_get(key_buf, cfg_buf, (char *) "");
- LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
+ strcpy(key_buf, "shoufu.zhao.test");
+ config_get(key_buf, cfg_buf, (char *) "");
+ LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
- strcpy(key_buf, "shoufu.zhao.test");
- strcpy(cfg_buf, "test hohoho");
- config_set(key_buf, cfg_buf);
+ strcpy(key_buf, "shoufu.zhao.test");
+ strcpy(cfg_buf, "test hohoho");
+ config_set(key_buf, cfg_buf);
- strcpy(key_buf, "shoufu.zhao.test");
- config_get(key_buf, cfg_buf, (char *) "");
- LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
+ strcpy(key_buf, "shoufu.zhao.test");
+ config_get(key_buf, cfg_buf, (char *) "");
+ LOGD("file(%s)'s function(%s), key string \"%s\", value string \"%s\".\n", __FILE__, "TV", key_buf, cfg_buf);
- int biquad_count = 0, biquad_item_count = 0;
- int biquad_data_buf00[128] = { 0 };
- int biquad_data_buf01[128] = { 0 };
+ int biquad_count = 0, biquad_item_count = 0;
+ int biquad_data_buf00[128] = { 0 };
+ int biquad_data_buf01[128] = { 0 };
- GetAudioAmplifierBiquadsDataBuffer00(&biquad_count, &biquad_item_count, biquad_data_buf00);
- for (i = 0; i < biquad_count; i++) {
- for (j = 0; j < biquad_item_count; j++) {
- LOGD("0x%x\n", biquad_data_buf00[i * biquad_item_count + j]);
- }
+ GetAudioAmplifierBiquadsDataBuffer00(&biquad_count, &biquad_item_count, biquad_data_buf00);
+ for (i = 0; i < biquad_count; i++) {
+ for (j = 0; j < biquad_item_count; j++) {
+ LOGD("0x%x\n", biquad_data_buf00[i * biquad_item_count + j]);
+ }
- LOGD("\n");
- }
+ LOGD("\n");
+ }
- GetAudioAmplifierBiquadsDataBuffer01(&biquad_count, &biquad_item_count, biquad_data_buf01);
- for (i = 0; i < biquad_count; i++) {
- for (j = 0; j < biquad_item_count; j++) {
- LOGD("0x%x\n", biquad_data_buf01[i * biquad_item_count + j]);
- }
+ GetAudioAmplifierBiquadsDataBuffer01(&biquad_count, &biquad_item_count, biquad_data_buf01);
+ for (i = 0; i < biquad_count; i++) {
+ for (j = 0; j < biquad_item_count; j++) {
+ LOGD("0x%x\n", biquad_data_buf01[i * biquad_item_count + j]);
+ }
- LOGD("\n");
- }
+ LOGD("\n");
+ }
- char tv_card_id_buf[64] = { 0 };
- char tv_card_name_buf[64] = { 0 };
+ char tv_card_id_buf[64] = { 0 };
+ char tv_card_name_buf[64] = { 0 };
- GetTvAudioCardID(tv_card_id_buf);
+ GetTvAudioCardID(tv_card_id_buf);
- GetTvAudioCardName(tv_card_name_buf);
+ GetTvAudioCardName(tv_card_name_buf);
- printf("tvservice log cfg value = %d\n", config_log_cfg_get(CC_LOG_MODULE_TVSERVICE));
- printf("vpp log cfg value = %d\n", config_log_cfg_get(CC_LOG_MODULE_VPP));
+ printf("tvservice log cfg value = %d\n", config_log_cfg_get(CC_LOG_MODULE_TVSERVICE));
+ printf("vpp log cfg value = %d\n", config_log_cfg_get(CC_LOG_MODULE_VPP));
- int chan_cnt = 0, item_cnt = 0;
- int chan_data_buf[256] = { 0 };
+ int chan_cnt = 0, item_cnt = 0;
+ int chan_data_buf[256] = { 0 };
- ATVGetFacRestoreChanInfo(&chan_cnt, &item_cnt, chan_data_buf);
+ ATVGetFacRestoreChanInfo(&chan_cnt, &item_cnt, chan_data_buf);
- for (i = 0; i < chan_cnt; i++) {
- for (j = 0; j < item_cnt; j++) {
- LOGD("%d\n", chan_data_buf[i * item_cnt + j]);
- }
+ for (i = 0; i < chan_cnt; i++) {
+ for (j = 0; j < item_cnt; j++) {
+ LOGD("%d\n", chan_data_buf[i * item_cnt + j]);
+ }
- LOGD("\n");
- }
+ LOGD("\n");
+ }
- char gpio_grp_str[32] = { 0 };
- int gpio_addr, gpio_on_val;
+ char gpio_grp_str[32] = { 0 };
+ int gpio_addr, gpio_on_val;
- int cfg_info_item_count = 0;
- GPIOCFGInfo cfg_info_buf[64];
+ int cfg_info_item_count = 0;
+ GPIOCFGInfo cfg_info_buf[64];
- if (cfg_get_one_gpio_data("audio.avout.mute.gpio", gpio_grp_str, &gpio_addr, &gpio_on_val) == 0) {
- cfg_info_item_count = 1;
+ if (cfg_get_one_gpio_data("audio.avout.mute.gpio", gpio_grp_str, &gpio_addr, &gpio_on_val) == 0) {
+ cfg_info_item_count = 1;
- strcpy(cfg_info_buf[0].gpio_grp_str, gpio_grp_str);
- cfg_info_buf[0].gpio_addr = gpio_addr;
- cfg_info_buf[0].gpio_val = gpio_on_val;
+ strcpy(cfg_info_buf[0].gpio_grp_str, gpio_grp_str);
+ cfg_info_buf[0].gpio_addr = gpio_addr;
+ cfg_info_buf[0].gpio_val = gpio_on_val;
- PrintGPIOCfgData(cfg_info_item_count, &cfg_info_buf[0]);
- }
+ PrintGPIOCfgData(cfg_info_item_count, &cfg_info_buf[0]);
+ }
- if (cfg_get_gpio_data("audio.avout.mute.gpio", &cfg_info_item_count, cfg_info_buf) == 0) {
- PrintGPIOCfgData(cfg_info_item_count, cfg_info_buf);
- }
+ if (cfg_get_gpio_data("audio.avout.mute.gpio", &cfg_info_item_count, cfg_info_buf) == 0) {
+ PrintGPIOCfgData(cfg_info_item_count, cfg_info_buf);
+ }
- cfg_info_item_count = 64;
- if (cfg_get_gpio_data("audio.initaudio.gpioctl", &cfg_info_item_count, cfg_info_buf) == 0) {
- PrintGPIOCfgData(cfg_info_item_count, cfg_info_buf);
- }
+ cfg_info_item_count = 64;
+ if (cfg_get_gpio_data("audio.initaudio.gpioctl", &cfg_info_item_count, cfg_info_buf) == 0) {
+ PrintGPIOCfgData(cfg_info_item_count, cfg_info_buf);
+ }
- char tmp_buf[32] = { 0 };
- int mute_gpio_addr, mute_on_gpio_val, mute_off_gpio_val;
+ char tmp_buf[32] = { 0 };
+ int mute_gpio_addr, mute_on_gpio_val, mute_off_gpio_val;
- if (GetAudioAnalogAmplifierMuteGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
- LOGD("%s, mute on write command %s\n", "GetAudioAnalogAmplifierMuteGPIOCFG", tmp_buf);
+ if (GetAudioAnalogAmplifierMuteGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
+ LOGD("%s, mute on write command %s\n", "GetAudioAnalogAmplifierMuteGPIOCFG", tmp_buf);
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
- LOGD("%s, mute off write command %s\n", "GetAudioAnalogAmplifierMuteGPIOCFG", tmp_buf);
- }
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
+ LOGD("%s, mute off write command %s\n", "GetAudioAnalogAmplifierMuteGPIOCFG", tmp_buf);
+ }
- if (GetAudioHeadSetMuteGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
- LOGD("%s, mute on write command %s\n", "GetAudioHeadSetMuteGPIOCFG", tmp_buf);
+ if (GetAudioHeadSetMuteGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
+ LOGD("%s, mute on write command %s\n", "GetAudioHeadSetMuteGPIOCFG", tmp_buf);
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
- LOGD("%s, mute off write command %s\n", "GetAudioHeadSetMuteGPIOCFG", tmp_buf);
- }
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
+ LOGD("%s, mute off write command %s\n", "GetAudioHeadSetMuteGPIOCFG", tmp_buf);
+ }
- if (GetAudioAVOutMuteGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
- LOGD("%s, mute on write command %s\n", "GetAudioAVOutMuteGPIOCFG", tmp_buf);
+ if (GetAudioAVOutMuteGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
+ LOGD("%s, mute on write command %s\n", "GetAudioAVOutMuteGPIOCFG", tmp_buf);
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
- LOGD("%s, mute off write command %s\n", "GetAudioAVOutMuteGPIOCFG", tmp_buf);
- }
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
+ LOGD("%s, mute off write command %s\n", "GetAudioAVOutMuteGPIOCFG", tmp_buf);
+ }
- if (GetWriteProtectGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
- LOGD("%s, protect on write command %s\n", "GetWriteProtectGPIOCFG", tmp_buf);
+ if (GetWriteProtectGPIOCFG(gpio_grp_str, &mute_gpio_addr, &mute_on_gpio_val, &mute_off_gpio_val) == 0) {
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_on_gpio_val);
+ LOGD("%s, protect on write command %s\n", "GetWriteProtectGPIOCFG", tmp_buf);
- sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
- LOGD("%s, protect off write command %s\n", "GetWriteProtectGPIOCFG", tmp_buf);
- }
+ sprintf(tmp_buf, "w %s %d %d", gpio_grp_str, mute_gpio_addr, mute_off_gpio_val);
+ LOGD("%s, protect off write command %s\n", "GetWriteProtectGPIOCFG", tmp_buf);
+ }
- tmpInfo.power_on_off_channel = 0;
- tmpInfo.last_source_select = 0;
- tmpInfo.system_language = 1;
+ tmpInfo.power_on_off_channel = 0;
+ tmpInfo.last_source_select = 0;
+ tmpInfo.system_language = 1;
- for (i = 0; i < 12; i++) {
- tmpInfo.last_source_select = i;
- }
+ for (i = 0; i < 12; i++) {
+ tmpInfo.last_source_select = i;
+ }
- char item_buf[128] = { 0 };
+ char item_buf[128] = { 0 };
- for (i = 0; i < 16; i++) {
- cfg_get_one_item("misc.lastselsrc.show.cfg", i, item_buf);
- LOGD("item %d = %s\n", i, item_buf);
- }
+ for (i = 0; i < 16; i++) {
+ cfg_get_one_item("misc.lastselsrc.show.cfg", i, item_buf);
+ LOGD("item %d = %s\n", i, item_buf);
+ }
- config_uninit();
+ config_uninit();
- LOGD("file(%s)'s function(%s) exiting.\n", __FILE__, "TV");
- return 0;
+ LOGD("file(%s)'s function(%s) exiting.\n", __FILE__, "TV");
+ return 0;
}
static int RealGetAudioAmplifierBiquadsDataBuffer(const char *key_str, int *biquad_count, int *biquad_item_count, int biquad_data_buf[])
{
- int cfg_item_count = 0, tmpTotalItemCount = 0;
- char *token = NULL;
- const char *strDelimit = ",";
- char prop_value[CC_CFG_VALUE_STR_MAX_LEN];
-
- memset(prop_value, '\0', CC_CFG_VALUE_STR_MAX_LEN);
-
- config_get(key_str, prop_value, "null");
- if (strcasecmp(prop_value, "null") == 0) {
- LOGE("%s, can't get config \"%s\"!!!\n", "TV", key_str);
- *biquad_count = 0;
- *biquad_item_count = 0;
- return -1;
- }
-
- tmpTotalItemCount = 0;
-
- token = strtok(prop_value, strDelimit);
- while (token != NULL) {
- if (cfg_item_count == 0) {
- *biquad_count = strtoul(token, NULL, 16);
- } else if (cfg_item_count == 1) {
- *biquad_item_count = strtoul(token, NULL, 16);
- } else if (cfg_item_count >= 2) {
- biquad_data_buf[tmpTotalItemCount] = strtoul(token, NULL, 16);
- tmpTotalItemCount += 1;
- }
-
- token = strtok(NULL, strDelimit);
- cfg_item_count += 1;
- }
-
- if ((*biquad_count) * (*biquad_item_count) != tmpTotalItemCount) {
- LOGE("%s, get item count error!!! should be %d, real is %d.\n", "TV", (*biquad_count) * (*biquad_item_count), tmpTotalItemCount);
- *biquad_count = 0;
- *biquad_item_count = 0;
- return -1;
- }
-
- LOGD("%s, biquad count = %d, biquad item count = %d.\n", "TV", *biquad_count, *biquad_item_count);
-
- return 0;
+ int cfg_item_count = 0, tmpTotalItemCount = 0;
+ char *token = NULL;
+ const char *strDelimit = ",";
+ char prop_value[CC_CFG_VALUE_STR_MAX_LEN];
+
+ memset(prop_value, '\0', CC_CFG_VALUE_STR_MAX_LEN);
+
+ config_get(key_str, prop_value, "null");
+ if (strcasecmp(prop_value, "null") == 0) {
+ LOGE("%s, can't get config \"%s\"!!!\n", "TV", key_str);
+ *biquad_count = 0;
+ *biquad_item_count = 0;
+ return -1;
+ }
+
+ tmpTotalItemCount = 0;
+
+ token = strtok(prop_value, strDelimit);
+ while (token != NULL) {
+ if (cfg_item_count == 0) {
+ *biquad_count = strtoul(token, NULL, 16);
+ } else if (cfg_item_count == 1) {
+ *biquad_item_count = strtoul(token, NULL, 16);
+ } else if (cfg_item_count >= 2) {
+ biquad_data_buf[tmpTotalItemCount] = strtoul(token, NULL, 16);
+ tmpTotalItemCount += 1;
+ }
+
+ token = strtok(NULL, strDelimit);
+ cfg_item_count += 1;
+ }
+
+ if ((*biquad_count) * (*biquad_item_count) != tmpTotalItemCount) {
+ LOGE("%s, get item count error!!! should be %d, real is %d.\n", "TV", (*biquad_count) * (*biquad_item_count), tmpTotalItemCount);
+ *biquad_count = 0;
+ *biquad_item_count = 0;
+ return -1;
+ }
+
+ LOGD("%s, biquad count = %d, biquad item count = %d.\n", "TV", *biquad_count, *biquad_item_count);
+
+ return 0;
}
static int GetAudioAmplifierBiquadsDataBuffer00(int *biquad_count, int *biquad_item_count, int biquad_data_buf[])
{
- return RealGetAudioAmplifierBiquadsDataBuffer("audio.amplifier.biquad00.data", biquad_count, biquad_item_count, biquad_data_buf);
+ return RealGetAudioAmplifierBiquadsDataBuffer("audio.amplifier.biquad00.data", biquad_count, biquad_item_count, biquad_data_buf);
}
static int GetAudioAmplifierBiquadsDataBuffer01(int *biquad_count, int *biquad_item_count, int biquad_data_buf[])
{
- return RealGetAudioAmplifierBiquadsDataBuffer("audio.amplifier.biquad01.data", biquad_count, biquad_item_count, biquad_data_buf);
+ return RealGetAudioAmplifierBiquadsDataBuffer("audio.amplifier.biquad01.data", biquad_count, biquad_item_count, biquad_data_buf);
}
static int GetTvAudioCardID(char tv_card_id_buf[])
{
- config_get("audio.tv.card.id", tv_card_id_buf, "null");
- LOGD("%s, get card id is \"%s\".\n", "TV", tv_card_id_buf);
+ config_get("audio.tv.card.id", tv_card_id_buf, "null");
+ LOGD("%s, get card id is \"%s\".\n", "TV", tv_card_id_buf);
- if (strcmp(tv_card_id_buf, "null") == 0) {
- strcpy(tv_card_id_buf, "hw:AMLM2");
- LOGD("%s, card id not config, we set to default \"%s\".\n", "TV", "hw:AMLM2");
- }
+ if (strcmp(tv_card_id_buf, "null") == 0) {
+ strcpy(tv_card_id_buf, "hw:AMLM2");
+ LOGD("%s, card id not config, we set to default \"%s\".\n", "TV", "hw:AMLM2");
+ }
- return 0;
+ return 0;
}
static int GetTvAudioCardName(char tv_card_name_buf[])
{
- config_get("audio.tv.card.name", tv_card_name_buf, "null");
- LOGD("%s, get card name is \"%s\".\n", "TV", tv_card_name_buf);
+ config_get("audio.tv.card.name", tv_card_name_buf, "null");
+ LOGD("%s, get card name is \"%s\".\n", "TV", tv_card_name_buf);
- if (strcmp(tv_card_name_buf, "null") == 0) {
- strcpy(tv_card_name_buf, "AML-M2");
- LOGD("%s, card name not config, we set to default \"%s\".\n", "TV", "AML-M2");
- }
+ if (strcmp(tv_card_name_buf, "null") == 0) {
+ strcpy(tv_card_name_buf, "AML-M2");
+ LOGD("%s, card name not config, we set to default \"%s\".\n", "TV", "AML-M2");
+ }
- return 0;
+ return 0;
}
static int ATVGetFacRestoreChanInfo(int *chan_cnt, int *item_cnt, int chan_data_buf[])
{
- int cfg_item_count = 0, tmpTotalItemCount = 0;
- char *token = NULL;
- const char *strDelimit = ",";
- const char *key_str = "atv.fac.defchaninfo";
- char prop_value[CC_CFG_VALUE_STR_MAX_LEN];
-
- memset(prop_value, '\0', CC_CFG_VALUE_STR_MAX_LEN);
-
- config_get(key_str, prop_value, "null");
- if (strcasecmp(prop_value, "null") == 0) {
- LOGE("%s, can't get config \"%s\"!!!\n", "TV", key_str);
- *chan_cnt = 0;
- *item_cnt = 0;
- return -1;
- }
-
- tmpTotalItemCount = 0;
-
- token = strtok(prop_value, strDelimit);
- while (token != NULL) {
- if (cfg_item_count == 0) {
- *chan_cnt = strtoul(token, NULL, 10);
- } else if (cfg_item_count == 1) {
- *item_cnt = strtoul(token, NULL, 10);
- } else if (cfg_item_count >= 2) {
- chan_data_buf[tmpTotalItemCount] = strtoul(token, NULL, 10);
- tmpTotalItemCount += 1;
- }
-
- token = strtok(NULL, strDelimit);
- cfg_item_count += 1;
- }
-
- if ((*chan_cnt) * (*item_cnt) != tmpTotalItemCount) {
- LOGE("%s, get item count error!!! should be %d, real is %d.\n", "TV", (*chan_cnt) * (*item_cnt), tmpTotalItemCount);
- *chan_cnt = 0;
- *item_cnt = 0;
- return -1;
- }
-
- LOGD("%s, channel count = %d, channel item count = %d.\n", "TV", *chan_cnt, *item_cnt);
-
- return 0;
+ int cfg_item_count = 0, tmpTotalItemCount = 0;
+ char *token = NULL;
+ const char *strDelimit = ",";
+ const char *key_str = "atv.fac.defchaninfo";
+ char prop_value[CC_CFG_VALUE_STR_MAX_LEN];
+
+ memset(prop_value, '\0', CC_CFG_VALUE_STR_MAX_LEN);
+
+ config_get(key_str, prop_value, "null");
+ if (strcasecmp(prop_value, "null") == 0) {
+ LOGE("%s, can't get config \"%s\"!!!\n", "TV", key_str);
+ *chan_cnt = 0;
+ *item_cnt = 0;
+ return -1;
+ }
+
+ tmpTotalItemCount = 0;
+
+ token = strtok(prop_value, strDelimit);
+ while (token != NULL) {
+ if (cfg_item_count == 0) {
+ *chan_cnt = strtoul(token, NULL, 10);
+ } else if (cfg_item_count == 1) {
+ *item_cnt = strtoul(token, NULL, 10);
+ } else if (cfg_item_count >= 2) {
+ chan_data_buf[tmpTotalItemCount] = strtoul(token, NULL, 10);
+ tmpTotalItemCount += 1;
+ }
+
+ token = strtok(NULL, strDelimit);
+ cfg_item_count += 1;
+ }
+
+ if ((*chan_cnt) * (*item_cnt) != tmpTotalItemCount) {
+ LOGE("%s, get item count error!!! should be %d, real is %d.\n", "TV", (*chan_cnt) * (*item_cnt), tmpTotalItemCount);
+ *chan_cnt = 0;
+ *item_cnt = 0;
+ return -1;
+ }
+
+ LOGD("%s, channel count = %d, channel item count = %d.\n", "TV", *chan_cnt, *item_cnt);
+
+ return 0;
}
static void PrintGPIOCfgData(int cfg_info_item_count, GPIOCFGInfo cfg_info_buf[])
{
- int i = 0;
+ int i = 0;
- LOGD("%s, cfg_info_item_count = %d\n", "TV", cfg_info_item_count);
+ LOGD("%s, cfg_info_item_count = %d\n", "TV", cfg_info_item_count);
- for (i = 0; i < cfg_info_item_count; i++) {
- LOGD("%s, %s %d %d %d\n", "TV", cfg_info_buf[i].gpio_grp_str, cfg_info_buf[i].gpio_addr, cfg_info_buf[i].gpio_val, !cfg_info_buf[i].gpio_val);
- }
+ for (i = 0; i < cfg_info_item_count; i++) {
+ LOGD("%s, %s %d %d %d\n", "TV", cfg_info_buf[i].gpio_grp_str, cfg_info_buf[i].gpio_addr, cfg_info_buf[i].gpio_val, !cfg_info_buf[i].gpio_val);
+ }
- LOGD("\n");
+ LOGD("\n");
}
static int GetWriteProtectGPIOCFG(char gpio_grp_str[], int *protect_gpio_addr, int *protect_on_val, int *protect_off_val)
{
- if (cfg_get_one_gpio_data("ssm.writeprotect.gpio", gpio_grp_str, protect_gpio_addr, protect_on_val) < 0) {
- return -1;
- }
+ if (cfg_get_one_gpio_data("ssm.writeprotect.gpio", gpio_grp_str, protect_gpio_addr, protect_on_val) < 0) {
+ return -1;
+ }
- *protect_off_val = !(*protect_on_val);
+ *protect_off_val = !(*protect_on_val);
- return 0;
+ return 0;
}
#define CC_AMPLIFIER_ANALOG_MUTE_GPIO_CFG_NAME "audio.amp.analog.mute.gpio"
@@ -360,68 +360,68 @@ static int GetWriteProtectGPIOCFG(char gpio_grp_str[], int *protect_gpio_addr, i
static int GetAudioAnalogAmplifierMuteGPIOCFG(char gpio_grp_str[], int *mute_gpio_addr, int *mute_on_val, int *mute_off_val)
{
- if (cfg_get_one_gpio_data(CC_AMPLIFIER_ANALOG_MUTE_GPIO_CFG_NAME, gpio_grp_str, mute_gpio_addr, mute_on_val) < 0) {
- return -1;
- }
+ if (cfg_get_one_gpio_data(CC_AMPLIFIER_ANALOG_MUTE_GPIO_CFG_NAME, gpio_grp_str, mute_gpio_addr, mute_on_val) < 0) {
+ return -1;
+ }
- *mute_off_val = !(*mute_on_val);
+ *mute_off_val = !(*mute_on_val);
- return 0;
+ return 0;
}
static int GetAudioHeadSetMuteGPIOCFG(char gpio_grp_str[], int *mute_gpio_addr, int *mute_on_val, int *mute_off_val)
{
- if (cfg_get_one_gpio_data(CC_HEADSET_MUTE_GPIO_CFG_NAME, gpio_grp_str, mute_gpio_addr, mute_on_val) < 0) {
- return -1;
- }
+ if (cfg_get_one_gpio_data(CC_HEADSET_MUTE_GPIO_CFG_NAME, gpio_grp_str, mute_gpio_addr, mute_on_val) < 0) {
+ return -1;
+ }
- *mute_off_val = !(*mute_on_val);
+ *mute_off_val = !(*mute_on_val);
- return 0;
+ return 0;
}
static int GetAudioAVOutMuteGPIOCFG(char gpio_grp_str[], int *mute_gpio_addr, int *mute_on_val, int *mute_off_val)
{
- if (cfg_get_one_gpio_data(CC_AVOUT_MUTE_GPIO_CFG_NAME, gpio_grp_str, mute_gpio_addr, mute_on_val) < 0) {
- return -1;
- }
-
- //Some projects has been volume production. They may not use the newest code, so we do compatible for old config.
- //old config 69,0,1
- //new config x,69,0
-
- if (gpio_grp_str[0] != 'x' || gpio_grp_str[0] != 'b' || gpio_grp_str[0] != 'd') {
- *mute_gpio_addr = strtol(gpio_grp_str, NULL, 10);
- gpio_grp_str[0] = 'x';
- gpio_grp_str[1] = '\0';
- *mute_off_val = *mute_on_val;
- *mute_on_val = !(*mute_off_val);
- } else {
- *mute_off_val = !(*mute_on_val);
- }
-
- return 0;
+ if (cfg_get_one_gpio_data(CC_AVOUT_MUTE_GPIO_CFG_NAME, gpio_grp_str, mute_gpio_addr, mute_on_val) < 0) {
+ return -1;
+ }
+
+ //Some projects has been volume production. They may not use the newest code, so we do compatible for old config.
+ //old config 69,0,1
+ //new config x,69,0
+
+ if (gpio_grp_str[0] != 'x' || gpio_grp_str[0] != 'b' || gpio_grp_str[0] != 'd') {
+ *mute_gpio_addr = strtol(gpio_grp_str, NULL, 10);
+ gpio_grp_str[0] = 'x';
+ gpio_grp_str[1] = '\0';
+ *mute_off_val = *mute_on_val;
+ *mute_on_val = !(*mute_off_val);
+ } else {
+ *mute_off_val = !(*mute_on_val);
+ }
+
+ return 0;
}
#define PROPERTY_VALUE_MAX (92)
typedef enum tvin_source_input_e {
- SOURCE_TV,
- SOURCE_AV1,
- SOURCE_AV2,
- SOURCE_YPBPR1,
- SOURCE_YPBPR2,
- SOURCE_HDMI1,
- SOURCE_HDMI2,
- SOURCE_HDMI3,
- SOURCE_VGA,
- SOURCE_MPEG,
- SOURCE_DTV,
- SOURCE_MAX,
+ SOURCE_TV,
+ SOURCE_AV1,
+ SOURCE_AV2,
+ SOURCE_YPBPR1,
+ SOURCE_YPBPR2,
+ SOURCE_HDMI1,
+ SOURCE_HDMI2,
+ SOURCE_HDMI3,
+ SOURCE_VGA,
+ SOURCE_MPEG,
+ SOURCE_DTV,
+ SOURCE_MAX,
} tv_source_input_t;
static int property_set(const char *key_value, char *prop_value)
{
- LOGD("%s, %s = %s\n", "TV", key_value, prop_value);
- return 0;
+ LOGD("%s, %s = %s\n", "TV", key_value, prop_value);
+ return 0;
}