summaryrefslogtreecommitdiff
authorZhiqiang Han <zhiqiang.han@amlogic.com>2017-03-21 03:45:58 (GMT)
committer jing wei <jing.wei@amlogic.com>2017-03-30 05:55:43 (GMT)
commit864f603283aaaa7f76d853aca534a1d84bf20477 (patch)
tree61e21cd12071a920f17d7884bbfb5ef22744c21e
parentce7d8263bafed3d3ab303681e07d3e172e3b9c33 (diff)
downloadtv_input-864f603283aaaa7f76d853aca534a1d84bf20477.zip
tv_input-864f603283aaaa7f76d853aca534a1d84bf20477.tar.gz
tv_input-864f603283aaaa7f76d853aca534a1d84bf20477.tar.bz2
PD#141549: adtv: add a new source for mixed atv&dtv
specially for ATSC support. source id = 15 Change-Id: I22be8b72ca4d2824e9ed6f97d559226af59dee69
Diffstat
-rw-r--r--TvPlay.h6
-rw-r--r--tv_input.cpp42
2 files changed, 26 insertions, 22 deletions
diff --git a/TvPlay.h b/TvPlay.h
index 0d6880f..9e7f892 100644
--- a/TvPlay.h
+++ b/TvPlay.h
@@ -24,9 +24,15 @@ typedef enum tv_source_input_e {
SOURCE_IPTV,
SOURCE_DUMMY,
SOURCE_SPDIF,
+ SOURCE_ADTV,
SOURCE_MAX,
} tv_source_input_t;
+typedef enum tv_source_type_e {
+ TYPE_REAL,
+ TYPE_VIRTUAL,
+} tv_source_type_t;
+
class TvPlayObserver {
public:
TvPlayObserver() {};
diff --git a/tv_input.cpp b/tv_input.cpp
index dc079f6..2c4579a 100644
--- a/tv_input.cpp
+++ b/tv_input.cpp
@@ -88,6 +88,7 @@ static int notify_tv_device_status(tv_input_private_t *priv, tv_source_input_t s
switch (source_input) {
case SOURCE_TV:
case SOURCE_DTV:
+ case SOURCE_ADTV:
event.device_info.type = TV_INPUT_TYPE_TUNER;
break;
case SOURCE_AV1:
@@ -206,30 +207,27 @@ static void available_all_tv_device(tv_input_private_t *priv)
return;
}
- notify_tv_device_status(priv, SOURCE_TV, TV_INPUT_EVENT_DEVICE_AVAILABLE);
- notify_tv_device_status(priv, SOURCE_TV, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
-
- notify_tv_device_status(priv, SOURCE_DTV, TV_INPUT_EVENT_DEVICE_AVAILABLE);
- notify_tv_device_status(priv, SOURCE_DTV, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
-
- if (priv->mpTv->GetHdmiAvHotplugDetectOnoff()) {
- for (int i=0; i < count; i++) {
- tv_source_input_t source_input = (tv_source_input_t)tv_devices[i];
- if (source_input == SOURCE_TV || source_input == SOURCE_DTV)
- continue;
+ for (int i=0; i < count; i++) {
+ tv_source_input_t source_input = (tv_source_input_t)tv_devices[i];
+ if (source_input == SOURCE_TV) {
+ notify_tv_device_status(priv, SOURCE_TV, TV_INPUT_EVENT_DEVICE_AVAILABLE);
+ notify_tv_device_status(priv, SOURCE_TV, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
+ }
+ if (source_input == SOURCE_DTV) {
+ notify_tv_device_status(priv, SOURCE_DTV, TV_INPUT_EVENT_DEVICE_AVAILABLE);
+ notify_tv_device_status(priv, SOURCE_DTV, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
+ }
+ if (source_input == SOURCE_ADTV) {
+ notify_tv_device_status(priv, SOURCE_ADTV, TV_INPUT_EVENT_DEVICE_AVAILABLE);
+ notify_tv_device_status(priv, SOURCE_ADTV, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
+ }
- int status = priv->mpTv->GetSourceConnectStatus(source_input);
- if (status == 1) {
- notify_tv_device_status(priv, source_input, TV_INPUT_EVENT_DEVICE_AVAILABLE);
- notify_tv_device_status(priv, source_input, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
- }
+ int status = 1;
+ if (priv->mpTv->GetHdmiAvHotplugDetectOnoff()) {
+ status = priv->mpTv->GetSourceConnectStatus(source_input);
+ priv->mpTv->setTvObserver(priv->tvcallback);
}
- priv->mpTv->setTvObserver(priv->tvcallback);
- } else {
- for (int i=0; i < count; i++) {
- tv_source_input_t source_input = (tv_source_input_t)tv_devices[i];
- if (source_input == SOURCE_TV || source_input == SOURCE_DTV)
- continue;
+ if (status == 1) {
notify_tv_device_status(priv, source_input, TV_INPUT_EVENT_DEVICE_AVAILABLE);
notify_tv_device_status(priv, source_input, TV_INPUT_EVENT_STREAM_CONFIGURATIONS_CHANGED);
}