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_WOMXOBSERVER_H 18#define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXOBSERVER_H 19 20#include <list> 21 22#include <hidl/MQDescriptor.h> 23#include <hidl/Status.h> 24 25#include <media/IOMX.h> 26 27#include <android/hardware/media/omx/1.0/IOmxObserver.h> 28 29namespace android { 30namespace hardware { 31namespace media { 32namespace omx { 33namespace V1_0 { 34namespace utils { 35 36using ::android::hardware::media::omx::V1_0::IOmxObserver; 37using ::android::hardware::media::omx::V1_0::Message; 38using ::android::hidl::base::V1_0::IBase; 39using ::android::hardware::hidl_array; 40using ::android::hardware::hidl_memory; 41using ::android::hardware::hidl_string; 42using ::android::hardware::hidl_vec; 43using ::android::hardware::Return; 44using ::android::hardware::Void; 45using ::android::sp; 46 47using ::android::IOMXObserver; 48using ::android::BnOMXObserver; 49using ::android::omx_message; 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 60struct LWOmxObserver : public BnOMXObserver { 61 sp<IOmxObserver> mBase; 62 LWOmxObserver(sp<IOmxObserver> const& base); 63 void onMessages(std::list<omx_message> const& lMessages) override; 64}; 65 66struct TWOmxObserver : public IOmxObserver { 67 sp<IOMXObserver> mBase; 68 TWOmxObserver(sp<IOMXObserver> const& base); 69 Return<void> onMessages(const hidl_vec<Message>& tMessages) override; 70}; 71 72} // namespace utils 73} // namespace V1_0 74} // namespace omx 75} // namespace media 76} // namespace hardware 77} // namespace android 78 79#endif // ANDROID_HARDWARE_MEDIA_OMX_V1_0_WOMXOBSERVER_H 80