Home | History | Annotate | Download | only in bqhelper
      1 /*
      2  * Copyright 2016, 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 MEDIA_STAGEFRIGHT_WPRODUCERLISTENER_H_
     18 #define MEDIA_STAGEFRIGHT_WPRODUCERLISTENER_H_
     19 
     20 #include <hidl/MQDescriptor.h>
     21 #include <hidl/Status.h>
     22 
     23 #include <binder/IBinder.h>
     24 #include <gui/IProducerListener.h>
     25 
     26 #include <android/hardware/graphics/bufferqueue/1.0/IProducerListener.h>
     27 
     28 namespace android {
     29 
     30 using ::android::hidl::base::V1_0::IBase;
     31 using ::android::hardware::hidl_array;
     32 using ::android::hardware::hidl_memory;
     33 using ::android::hardware::hidl_string;
     34 using ::android::hardware::hidl_vec;
     35 using ::android::hardware::Return;
     36 using ::android::hardware::Void;
     37 using ::android::sp;
     38 
     39 typedef ::android::hardware::graphics::bufferqueue::V1_0::IProducerListener
     40         HProducerListener;
     41 typedef ::android::IProducerListener
     42         BProducerListener;
     43 using ::android::BnProducerListener;
     44 
     45 struct TWProducerListener : public HProducerListener {
     46     sp<BProducerListener> mBase;
     47     TWProducerListener(sp<BProducerListener> const& base);
     48     Return<void> onBufferReleased() override;
     49     Return<bool> needsReleaseNotify() override;
     50 };
     51 
     52 class LWProducerListener : public BnProducerListener {
     53 public:
     54     sp<HProducerListener> mBase;
     55     LWProducerListener(sp<HProducerListener> const& base);
     56     void onBufferReleased() override;
     57     bool needsReleaseNotify() override;
     58 };
     59 
     60 }  // namespace android
     61 
     62 #endif  // MEDIA_STAGEFRIGHT_WPRODUCERLISTENER_H_
     63