Home | History | Annotate | Download | only in 1.0
      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 ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
     18 #define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
     19 
     20 #include <hidl/MQDescriptor.h>
     21 #include <hidl/Status.h>
     22 
     23 #include <media/IOMX.h>
     24 
     25 #include <hidl/HybridInterface.h>
     26 #include <android/hardware/media/omx/1.0/IOmx.h>
     27 
     28 namespace android {
     29 namespace hardware {
     30 namespace media {
     31 namespace omx {
     32 namespace V1_0 {
     33 namespace utils {
     34 
     35 using ::android::hardware::media::omx::V1_0::IOmx;
     36 using ::android::hardware::media::omx::V1_0::IOmxNode;
     37 using ::android::hardware::media::omx::V1_0::IOmxObserver;
     38 using ::android::hardware::media::omx::V1_0::Status;
     39 using ::android::hidl::base::V1_0::IBase;
     40 using ::android::hardware::hidl_array;
     41 using ::android::hardware::hidl_memory;
     42 using ::android::hardware::hidl_string;
     43 using ::android::hardware::hidl_vec;
     44 using ::android::hardware::Return;
     45 using ::android::hardware::Void;
     46 using ::android::sp;
     47 
     48 using ::android::List;
     49 using ::android::IOMX;
     50 using ::android::BnOMX;
     51 
     52 /**
     53  * Wrapper classes for conversion
     54  * ==============================
     55  *
     56  * Naming convention:
     57  * - LW = Legacy Wrapper --- It wraps a Treble object inside a legacy object.
     58  * - TW = Treble Wrapper --- It wraps a legacy object inside a Treble object.
     59  */
     60 
     61 struct LWOmx : public BnOMX {
     62     sp<IOmx> mBase;
     63     LWOmx(sp<IOmx> const& base);
     64     status_t listNodes(List<IOMX::ComponentInfo>* list) override;
     65     status_t allocateNode(
     66             char const* name,
     67             sp<IOMXObserver> const& observer,
     68             sp<IOMXNode>* omxNode) override;
     69     status_t createInputSurface(
     70             sp<::android::IGraphicBufferProducer>* bufferProducer,
     71             sp<::android::IGraphicBufferSource>* bufferSource) override;
     72 };
     73 
     74 }  // namespace utils
     75 }  // namespace V1_0
     76 }  // namespace omx
     77 }  // namespace media
     78 }  // namespace hardware
     79 }  // namespace android
     80 
     81 #endif  // ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H
     82