1 /* 2 * Copyright (C) 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.car.evs; 18 19 import android.car.evs.CarEvsStatus; 20 import android.car.evs.ICarEvsStatusListener; 21 import android.car.evs.ICarEvsStreamCallback; 22 import android.os.IBinder; 23 24 /** 25 * @hide 26 */ 27 interface ICarEvsService { 28 29 /** 30 * Registers a listener to receive changes in CarEvsManager's status. 31 */ registerStatusListener(in ICarEvsStatusListener listener)32 void registerStatusListener(in ICarEvsStatusListener listener); 33 34 /** 35 * Unregisters a service listener. 36 */ unregisterStatusListener(in ICarEvsStatusListener listener)37 void unregisterStatusListener(in ICarEvsStatusListener listener); 38 39 /** 40 * Requests to start a video stream. 41 */ startVideoStream(int serviceType, in IBinder token, in ICarEvsStreamCallback callback)42 int startVideoStream(int serviceType, in IBinder token, in ICarEvsStreamCallback callback); 43 44 /** 45 * Requests to stop an active video stream. 46 */ stopVideoStream(in ICarEvsStreamCallback callback)47 void stopVideoStream(in ICarEvsStreamCallback callback); 48 49 /** 50 * Returns the buffer when its usages are done. 51 */ returnFrameBuffer(int bufferId)52 void returnFrameBuffer(int bufferId); 53 54 /** 55 * Returns a current status of CarEvsService. 56 */ getCurrentStatus()57 CarEvsStatus getCurrentStatus(); 58 59 /** 60 * Returns a generated session token. 61 */ generateSessionToken()62 IBinder generateSessionToken(); 63 64 /** 65 * Requests to start a camera previewing activity for a given service type. 66 */ startActivity(int type)67 int startActivity(int type); 68 69 /** 70 * Requests to stop a camera previewing activity, which was launched via startActivity(). 71 */ stopActivity()72 void stopActivity(); 73 74 /** 75 * Returns whether or not a given service type is supported. 76 */ isSupported(int type)77 boolean isSupported(int type); 78 } 79