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.media.tv.tuner.TunerFilterConfiguration; 23 import android.media.tv.tuner.TunerFilterSharedHandleInfo; 24 25 /** 26 * Tuner Filter interface handles tuner related operations. 27 * 28 * {@hide} 29 */ 30 interface ITunerFilter { 31 /** 32 * Get the filter Id. 33 */ getId()34 int getId(); 35 36 /** 37 * Get the 64-bit filter Id. 38 */ getId64Bit()39 long getId64Bit(); 40 41 /** 42 * Get the descriptor of the Filter's FMQ. 43 */ getQueueDesc()44 MQDescriptor<byte, SynchronizedReadWrite> getQueueDesc(); 45 46 /** 47 * Configure the filter. 48 */ configure(in TunerFilterConfiguration config)49 void configure(in TunerFilterConfiguration config); 50 51 /** 52 * Configure the monitor event of the Filter. 53 */ configureMonitorEvent(in int monitorEventType)54 void configureMonitorEvent(in int monitorEventType); 55 56 /** 57 * Configure the context id of the IP Filter. 58 */ configureIpFilterContextId(in int cid)59 void configureIpFilterContextId(in int cid); 60 61 /** 62 * Configure the stream type of the media Filter. 63 */ configureAvStreamType(in int avStreamType)64 void configureAvStreamType(in int avStreamType); 65 66 /** 67 * Get the a/v shared memory handle 68 */ getAvSharedHandleInfo()69 TunerFilterSharedHandleInfo getAvSharedHandleInfo(); 70 71 /** 72 * Release the handle reported by the HAL for AV memory. 73 */ releaseAvHandle(in NativeHandle handle, in long avDataId)74 void releaseAvHandle(in NativeHandle handle, in long avDataId); 75 76 /** 77 * Set the filter's data source. 78 */ setDataSource(ITunerFilter filter)79 void setDataSource(ITunerFilter filter); 80 81 /** 82 * Start the filter. 83 */ start()84 void start(); 85 86 /** 87 * Stop the filter. 88 */ stop()89 void stop(); 90 91 /** 92 * Flush the filter. 93 */ flush()94 void flush(); 95 96 /** 97 * Close the filter. 98 */ close()99 void close(); 100 } 101