blob: f77a0d8894dc5a4ad7708b16c7811c64a8945c30 [file] [log] [blame]
Amy7fb75d82019-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_FRONTEND_H_
18#define ANDROID_HARDWARE_TV_TUNER_V1_0_FRONTEND_H_
19
20#include <android/hardware/tv/tuner/1.0/IFrontend.h>
21#include <android/hardware/tv/tuner/1.0/ITuner.h>
22
23using namespace std;
24
25namespace android {
26namespace hardware {
27namespace tv {
28namespace tuner {
29namespace V1_0 {
30namespace implementation {
31
32using ::android::hardware::tv::tuner::V1_0::FrontendId;
33using ::android::hardware::tv::tuner::V1_0::FrontendType;
34using ::android::hardware::tv::tuner::V1_0::IFrontend;
35using ::android::hardware::tv::tuner::V1_0::IFrontendCallback;
36using ::android::hardware::tv::tuner::V1_0::Result;
37
38class Frontend : public IFrontend {
39 public:
40 Frontend();
41 Frontend(FrontendType type, FrontendId id);
42
43 virtual Return<Result> close() override;
44
45 virtual Return<Result> setCallback(const sp<IFrontendCallback>& callback) override;
46
47 virtual Return<Result> tune(const FrontendSettings& settings) override;
48
49 virtual Return<Result> stopTune() override;
50
51 FrontendType getFrontendType();
52
53 FrontendId getFrontendId();
54
55 private:
56 virtual ~Frontend();
57 sp<IFrontendCallback> mCallback;
58 FrontendType mType = FrontendType::UNDEFINED;
59 FrontendId mId = 0;
60};
61
62} // namespace implementation
63} // namespace V1_0
64} // namespace tuner
65} // namespace tv
66} // namespace hardware
67} // namespace android
68
69#endif // ANDROID_HARDWARE_TV_TUNER_V1_0_FRONTEND_H_