Henry Fang | 859ec12 | 2019-10-02 18:42:57 -0700 | [diff] [blame] | 1 | /* |
| 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 Fang | f3eec03 | 2019-08-15 18:57:08 -0700 | [diff] [blame] | 17 | package android.hardware.tv.tuner@1.0; |
| 18 | |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 19 | import IDvr; |
| 20 | import IDvrCallback; |
| 21 | import IFilter; |
| 22 | import IFilterCallback; |
| 23 | import ITimeFilter; |
Henry Fang | f3eec03 | 2019-08-15 18:57:08 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Demultiplexer(Demux) takes a single multiplexed input and splits it into |
| 27 | * one or more output. |
Henry Fang | f3eec03 | 2019-08-15 18:57:08 -0700 | [diff] [blame] | 28 | */ |
| 29 | interface IDemux { |
Henry Fang | f3eec03 | 2019-08-15 18:57:08 -0700 | [diff] [blame] | 30 | /** |
| 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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 44 | * Open a new filter in the demux |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 45 | * |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 46 | * It is used by the client to open a filter in the demux. |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 47 | * |
| 48 | * @param type the type of the filter to be added. |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 49 | * @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 Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 51 | * @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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 57 | * @return filter the filter instance of the newly added. |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 58 | */ |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 59 | openFilter(DemuxFilterType type, uint32_t bufferSize, IFilterCallback cb) |
| 60 | generates (Result result, IFilter filter); |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 61 | |
| 62 | /** |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 63 | * Open time filter of the demux |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 64 | * |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 65 | * It is used by the client to open time filter of the demux. |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 66 | * |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 67 | * @return result Result status of the operation. |
| 68 | * SUCCESS if successful, |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 69 | * UNAVAILABLE if time filter is not supported. |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 70 | * INVALID_STATE if failed for wrong state. |
| 71 | * UNKNOWN_ERROR if failed for other reasons. |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 72 | * @return timeFilter the time filter instance of the newly added. |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 73 | */ |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 74 | openTimeFilter() generates (Result result, ITimeFilter timeFilter); |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 75 | |
| 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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 81 | * @param filter the filter instance. |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 82 | * @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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 88 | getAvSyncHwId(IFilter filter) generates (Result result, AvSyncHwId avSyncHwId); |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 89 | |
| 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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 104 | getAvSyncTime(AvSyncHwId avSyncHwId) generates (Result result, uint64_t time); |
Henry Fang | 2dfa337 | 2019-08-23 10:31:21 -0700 | [diff] [blame] | 105 | |
| 106 | /** |
Henry Fang | f3eec03 | 2019-08-15 18:57:08 -0700 | [diff] [blame] | 107 | * 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 Fang | f3eec03 | 2019-08-15 18:57:08 -0700 | [diff] [blame] | 117 | |
Henry Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 118 | /** |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 119 | * Open a DVR (Digital Video Record) instance in the demux |
Henry Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 120 | * |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 121 | * It is used by the client to record and playback. |
Henry Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 122 | * |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 123 | * @param type specify which kind of DVR to open. |
Henry Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 124 | * @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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 126 | * @param cb the callback for the DVR to be used to send notifications |
Henry Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 127 | * 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 Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 132 | * @return dvr a DVR instance. |
Henry Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 133 | */ |
Henry Fang | e5125a8 | 2019-10-14 13:49:21 -0700 | [diff] [blame] | 134 | openDvr(DvrType type, uint32_t bufferSize, IDvrCallback cb) |
| 135 | generates (Result result, IDvr dvr); |
Henry Fang | 89f12f5 | 2019-11-05 13:48:59 -0800 | [diff] [blame] | 136 | |
| 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 Fang | 2226b07 | 2019-09-05 14:56:48 -0700 | [diff] [blame] | 162 | }; |