blob: 16fc39279d9fb7898554abe22e8962ccfbf1754f [file] [log] [blame]
Henry Fang859ec122019-10-02 18:42:57 -07001/*
2 * Copyright (C) 2019 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
Henry Fangf3eec032019-08-15 18:57:08 -070017package android.hardware.tv.tuner@1.0;
18
Henry Fange5125a82019-10-14 13:49:21 -070019import IDvr;
20import IDvrCallback;
21import IFilter;
22import IFilterCallback;
23import ITimeFilter;
Henry Fangf3eec032019-08-15 18:57:08 -070024
25/**
26 * Demultiplexer(Demux) takes a single multiplexed input and splits it into
27 * one or more output.
Henry Fangf3eec032019-08-15 18:57:08 -070028 */
29interface IDemux {
Henry Fangf3eec032019-08-15 18:57:08 -070030 /**
31 * Set a frontend resource as data input of the demux
32 *
33 * It is used by the client to specify a hardware frontend as data source of
34 * this demux instance. A demux instance can have only one data source.
35 *
36 * @return result Result status of the operation.
37 * SUCCESS if successful,
38 * INVALID_STATE if failed for wrong state.
39 * UNKNOWN_ERROR if failed for other reasons.
40 */
41 setFrontendDataSource(FrontendId frontendId) generates (Result result);
42
43 /**
Henry Fange5125a82019-10-14 13:49:21 -070044 * Open a new filter in the demux
Henry Fang2dfa3372019-08-23 10:31:21 -070045 *
Henry Fange5125a82019-10-14 13:49:21 -070046 * It is used by the client to open a filter in the demux.
Henry Fang2dfa3372019-08-23 10:31:21 -070047 *
48 * @param type the type of the filter to be added.
Henry Fange5125a82019-10-14 13:49:21 -070049 * @param bufferSize the buffer size of the filter to be opened. It's used
50 * to create a FMQ(Fast Message Queue) to hold data output from the filter.
Henry Fang2dfa3372019-08-23 10:31:21 -070051 * @param cb the callback for the filter to be used to send notifications
52 * back to the client.
53 * @return result Result status of the operation.
54 * SUCCESS if successful,
55 * INVALID_STATE if failed for wrong state.
56 * UNKNOWN_ERROR if failed for other reasons.
Henry Fange5125a82019-10-14 13:49:21 -070057 * @return filter the filter instance of the newly added.
Henry Fang2dfa3372019-08-23 10:31:21 -070058 */
Henry Fange5125a82019-10-14 13:49:21 -070059 openFilter(DemuxFilterType type, uint32_t bufferSize, IFilterCallback cb)
60 generates (Result result, IFilter filter);
Henry Fang2dfa3372019-08-23 10:31:21 -070061
62 /**
Henry Fange5125a82019-10-14 13:49:21 -070063 * Open time filter of the demux
Henry Fang2dfa3372019-08-23 10:31:21 -070064 *
Henry Fange5125a82019-10-14 13:49:21 -070065 * It is used by the client to open time filter of the demux.
Henry Fang2dfa3372019-08-23 10:31:21 -070066 *
Henry Fang2dfa3372019-08-23 10:31:21 -070067 * @return result Result status of the operation.
68 * SUCCESS if successful,
Henry Fange5125a82019-10-14 13:49:21 -070069 * UNAVAILABLE if time filter is not supported.
Henry Fang2dfa3372019-08-23 10:31:21 -070070 * INVALID_STATE if failed for wrong state.
71 * UNKNOWN_ERROR if failed for other reasons.
Henry Fange5125a82019-10-14 13:49:21 -070072 * @return timeFilter the time filter instance of the newly added.
Henry Fang2dfa3372019-08-23 10:31:21 -070073 */
Henry Fange5125a82019-10-14 13:49:21 -070074 openTimeFilter() generates (Result result, ITimeFilter timeFilter);
Henry Fang2dfa3372019-08-23 10:31:21 -070075
76 /**
77 * Get hardware sync ID for audio and video.
78 *
79 * It is used by the client to get the hardware sync ID for audio and video.
80 *
Henry Fange5125a82019-10-14 13:49:21 -070081 * @param filter the filter instance.
Henry Fang2dfa3372019-08-23 10:31:21 -070082 * @return result Result status of the operation.
83 * SUCCESS if successful,
84 * INVALID_ARGUMENT if failed for a wrong filter ID.
85 * UNKNOWN_ERROR if failed for other reasons.
86 * @return avSyncHwId the id of hardware A/V sync.
87 */
Henry Fange5125a82019-10-14 13:49:21 -070088 getAvSyncHwId(IFilter filter) generates (Result result, AvSyncHwId avSyncHwId);
Henry Fang2dfa3372019-08-23 10:31:21 -070089
90 /**
91 * Get current time stamp to use for A/V sync
92 *
93 * It is used by the client to get current time stamp for A/V sync. HW is
94 * supported to increment and maintain current time stamp.
95 *
96 * @param avSyncHwId the hardware id of A/V sync.
97 * @return result Result status of the operation.
98 * SUCCESS if successful,
99 * INVALID_ARGUMENT if failed for a wrong hardware ID of A/V sync.
100 * UNKNOWN_ERROR if failed for other reasons.
101 * @return time the current time stamp of hardware A/V sync. The time stamp
102 * based on 90KHz has the same format as PTS (Presentation Time Stamp).
103 */
Henry Fange5125a82019-10-14 13:49:21 -0700104 getAvSyncTime(AvSyncHwId avSyncHwId) generates (Result result, uint64_t time);
Henry Fang2dfa3372019-08-23 10:31:21 -0700105
106 /**
Henry Fangf3eec032019-08-15 18:57:08 -0700107 * Close the Demux instance
108 *
109 * It is used by the client to release the demux instance. HAL clear
110 * underneath resource. client mustn't access the instance any more.
111 *
112 * @return result Result status of the operation.
113 * SUCCESS if successful,
114 * UNKNOWN_ERROR if failed for other reasons.
115 */
116 close() generates (Result result);
Henry Fangf3eec032019-08-15 18:57:08 -0700117
Henry Fang2226b072019-09-05 14:56:48 -0700118 /**
Henry Fange5125a82019-10-14 13:49:21 -0700119 * Open a DVR (Digital Video Record) instance in the demux
Henry Fang2226b072019-09-05 14:56:48 -0700120 *
Henry Fange5125a82019-10-14 13:49:21 -0700121 * It is used by the client to record and playback.
Henry Fang2226b072019-09-05 14:56:48 -0700122 *
Henry Fange5125a82019-10-14 13:49:21 -0700123 * @param type specify which kind of DVR to open.
Henry Fang2226b072019-09-05 14:56:48 -0700124 * @param bufferSize the buffer size of the output to be added. It's used to
125 * create a FMQ(Fast Message Queue) to hold data from selected filters.
Henry Fange5125a82019-10-14 13:49:21 -0700126 * @param cb the callback for the DVR to be used to send notifications
Henry Fang2226b072019-09-05 14:56:48 -0700127 * back to the client.
128 * @return result Result status of the operation.
129 * SUCCESS if successful,
130 * OUT_OF_MEMORY if failed for not enough memory.
131 * UNKNOWN_ERROR if failed for other reasons.
Henry Fange5125a82019-10-14 13:49:21 -0700132 * @return dvr a DVR instance.
Henry Fang2226b072019-09-05 14:56:48 -0700133 */
Henry Fange5125a82019-10-14 13:49:21 -0700134 openDvr(DvrType type, uint32_t bufferSize, IDvrCallback cb)
135 generates (Result result, IDvr dvr);
Henry Fang89f12f52019-11-05 13:48:59 -0800136
137 /**
138 * Connect Conditional Access Modules (CAM) through Common Interface (CI)
139 *
140 * It is used by the client to connect CI-CAM. The demux uses the output
141 * from the frontend as the input by default, and must change to use the
142 * output from CI-CAM as the input after this call take place.
143 *
144 * @param ciCamId specify CI-CAM Id to connect.
145 * @return result Result status of the operation.
146 * SUCCESS if successful,
147 * UNKNOWN_ERROR if failed for other reasons.
148 */
149 connectCiCam(uint32_t ciCamId) generates (Result result);
150
151 /**
152 * Disconnect Conditional Access Modules (CAM)
153 *
154 * It is used by the client to disconnect CI-CAM. The demux will use the
155 * output from the frontend as the input after this call take place.
156 *
157 * @return result Result status of the operation.
158 * SUCCESS if successful,
159 * UNKNOWN_ERROR if failed for other reasons.
160 */
161 disconnectCiCam() generates (Result result);
Henry Fang2226b072019-09-05 14:56:48 -0700162};