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 51 /** 52 * Wrapper classes for conversion 53 * ============================== 54 * 55 * Naming convention: 56 * - LW = Legacy Wrapper --- It wraps a Treble object inside a legacy object. 57 * - TW = Treble Wrapper --- It wraps a legacy object inside a Treble object. 58 */ 59 60 struct LWOmx : public IOMX { 61 sp<IOmx> mBase; 62 LWOmx(sp<IOmx> const& base); 63 status_t listNodes(List<IOMX::ComponentInfo>* list) override; 64 status_t allocateNode( 65 char const* name, 66 sp<IOMXObserver> const& observer, 67 sp<IOMXNode>* omxNode) override; 68 status_t createInputSurface( 69 sp<::android::IGraphicBufferProducer>* bufferProducer, 70 sp<::android::IGraphicBufferSource>* bufferSource) override; 71 }; 72 73 } // namespace utils 74 } // namespace V1_0 75 } // namespace omx 76 } // namespace media 77 } // namespace hardware 78 } // namespace android 79 80 #endif // ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMX_H 81