blob: 675bb7c471759ba8f5e162a68318d2adc1574bf7 [file] [log] [blame]
shubangae56a2e2021-01-21 07:29:55 -08001/**
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/media/tv/tuner/BnTunerDemux.h>
21#include <android/hardware/tv/tuner/1.0/ITuner.h>
22
23using Status = ::ndk::ScopedAStatus;
24using ::aidl::android::media::tv::tuner::BnTunerDemux;
Amy Zhangada92d72021-01-22 16:45:53 -080025using ::aidl::android::media::tv::tuner::ITunerDvr;
26using ::aidl::android::media::tv::tuner::ITunerDvrCallback;
shubangae56a2e2021-01-21 07:29:55 -080027using ::aidl::android::media::tv::tuner::ITunerFilter;
28using ::aidl::android::media::tv::tuner::ITunerFilterCallback;
29using ::aidl::android::media::tv::tuner::ITunerFrontend;
30using ::android::hardware::tv::tuner::V1_0::IDemux;
Amy Zhangada92d72021-01-22 16:45:53 -080031using ::android::hardware::tv::tuner::V1_0::IDvr;
32using ::android::hardware::tv::tuner::V1_0::IDvrCallback;
shubangae56a2e2021-01-21 07:29:55 -080033
Amy Zhangada92d72021-01-22 16:45:53 -080034using namespace std;
shubangae56a2e2021-01-21 07:29:55 -080035
36namespace android {
37
38class TunerDemux : public BnTunerDemux {
39
40public:
41 TunerDemux(sp<IDemux> demux, int demuxId);
42 virtual ~TunerDemux();
Amy Zhangada92d72021-01-22 16:45:53 -080043 Status setFrontendDataSource(const shared_ptr<ITunerFrontend>& frontend) override;
shubangae56a2e2021-01-21 07:29:55 -080044 Status openFilter(
Amy Zhangada92d72021-01-22 16:45:53 -080045 int mainType, int subtype, int bufferSize, const shared_ptr<ITunerFilterCallback>& cb,
46 shared_ptr<ITunerFilter>* _aidl_return);
47 Status openDvr(
48 int dvbType, int bufferSize, const shared_ptr<ITunerDvrCallback>& cb,
49 shared_ptr<ITunerDvr>* _aidl_return) override;
shubangae56a2e2021-01-21 07:29:55 -080050
51private:
52 sp<IDemux> mDemux;
53 int mDemuxId;
54};
55
56} // namespace android
57
58#endif // ANDROID_MEDIA_TUNERDEMUX_H