1 /** 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 package android.media.tv.tuner; 18 19 import android.hardware.common.fmq.MQDescriptor; 20 import android.hardware.common.fmq.SynchronizedReadWrite; 21 import android.hardware.common.NativeHandle; 22 import android.hardware.tv.tuner.DemuxFilterSettings; 23 import android.hardware.tv.tuner.DemuxFilterType; 24 import android.hardware.tv.tuner.AvStreamType; 25 import android.hardware.tv.tuner.DemuxFilterMonitorEventType; 26 import android.hardware.tv.tuner.FilterDelayHint; 27 28 /** 29 * Tuner Filter interface handles tuner related operations. 30 * 31 * {@hide} 32 */ 33 interface ITunerFilter { 34 /** 35 * Get the filter Id. 36 */ getId()37 int getId(); 38 39 /** 40 * Get the 64-bit filter Id. 41 */ getId64Bit()42 long getId64Bit(); 43 44 /** 45 * Get the descriptor of the Filter's FMQ. 46 */ getQueueDesc()47 MQDescriptor<byte, SynchronizedReadWrite> getQueueDesc(); 48 49 /** 50 * Configure the filter. 51 */ configure(in DemuxFilterSettings settings)52 void configure(in DemuxFilterSettings settings); 53 54 /** 55 * Configure the monitor event of the Filter. 56 */ configureMonitorEvent(in int monitorEventTypes)57 void configureMonitorEvent(in int monitorEventTypes); 58 59 /** 60 * Configure the context id of the IP Filter. 61 */ configureIpFilterContextId(in int cid)62 void configureIpFilterContextId(in int cid); 63 64 /** 65 * Configure the stream type of the media Filter. 66 */ configureAvStreamType(in AvStreamType avStreamType)67 void configureAvStreamType(in AvStreamType avStreamType); 68 69 /** 70 * Get the a/v shared memory handle 71 */ getAvSharedHandle(out NativeHandle avMemory)72 long getAvSharedHandle(out NativeHandle avMemory); 73 74 /** 75 * Release the handle reported by the HAL for AV memory. 76 */ releaseAvHandle(in NativeHandle handle, in long avDataId)77 void releaseAvHandle(in NativeHandle handle, in long avDataId); 78 79 /** 80 * Set the filter's data source. 81 */ setDataSource(ITunerFilter filter)82 void setDataSource(ITunerFilter filter); 83 84 /** 85 * Start the filter. 86 */ start()87 void start(); 88 89 /** 90 * Stop the filter. 91 */ stop()92 void stop(); 93 94 /** 95 * Flush the filter. 96 */ flush()97 void flush(); 98 99 /** 100 * Close the filter. 101 */ close()102 void close(); 103 104 /** 105 * Acquire a new SharedFilter token. 106 * 107 * @return a token of the newly created SharedFilter instance. 108 */ acquireSharedFilterToken()109 String acquireSharedFilterToken(); 110 111 /** 112 * Free a SharedFilter token. 113 * 114 * @param filterToken the SharedFilter token will be released. 115 * @return a token of the newly created SharedFilter instance. 116 */ freeSharedFilterToken(in String filterToken)117 void freeSharedFilterToken(in String filterToken); 118 119 /** 120 * Get filter type. 121 * 122 * @return filter type. 123 */ getFilterType()124 DemuxFilterType getFilterType(); 125 setDelayHint(in FilterDelayHint hint)126 void setDelayHint(in FilterDelayHint hint); 127 } 128