blob: b58cf70823c9f09d311351fa576f991c25a8bf99 [file] [log] [blame]
Hongguang600a6ae2021-07-08 18:51:51 -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#pragma once
18
19#include <aidl/android/hardware/tv/tuner/DemuxCapabilities.h>
Kensuke Miyagi73b18ac2022-11-07 10:49:09 -080020#include <aidl/android/hardware/tv/tuner/DemuxInfo.h>
Hongguang600a6ae2021-07-08 18:51:51 -070021#include <aidl/android/hardware/tv/tuner/IDemux.h>
22#include <aidl/android/hardware/tv/tuner/IFilter.h>
23#include <aidl/android/hardware/tv/tuner/ITuner.h>
24
25#include <gtest/gtest.h>
26#include <log/log.h>
27
28using ::testing::AssertionResult;
29
30using namespace aidl::android::hardware::tv::tuner;
31
32class DemuxTests {
33 public:
34 void setService(std::shared_ptr<ITuner> tuner) { mService = tuner; }
35
Kensuke Miyagi73b18ac2022-11-07 10:49:09 -080036 AssertionResult getDemuxIds(std::vector<int32_t>& demuxIds);
Hongguang600a6ae2021-07-08 18:51:51 -070037 AssertionResult openDemux(std::shared_ptr<IDemux>& demux, int32_t& demuxId);
Kensuke Miyagi73b18ac2022-11-07 10:49:09 -080038 AssertionResult openDemuxById(int32_t demuxId, std::shared_ptr<IDemux>& demux);
Hongguang600a6ae2021-07-08 18:51:51 -070039 AssertionResult setDemuxFrontendDataSource(int32_t frontendId);
40 AssertionResult getAvSyncId(std::shared_ptr<IFilter> filter, int32_t& avSyncHwId);
41 AssertionResult getAvSyncTime(int32_t avSyncId);
42 AssertionResult getDemuxCaps(DemuxCapabilities& demuxCaps);
Kensuke Miyagi73b18ac2022-11-07 10:49:09 -080043 AssertionResult getDemuxInfo(int32_t demuxId, DemuxInfo& demuxInfo);
Hongguang600a6ae2021-07-08 18:51:51 -070044 AssertionResult closeDemux();
45
46 protected:
47 static AssertionResult failure() { return ::testing::AssertionFailure(); }
48
49 static AssertionResult success() { return ::testing::AssertionSuccess(); }
50
51 std::shared_ptr<ITuner> mService;
52 std::shared_ptr<IDemux> mDemux;
53};