1 /* 2 * Copyright 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 #ifndef ANDROID_HARDWARE_GRAPHICS_BUFFERQUEUE_V1_0_H2BPRODUCERLISTENER_H 18 #define ANDROID_HARDWARE_GRAPHICS_BUFFERQUEUE_V1_0_H2BPRODUCERLISTENER_H 19 20 #include <android/hardware/graphics/bufferqueue/1.0/IProducerListener.h> 21 #include <gui/IProducerListener.h> 22 #include <hidl/HybridInterface.h> 23 24 namespace android { 25 namespace hardware { 26 namespace graphics { 27 namespace bufferqueue { 28 namespace V1_0 { 29 namespace utils { 30 31 using HProducerListener = ::android::hardware::graphics::bufferqueue::V1_0:: 32 IProducerListener; 33 34 using BProducerListener = ::android::IProducerListener; 35 36 class H2BProducerListener 37 #ifndef NO_BINDER 38 : public H2BConverter<HProducerListener, BnProducerListener> { 39 #else 40 : public BProducerListener { 41 sp<HProducerListener> mBase; 42 #endif 43 public: 44 H2BProducerListener(sp<HProducerListener> const& base); 45 virtual void onBufferReleased() override; 46 virtual bool needsReleaseNotify() override; 47 }; 48 49 } // namespace utils 50 } // namespace V1_0 51 } // namespace bufferqueue 52 } // namespace graphics 53 } // namespace hardware 54 } // namespace android 55 56 #endif // ANDROID_HARDWARE_GRAPHICS_BUFFERQUEUE_V1_0_H2BPRODUCERLISTENER_H 57 58