1 /** 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_TUNERHIDLDEMUX_H 18 #define ANDROID_MEDIA_TUNERHIDLDEMUX_H 19 20 #include <aidl/android/media/tv/tuner/BnTunerDemux.h> 21 #include <android/hardware/tv/tuner/1.0/ITuner.h> 22 23 using ::aidl::android::hardware::tv::tuner::DemuxFilterType; 24 using ::aidl::android::hardware::tv::tuner::DvrType; 25 using ::android::sp; 26 using ::android::hardware::Return; 27 using ::android::hardware::Void; 28 using ::android::hardware::tv::tuner::V1_0::IDemux; 29 using ::std::shared_ptr; 30 using ::std::vector; 31 32 using HidlIDemux = ::android::hardware::tv::tuner::V1_0::IDemux; 33 34 namespace aidl { 35 namespace android { 36 namespace media { 37 namespace tv { 38 namespace tuner { 39 40 class TunerHidlService; 41 42 class TunerHidlDemux : public BnTunerDemux { 43 public: 44 TunerHidlDemux(const sp<HidlIDemux> demux, const int demuxId, 45 const shared_ptr<TunerHidlService> tuner); 46 virtual ~TunerHidlDemux(); 47 48 ::ndk::ScopedAStatus setFrontendDataSource( 49 const shared_ptr<ITunerFrontend>& in_frontend) override; 50 ::ndk::ScopedAStatus setFrontendDataSourceById(int frontendId) override; 51 ::ndk::ScopedAStatus openFilter(const DemuxFilterType& in_type, int32_t in_bufferSize, 52 const shared_ptr<ITunerFilterCallback>& in_cb, 53 shared_ptr<ITunerFilter>* _aidl_return) override; 54 ::ndk::ScopedAStatus openTimeFilter(shared_ptr<ITunerTimeFilter>* _aidl_return) override; 55 ::ndk::ScopedAStatus getAvSyncHwId(const shared_ptr<ITunerFilter>& in_tunerFilter, 56 int32_t* _aidl_return) override; 57 ::ndk::ScopedAStatus getAvSyncTime(int32_t in_avSyncHwId, int64_t* _aidl_return) override; 58 ::ndk::ScopedAStatus openDvr(DvrType in_dvbType, int32_t in_bufferSize, 59 const shared_ptr<ITunerDvrCallback>& in_cb, 60 shared_ptr<ITunerDvr>* _aidl_return) override; 61 ::ndk::ScopedAStatus connectCiCam(int32_t in_ciCamId) override; 62 ::ndk::ScopedAStatus disconnectCiCam() override; 63 ::ndk::ScopedAStatus close() override; 64 getId()65 int getId() { return mDemuxId; } 66 67 private: 68 sp<HidlIDemux> mDemux; 69 int mDemuxId; 70 shared_ptr<TunerHidlService> mTunerService; 71 }; 72 73 } // namespace tuner 74 } // namespace tv 75 } // namespace media 76 } // namespace android 77 } // namespace aidl 78 79 #endif // ANDROID_MEDIA_TUNERHIDLDEMUX_H 80