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_V2_0_B2HPRODUCERLISTENER_H 18 #define ANDROID_HARDWARE_GRAPHICS_BUFFERQUEUE_V2_0_B2HPRODUCERLISTENER_H 19 20 #include <android/hidl/base/1.0/IBase.h> 21 #include <binder/IBinder.h> 22 #include <gui/IProducerListener.h> 23 #include <hidl/Status.h> 24 25 #include <android/hardware/graphics/bufferqueue/2.0/IProducerListener.h> 26 27 namespace android { 28 namespace hardware { 29 namespace graphics { 30 namespace bufferqueue { 31 namespace V2_0 { 32 namespace utils { 33 34 using ::android::hardware::Return; 35 36 using HProducerListener = ::android::hardware::graphics::bufferqueue::V2_0:: 37 IProducerListener; 38 39 using BProducerListener = ::android::IProducerListener; 40 41 struct B2HProducerListener : public HProducerListener { 42 explicit B2HProducerListener(sp<BProducerListener> const& base); 43 Return<void> onBuffersReleased(uint32_t count) override; 44 protected: 45 sp<BProducerListener> mBase; 46 bool mNeedsReleaseNotify; 47 }; 48 49 } // namespace utils 50 } // namespace V2_0 51 } // namespace bufferqueue 52 } // namespace graphics 53 } // namespace hardware 54 } // namespace android 55 56 #endif // ANDROID_HARDWARE_GRAPHICS_BUFFERQUEUE_V2_0_B2HPRODUCERLISTENER_H 57 58