diff --git a/tv/tuner/1.0/default/Tuner.cpp b/tv/tuner/1.0/default/Tuner.cpp index 6f9a5cf016..e39333ce3e 100644 --- a/tv/tuner/1.0/default/Tuner.cpp +++ b/tv/tuner/1.0/default/Tuner.cpp @@ -46,6 +46,48 @@ Tuner::Tuner() { mFrontends[5] = new Frontend(FrontendType::ISDBT, 5, this); mFrontends[6] = new Frontend(FrontendType::ANALOG, 6, this); mFrontends[7] = new Frontend(FrontendType::ATSC, 7, this); + + FrontendInfo::FrontendCapabilities caps; + mFrontendCaps.resize(mFrontendSize); + caps = FrontendInfo::FrontendCapabilities(); + caps.dvbtCaps(FrontendDvbtCapabilities()); + mFrontendCaps[0] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + caps.atscCaps(FrontendAtscCapabilities()); + mFrontendCaps[1] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + caps.dvbcCaps(FrontendDvbcCapabilities()); + mFrontendCaps[2] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + caps.dvbsCaps(FrontendDvbsCapabilities()); + mFrontendCaps[3] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + caps.dvbtCaps(FrontendDvbtCapabilities()); + mFrontendCaps[4] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + FrontendIsdbtCapabilities isdbtCaps{ + .modeCap = FrontendIsdbtMode::MODE_1 | FrontendIsdbtMode::MODE_2, + .bandwidthCap = (unsigned int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, + .modulationCap = (unsigned int)FrontendIsdbtModulation::MOD_16QAM, + // ISDBT shares coderate and guard interval with DVBT + .coderateCap = FrontendDvbtCoderate::CODERATE_4_5 | FrontendDvbtCoderate::CODERATE_6_7, + .guardIntervalCap = (unsigned int)FrontendDvbtGuardInterval::INTERVAL_1_128, + }; + caps.isdbtCaps(isdbtCaps); + mFrontendCaps[5] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + caps.analogCaps(FrontendAnalogCapabilities()); + mFrontendCaps[6] = caps; + + caps = FrontendInfo::FrontendCapabilities(); + caps.atscCaps(FrontendAtscCapabilities()); + mFrontendCaps[7] = caps; } Tuner::~Tuner() {} @@ -129,20 +171,9 @@ Return Tuner::getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _h FrontendStatusType::LAYER_ERROR, FrontendStatusType::ATSC3_PLP_INFO, }; - FrontendInfo::FrontendCapabilities frontendCaps; - FrontendIsdbtCapabilities isdbtCaps{ - .modeCap = FrontendIsdbtMode::MODE_1 | FrontendIsdbtMode::MODE_2, - .bandwidthCap = (unsigned int)FrontendIsdbtBandwidth::BANDWIDTH_6MHZ, - .modulationCap = (unsigned int)FrontendIsdbtModulation::MOD_16QAM, - // ISDBT shares coderate and guard interval with DVBT - .coderateCap = - FrontendDvbtCoderate::CODERATE_4_5 | FrontendDvbtCoderate::CODERATE_6_7, - .guardIntervalCap = (unsigned int)FrontendDvbtGuardInterval::INTERVAL_1_128, - }; - frontendCaps.isdbtCaps(isdbtCaps); // assign randomly selected values for testing. info = { - .type = FrontendType::ISDBT, + .type = mFrontends[frontendId]->getFrontendType(), .minFrequency = 139, .maxFrequency = 1139, .minSymbolRate = 45, @@ -150,7 +181,7 @@ Return Tuner::getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _h .acquireRange = 30, .exclusiveGroupId = 57, .statusCaps = statusCaps, - .frontendCaps = frontendCaps, + .frontendCaps = mFrontendCaps[frontendId], }; break; } diff --git a/tv/tuner/1.0/default/Tuner.h b/tv/tuner/1.0/default/Tuner.h index 7a8a9198ce..d17b5aeb64 100644 --- a/tv/tuner/1.0/default/Tuner.h +++ b/tv/tuner/1.0/default/Tuner.h @@ -68,6 +68,7 @@ class Tuner : public ITuner { virtual ~Tuner(); // Static mFrontends array to maintain local frontends information vector> mFrontends; + vector mFrontendCaps; std::map mFrontendToDemux; std::map> mDemuxes; // To maintain how many Frontends we have