/* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_HARDWARE_TV_TUNER_V1_0_TUNER_H_ #define ANDROID_HARDWARE_TV_TUNER_V1_0_TUNER_H_ #include #include #include "Demux.h" #include "Frontend.h" #include "Lnb.h" using namespace std; namespace android { namespace hardware { namespace tv { namespace tuner { namespace V1_0 { namespace implementation { class Frontend; class Demux; class Tuner : public ITuner { public: Tuner(); virtual Return getFrontendIds(getFrontendIds_cb _hidl_cb) override; virtual Return openFrontendById(uint32_t frontendId, openFrontendById_cb _hidl_cb) override; virtual Return openDemux(openDemux_cb _hidl_cb) override; virtual Return getDemuxCaps(getDemuxCaps_cb _hidl_cb) override; virtual Return openDescrambler(openDescrambler_cb _hidl_cb) override; virtual Return getFrontendInfo(FrontendId frontendId, getFrontendInfo_cb _hidl_cb) override; virtual Return getLnbIds(getLnbIds_cb _hidl_cb) override; virtual Return openLnbById(LnbId lnbId, openLnbById_cb _hidl_cb) override; virtual Return openLnbByName(const hidl_string& lnbName, openLnbByName_cb _hidl_cb) override; sp getFrontendById(uint32_t frontendId); void setFrontendAsDemuxSource(uint32_t frontendId, uint32_t demuxId); void frontendStartTune(uint32_t frontendId); void frontendStopTune(uint32_t frontendId); void removeDemux(uint32_t demuxId); void removeFrontend(uint32_t frontendId); private: virtual ~Tuner(); // Static mFrontends array to maintain local frontends information map> mFrontends; map mFrontendCaps; map mFrontendToDemux; map> mDemuxes; // To maintain how many Frontends we have int mFrontendSize; // The last used demux id. Initial value is -1. // First used id will be 0. int mLastUsedId = -1; vector> mLnbs; }; } // namespace implementation } // namespace V1_0 } // namespace tuner } // namespace tv } // namespace hardware } // namespace android #endif // ANDROID_HARDWARE_TV_TUNER_V1_0_TUNER_H_