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 TunerHidlDemux : public BnTunerDemux { 41 public: 42 TunerHidlDemux(sp<HidlIDemux> demux, int demuxId); 43 virtual ~TunerHidlDemux(); 44 45 ::ndk::ScopedAStatus setFrontendDataSource( 46 const shared_ptr<ITunerFrontend>& in_frontend) override; 47 ::ndk::ScopedAStatus setFrontendDataSourceById(int frontendId) override; 48 ::ndk::ScopedAStatus openFilter(const DemuxFilterType& in_type, int32_t in_bufferSize, 49 const shared_ptr<ITunerFilterCallback>& in_cb, 50 shared_ptr<ITunerFilter>* _aidl_return) override; 51 ::ndk::ScopedAStatus openTimeFilter(shared_ptr<ITunerTimeFilter>* _aidl_return) override; 52 ::ndk::ScopedAStatus getAvSyncHwId(const shared_ptr<ITunerFilter>& in_tunerFilter, 53 int32_t* _aidl_return) override; 54 ::ndk::ScopedAStatus getAvSyncTime(int32_t in_avSyncHwId, int64_t* _aidl_return) override; 55 ::ndk::ScopedAStatus openDvr(DvrType in_dvbType, int32_t in_bufferSize, 56 const shared_ptr<ITunerDvrCallback>& in_cb, 57 shared_ptr<ITunerDvr>* _aidl_return) override; 58 ::ndk::ScopedAStatus connectCiCam(int32_t in_ciCamId) override; 59 ::ndk::ScopedAStatus disconnectCiCam() override; 60 ::ndk::ScopedAStatus close() override; 61 getId()62 int getId() { return mDemuxId; } 63 64 private: 65 sp<HidlIDemux> mDemux; 66 int mDemuxId; 67 }; 68 69 } // namespace tuner 70 } // namespace tv 71 } // namespace media 72 } // namespace android 73 } // namespace aidl 74 75 #endif // ANDROID_MEDIA_TUNERHIDLDEMUX_H 76