blob: c089864d32d63aa639dc5f86a03cc3f4f8df64cb [file] [log] [blame]
Amy126ee922019-08-09 16:25:12 -07001/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_HARDWARE_TV_TUNER_V1_0_TUNER_H_
18#define ANDROID_HARDWARE_TV_TUNER_V1_0_TUNER_H_
19
20#include <android/hardware/tv/tuner/1.0/ITuner.h>
21#include "Frontend.h"
22
23using namespace std;
24
25namespace android {
26namespace hardware {
27namespace tv {
28namespace tuner {
29namespace V1_0 {
30namespace implementation {
31
32class Tuner : public ITuner {
33 public:
34 Tuner();
35 virtual Return<void> getFrontendIds(getFrontendIds_cb _hidl_cb) override;
36
37 virtual Return<void> openFrontendById(uint32_t frontendId,
38 openFrontendById_cb _hidl_cb) override;
39
Henry Fangf3eec032019-08-15 18:57:08 -070040 virtual Return<void> openDemux(openDemux_cb _hidl_cb) override;
41
Amy42a5b4b2019-10-03 16:49:48 -070042 virtual Return<void> getDemuxCaps(getDemuxCaps_cb _hidl_cb) override;
43
Henry Fangf3eec032019-08-15 18:57:08 -070044 virtual Return<void> openDescrambler(openDescrambler_cb _hidl_cb) override;
45
Amy016b7312019-09-16 15:51:28 -070046 virtual Return<void> getFrontendInfo(FrontendId frontendId,
47 getFrontendInfo_cb _hidl_cb) override;
48
49 virtual Return<void> getLnbIds(getLnbIds_cb _hidl_cb) override;
50
51 virtual Return<void> openLnbById(LnbId lnbId, openLnbById_cb _hidl_cb) override;
52
Amy126ee922019-08-09 16:25:12 -070053 private:
54 virtual ~Tuner();
55 // Static mFrontends array to maintain local frontends information
56 vector<sp<Frontend>> mFrontends;
57 // To maintain how many Frontends we have
58 int mFrontendSize;
Amyfd4243a2019-08-16 16:01:27 -070059 // The last used demux id. Initial value is -1.
60 // First used id will be 0.
61 int mLastUsedId = -1;
Amy126ee922019-08-09 16:25:12 -070062};
63
64} // namespace implementation
65} // namespace V1_0
66} // namespace tuner
67} // namespace tv
68} // namespace hardware
69} // namespace android
70
71#endif // ANDROID_HARDWARE_TV_TUNER_V1_0_TUNER_H_