blob: 6eca8ab463e1b74cecc21101682e90b73addaff5 [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;
25using ::aidl::android::media::tv::tuner::ITunerFilter;
26using ::aidl::android::media::tv::tuner::ITunerFilterCallback;
27using ::aidl::android::media::tv::tuner::ITunerFrontend;
28using ::android::hardware::tv::tuner::V1_0::IDemux;
29
30
31namespace android {
32
33class TunerDemux : public BnTunerDemux {
34
35public:
36 TunerDemux(sp<IDemux> demux, int demuxId);
37 virtual ~TunerDemux();
38 Status setFrontendDataSource(const std::shared_ptr<ITunerFrontend>& frontend) override;
39 Status openFilter(
40 int mainType, int subtype, int bufferSize, const std::shared_ptr<ITunerFilterCallback>& cb,
41 std::shared_ptr<ITunerFilter>* _aidl_return);
42
43private:
44 sp<IDemux> mDemux;
45 int mDemuxId;
46};
47
48} // namespace android
49
50#endif // ANDROID_MEDIA_TUNERDEMUX_H