blob: 0d8d6a5f6e981c6b1dd703f2ab7e48a1a3ab9389 [file] [log] [blame]
Hongguang093c5f32021-08-09 19:46:34 -07001/*
2 * Copyright 2021 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_MEDIA_TUNERDVRHELPER_H
18#define ANDROID_MEDIA_TUNERDVRHELPER_H
19
20#include <aidl/android/media/tv/tunerresourcemanager/TunerFrontendInfo.h>
21#include <utils/String16.h>
22
23using ::aidl::android::media::tv::tunerresourcemanager::TunerFrontendInfo;
24using ::android::String16;
25
26using namespace std;
27
28namespace aidl {
29namespace android {
30namespace media {
31namespace tv {
32namespace tuner {
33
34const static int TUNER_HAL_VERSION_UNKNOWN = 0;
35const static int TUNER_HAL_VERSION_1_0 = 1 << 16;
36const static int TUNER_HAL_VERSION_1_1 = (1 << 16) | 1;
37const static int TUNER_HAL_VERSION_2_0 = 2 << 16;
38
39typedef enum {
40 FRONTEND,
41 LNB,
42 DEMUX,
43 DESCRAMBLER,
44} TunerResourceType;
45
46class TunerHelper {
47public:
48 static bool checkTunerFeature();
49
50 // TODO: update Demux, Descrambler.
51 static void updateTunerResources(const vector<TunerFrontendInfo>& feInfos,
52 const vector<int32_t>& lnbHandles);
53 // TODO: create a map between resource id and handles.
54 static int getResourceIdFromHandle(int resourceHandle, int type);
55 static int getResourceHandleFromId(int id, int resourceType);
56
57private:
58 static int32_t sResourceRequestCount;
59};
60
61} // namespace tuner
62} // namespace tv
63} // namespace media
64} // namespace android
65} // namespace aidl
66
67#endif // ANDROID_MEDIA_TUNERDVRHELPER_H