1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright 2021 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::IGraphicBufferProducer; 20*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::IComponent; 21*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::Status; 22*4d7e907cSAndroid Build Coastguard Worker 23*4d7e907cSAndroid Build Coastguard Worker 24*4d7e907cSAndroid Build Coastguard Worker/** 25*4d7e907cSAndroid Build Coastguard Worker * Interface for a Codec2 component corresponding to API level 1.2 or below. 26*4d7e907cSAndroid Build Coastguard Worker * Components have two states: stopped and running. The running state has three 27*4d7e907cSAndroid Build Coastguard Worker * sub-states: executing, tripped and error. 28*4d7e907cSAndroid Build Coastguard Worker * 29*4d7e907cSAndroid Build Coastguard Worker * All methods in `IComponent` must not block. If a method call cannot be 30*4d7e907cSAndroid Build Coastguard Worker * completed in a timely manner, it must return `TIMED_OUT` in the return 31*4d7e907cSAndroid Build Coastguard Worker * status. 32*4d7e907cSAndroid Build Coastguard Worker * 33*4d7e907cSAndroid Build Coastguard Worker * @note This is an extension of version 1.1 of `IComponent`. The purpose of the 34*4d7e907cSAndroid Build Coastguard Worker * extension is to add blocking allocation of output buffer from surface. 35*4d7e907cSAndroid Build Coastguard Worker */ 36*4d7e907cSAndroid Build Coastguard Workerinterface IComponent extends @1.1::IComponent { 37*4d7e907cSAndroid Build Coastguard Worker /** 38*4d7e907cSAndroid Build Coastguard Worker * Starts using a surface for output with a synchronization object 39*4d7e907cSAndroid Build Coastguard Worker * 40*4d7e907cSAndroid Build Coastguard Worker * This method must not block. 41*4d7e907cSAndroid Build Coastguard Worker * 42*4d7e907cSAndroid Build Coastguard Worker * @param blockPoolId Id of the `C2BlockPool` to be associated with the 43*4d7e907cSAndroid Build Coastguard Worker * output surface. 44*4d7e907cSAndroid Build Coastguard Worker * @param surface Output surface. 45*4d7e907cSAndroid Build Coastguard Worker * @param syncObject synchronization object for buffer allocation between 46*4d7e907cSAndroid Build Coastguard Worker * Framework and Component. 47*4d7e907cSAndroid Build Coastguard Worker * @return status Status of the call, which may be 48*4d7e907cSAndroid Build Coastguard Worker * - `OK` - The operation completed successfully. 49*4d7e907cSAndroid Build Coastguard Worker * - `CANNOT_DO` - The component does not support an output surface. 50*4d7e907cSAndroid Build Coastguard Worker * - `REFUSED` - The output surface cannot be accessed. 51*4d7e907cSAndroid Build Coastguard Worker * - `TIMED_OUT` - The operation cannot be finished in a timely manner. 52*4d7e907cSAndroid Build Coastguard Worker * - `CORRUPTED` - Some unknown error occurred. 53*4d7e907cSAndroid Build Coastguard Worker */ 54*4d7e907cSAndroid Build Coastguard Worker setOutputSurfaceWithSyncObj( 55*4d7e907cSAndroid Build Coastguard Worker uint64_t blockPoolId, 56*4d7e907cSAndroid Build Coastguard Worker @2.0::IGraphicBufferProducer surface, 57*4d7e907cSAndroid Build Coastguard Worker SurfaceSyncObj syncObject 58*4d7e907cSAndroid Build Coastguard Worker ) generates ( 59*4d7e907cSAndroid Build Coastguard Worker Status status 60*4d7e907cSAndroid Build Coastguard Worker ); 61*4d7e907cSAndroid Build Coastguard Worker}; 62