From 864f603283aaaa7f76d853aca534a1d84bf20477 Mon Sep 17 00:00:00 2001 From: Zhiqiang Han Date: Tue, 21 Mar 2017 03:45:58 +0000 Subject: PD#141549: adtv: add a new source for mixed atv&dtv specially for ATSC support. source id = 15 Change-Id: I22be8b72ca4d2824e9ed6f97d559226af59dee69 --- 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); } -- cgit