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_WGRAPHICBUFFERSOURCE_H |
| 18 | #define ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H |
| 19 | |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 20 | #include <hidl/MQDescriptor.h> |
| 21 | #include <hidl/Status.h> |
| 22 | |
Pawin Vongmasa | 0d3a5ed | 2017-02-22 03:19:35 -0800 | [diff] [blame] | 23 | #include <binder/Binder.h> |
Pawin Vongmasa | ac7d412 | 2017-03-01 05:48:42 -0800 | [diff] [blame] | 24 | #include <media/IOMX.h> |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 25 | |
| 26 | #include <android/hardware/graphics/common/1.0/types.h> |
Pawin Vongmasa | 0d3a5ed | 2017-02-22 03:19:35 -0800 | [diff] [blame] | 27 | #include <android/hardware/media/omx/1.0/IOmxNode.h> |
| 28 | #include <android/hardware/media/omx/1.0/IGraphicBufferSource.h> |
| 29 | |
| 30 | #include <android/BnGraphicBufferSource.h> |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 31 | |
| 32 | namespace android { |
| 33 | namespace hardware { |
| 34 | namespace media { |
| 35 | namespace omx { |
| 36 | namespace V1_0 { |
| 37 | namespace utils { |
| 38 | |
| 39 | using ::android::hardware::graphics::common::V1_0::Dataspace; |
| 40 | using ::android::hardware::media::omx::V1_0::ColorAspects; |
| 41 | using ::android::hardware::media::omx::V1_0::IGraphicBufferSource; |
| 42 | using ::android::hardware::media::omx::V1_0::IOmxNode; |
| 43 | using ::android::hidl::base::V1_0::IBase; |
| 44 | using ::android::hardware::hidl_array; |
| 45 | using ::android::hardware::hidl_memory; |
| 46 | using ::android::hardware::hidl_string; |
| 47 | using ::android::hardware::hidl_vec; |
| 48 | using ::android::hardware::Return; |
| 49 | using ::android::hardware::Void; |
| 50 | using ::android::sp; |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 51 | using ::android::IOMXNode; |
| 52 | |
| 53 | /** |
| 54 | * Wrapper classes for conversion |
| 55 | * ============================== |
| 56 | * |
| 57 | * Naming convention: |
| 58 | * - LW = Legacy Wrapper --- It wraps a Treble object inside a legacy object. |
| 59 | * - TW = Treble Wrapper --- It wraps a legacy object inside a Treble object. |
| 60 | */ |
| 61 | |
Robert Shih | d095e65 | 2017-03-11 01:20:43 +0000 | [diff] [blame] | 62 | typedef ::android::binder::Status BnStatus; |
Pawin Vongmasa | 8ff4018 | 2017-02-07 02:22:34 -0800 | [diff] [blame] | 63 | typedef ::android::BnGraphicBufferSource BnGraphicBufferSource; |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 64 | typedef ::android::hardware::media::omx::V1_0::IGraphicBufferSource |
| 65 | TGraphicBufferSource; |
| 66 | |
Pawin Vongmasa | 8ff4018 | 2017-02-07 02:22:34 -0800 | [diff] [blame] | 67 | struct LWGraphicBufferSource : public BnGraphicBufferSource { |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 68 | sp<TGraphicBufferSource> mBase; |
| 69 | LWGraphicBufferSource(sp<TGraphicBufferSource> const& base); |
Pawin Vongmasa | 22dc508 | 2017-04-20 05:12:55 -0700 | [diff] [blame] | 70 | BnStatus configure(const sp<IOMXNode>& omxNode, int32_t dataSpace) override; |
Robert Shih | d095e65 | 2017-03-11 01:20:43 +0000 | [diff] [blame] | 71 | BnStatus setSuspend(bool suspend, int64_t timeUs) override; |
Pawin Vongmasa | 22dc508 | 2017-04-20 05:12:55 -0700 | [diff] [blame] | 72 | BnStatus setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs) override; |
Robert Shih | d095e65 | 2017-03-11 01:20:43 +0000 | [diff] [blame] | 73 | BnStatus setMaxFps(float maxFps) override; |
Pawin Vongmasa | 22dc508 | 2017-04-20 05:12:55 -0700 | [diff] [blame] | 74 | BnStatus setTimeLapseConfig(double fps, double captureFps) override; |
Robert Shih | d095e65 | 2017-03-11 01:20:43 +0000 | [diff] [blame] | 75 | BnStatus setStartTimeUs(int64_t startTimeUs) override; |
| 76 | BnStatus setStopTimeUs(int64_t stopTimeUs) override; |
Hangyu Kuang | f72cefd | 2017-04-05 11:07:08 -0700 | [diff] [blame] | 77 | BnStatus getStopTimeOffsetUs(int64_t *stopTimeOffsetUs) override; |
Robert Shih | d095e65 | 2017-03-11 01:20:43 +0000 | [diff] [blame] | 78 | BnStatus setColorAspects(int32_t aspects) override; |
| 79 | BnStatus setTimeOffsetUs(int64_t timeOffsetsUs) override; |
| 80 | BnStatus signalEndOfInputStream() override; |
Pawin Vongmasa | eeac97b | 2017-01-18 05:03:07 -0800 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | } // namespace utils |
| 84 | } // namespace V1_0 |
| 85 | } // namespace omx |
| 86 | } // namespace media |
| 87 | } // namespace hardware |
| 88 | } // namespace android |
| 89 | |
| 90 | #endif // ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H |