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