blob: d535da6f33f017f2b0651195acb4a5c907313054 [file] [log] [blame]
Hongguang093c5f32021-08-09 19:46:34 -07001/**
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
23using ::aidl::android::hardware::tv::tuner::DemuxFilterType;
24using ::aidl::android::hardware::tv::tuner::DvrType;
25using ::android::sp;
26using ::android::hardware::Return;
27using ::android::hardware::Void;
28using ::android::hardware::tv::tuner::V1_0::IDemux;
29using ::std::shared_ptr;
30using ::std::vector;
31
32using HidlIDemux = ::android::hardware::tv::tuner::V1_0::IDemux;
33
34namespace aidl {
35namespace android {
36namespace media {
37namespace tv {
38namespace tuner {
39
40class TunerHidlDemux : public BnTunerDemux {
41public:
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
62 int getId() { return mDemuxId; }
63
64private:
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