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