Home | History | Annotate | Download | only in 1.0
      1 /*
      2  * Copyright (C) 2018 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 package android.frameworks.bufferhub@1.0;
     17 
     18 import android.hardware.graphics.common@1.2::HardwareBufferDescription;
     19 import IBufferClient;
     20 
     21 interface IBufferHub {
     22     /**
     23      * Allocates a new buffer.
     24      *
     25      * @param description The desired buffer parameters for the new buffer.
     26      * @param userMetadataSize The size of the user defined metadata in bytes.
     27      * @return status The result of this operation. NO_ERROR on success,
     28      *     error code on failure.
     29      * @return bufferClient An bufferClient interface associated with
     30      *     the buffer just allocated.
     31      * @return bufferTraits the struct containing the information of the buffer.
     32      */
     33     allocateBuffer(HardwareBufferDescription description,
     34                    uint32_t userMetadataSize)
     35         generates (BufferHubStatus status,
     36                    IBufferClient bufferClient,
     37                    BufferTraits bufferTraits);
     38 
     39     /**
     40      * Fetches a bufferClient interface from a provided handle.
     41      *
     42      * @param nativeHandle Handle received from allocateBuffer.
     43      * @return status The result of this operation. NO_ERROR on success,
     44      *     error code on failure.
     45      * @return bufferClient An bufferClient interface associated with
     46      *     the nativeHandle passed in.
     47      * @return bufferTraits the struct containing the information of the buffer.
     48      */
     49     importBuffer(handle nativeHandle)
     50         generates (BufferHubStatus status,
     51                    IBufferClient bufferClient,
     52                    BufferTraits bufferTraits);
     53 };
     54