Amy Zhang | bf68a16 | 2020-11-23 17:42:40 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2020 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_TV_FRONTEND_CLIENT_H_ |
| 18 | #define _ANDROID_MEDIA_TV_FRONTEND_CLIENT_H_ |
| 19 | |
| 20 | #include <aidl/android/media/tv/tuner/ITunerFrontend.h> |
| 21 | #include <android/hardware/tv/tuner/1.1/IFrontend.h> |
| 22 | #include <android/hardware/tv/tuner/1.1/IFrontendCallback.h> |
| 23 | #include <android/hardware/tv/tuner/1.1/types.h> |
| 24 | |
| 25 | //#include "FrontendClientCallback" |
| 26 | |
| 27 | using ::aidl::android::media::tv::tuner::ITunerFrontend; |
| 28 | |
| 29 | using ::android::hardware::tv::tuner::V1_0::FrontendInfo; |
| 30 | using ::android::hardware::tv::tuner::V1_0::IFrontend; |
| 31 | |
| 32 | using namespace std; |
| 33 | |
| 34 | namespace android { |
| 35 | |
| 36 | struct FrontendClient : public RefBase { |
| 37 | FrontendClient(shared_ptr<ITunerFrontend> tunerFrontend); |
| 38 | ~FrontendClient(); |
| 39 | |
| 40 | void setHidlFrontend(sp<IFrontend> frontend); |
| 41 | |
| 42 | private: |
| 43 | /** |
| 44 | * An AIDL Tuner Frontend Singleton assigned at the first time when the Tuner Client |
| 45 | * opens a frontend cient. Default null when the service does not exist. |
| 46 | */ |
| 47 | shared_ptr<ITunerFrontend> mTunerFrontend; |
| 48 | |
| 49 | /** |
| 50 | * A Frontend 1.0 HAL interface as a fall back interface when the Tuner Service does not exist. |
| 51 | * This is a temprary connection before the Tuner Framework fully migrates to the TunerService. |
| 52 | * Default null. |
| 53 | */ |
| 54 | sp<IFrontend> mFrontend; |
| 55 | |
| 56 | /** |
| 57 | * A Frontend 1.1 HAL interface as a fall back interface when the Tuner Service does not exist. |
| 58 | * This is a temprary connection before the Tuner Framework fully migrates to the TunerService. |
| 59 | * Default null. |
| 60 | */ |
| 61 | sp<::android::hardware::tv::tuner::V1_1::IFrontend> mFrontend_1_1; |
| 62 | }; |
| 63 | } // namespace android |
| 64 | |
| 65 | #endif // _ANDROID_MEDIA_TV_FRONTEND_CLIENT_H_ |