Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 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 | |
Pawin Vongmasa | 0d3a5ed | 2017-02-22 03:19:35 -0800 | [diff] [blame] | 20 | #include <list> |
| 21 | |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 22 | #include <hidl/MQDescriptor.h> |
| 23 | #include <hidl/Status.h> |
| 24 | |
Pawin Vongmasa | 0d3a5ed | 2017-02-22 03:19:35 -0800 | [diff] [blame] | 25 | #include <media/IOMX.h> |
| 26 | |
| 27 | #include <android/hardware/media/omx/1.0/IOmxObserver.h> |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 28 | |
| 29 | namespace android { |
| 30 | namespace hardware { |
| 31 | namespace media { |
| 32 | namespace omx { |
| 33 | namespace V1_0 { |
| 34 | namespace utils { |
| 35 | |
| 36 | using ::android::hardware::media::omx::V1_0::IOmxObserver; |
| 37 | using ::android::hardware::media::omx::V1_0::Message; |
| 38 | using ::android::hidl::base::V1_0::IBase; |
| 39 | using ::android::hardware::hidl_array; |
| 40 | using ::android::hardware::hidl_memory; |
| 41 | using ::android::hardware::hidl_string; |
| 42 | using ::android::hardware::hidl_vec; |
| 43 | using ::android::hardware::Return; |
| 44 | using ::android::hardware::Void; |
| 45 | using ::android::sp; |
| 46 | |
| 47 | using ::android::IOMXObserver; |
Pawin Vongmasa | 8ff4018 | 2017-02-07 02:22:34 -0800 | [diff] [blame] | 48 | using ::android::BnOMXObserver; |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 49 | using ::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 | |
Pawin Vongmasa | 8ff4018 | 2017-02-07 02:22:34 -0800 | [diff] [blame] | 60 | struct LWOmxObserver : public BnOMXObserver { |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 61 | sp<IOmxObserver> mBase; |
| 62 | LWOmxObserver(sp<IOmxObserver> const& base); |
| 63 | void onMessages(std::list<omx_message> const& lMessages) override; |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 64 | }; |
| 65 | |
| 66 | struct 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 |