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 17 package android.media.eco; 18 19 import android.media.eco.ECOData; 20 import android.media.eco.IECOServiceStatsProvider; 21 import android.media.eco.IECOServiceInfoListener; 22 import android.media.eco.IECOSession; 23 24 /** 25 * Binder interface for ECO (Encoder Camera Optimization) service. 26 * @hide 27 */ 28 interface IECOService { 29 /** 30 * All ECO service Binder calls may return a ServiceSpecificException with the following error 31 * codes. 32 */ 33 const int ERROR_PERMISSION_DENIED = 1; 34 const int ERROR_ALREADY_EXISTS = 2; 35 const int ERROR_ILLEGAL_ARGUMENT = 3; 36 const int ERROR_DISCONNECTED = 4; 37 const int ERROR_INVALID_OPERATION = 5; 38 const int ERROR_UNSUPPORTED = 6; 39 40 /** 41 * Obtains an IECOSession from the ECO service. 42 * 43 * <p>ECOService will first check if the requested session already existed. If not, it will 44 * create and return the new session. This should be called by IECOServiceStatsProvider or 45 * IECOServiceInfoListener to obtain an ECOSession interface upon start.</p> 46 * 47 * @param width Width of the requested video session (in pixel). 48 * @param height Height of the requested video session (in pixel). 49 * @param isCameraRecording A boolean indicates whether the session is for camera recording. 50 * 51 * @return IECOSession The session instance created by the ECOService. 52 */ obtainSession(int width, int height, boolean isCameraRecording)53 IECOSession obtainSession(int width, int height, boolean isCameraRecording); 54 55 /** 56 * Return the total number of sessions inside ECO service. 57 */ getNumOfSessions()58 int getNumOfSessions(); 59 60 /** 61 * Return a list containing all ECOSessions. 62 */ getSessions()63 List<IBinder> getSessions(); 64 } 65