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 20 #include <hidl/MQDescriptor.h> 21 #include <hidl/Status.h> 22 23 #include <android/hardware/media/omx/1.0/IGraphicBufferSource.h> 24 #include <android/hardware/media/omx/1.0/IOmxNode.h> 25 #include <android/hardware/graphics/common/1.0/types.h> 26 #include <android/hardware/media/omx/1.0/IOmxNode.h> 27 #include <android/hardware/media/omx/1.0/IGraphicBufferSource.h> 28 29 #include <android/BnGraphicBufferSource.h> 30 31 #include <media/stagefright/omx/GraphicBufferSource.h> 32 33 namespace android { 34 namespace hardware { 35 namespace media { 36 namespace omx { 37 namespace V1_0 { 38 namespace implementation { 39 40 using ::android::GraphicBufferSource; 41 using ::android::hardware::graphics::common::V1_0::Dataspace; 42 using ::android::hardware::media::omx::V1_0::ColorAspects; 43 using ::android::hardware::media::omx::V1_0::IGraphicBufferSource; 44 using ::android::hardware::media::omx::V1_0::IOmxNode; 45 using ::android::hardware::media::omx::V1_0::Status; 46 using ::android::hidl::base::V1_0::IBase; 47 using ::android::hardware::hidl_array; 48 using ::android::hardware::hidl_memory; 49 using ::android::hardware::hidl_string; 50 using ::android::hardware::hidl_vec; 51 using ::android::hardware::Return; 52 using ::android::hardware::Void; 53 using ::android::sp; 54 55 using ::android::IOMXNode; 56 57 /** 58 * Wrapper classes for conversion 59 * ============================== 60 * 61 * Naming convention: 62 * - LW = Legacy Wrapper --- It wraps a Treble object inside a legacy object. 63 * - TW = Treble Wrapper --- It wraps a legacy object inside a Treble object. 64 */ 65 66 typedef ::android::hardware::media::omx::V1_0::IGraphicBufferSource 67 TGraphicBufferSource; 68 69 struct TWGraphicBufferSource : public TGraphicBufferSource { 70 struct TWOmxNodeWrapper; 71 struct TWOmxBufferSource; 72 sp<GraphicBufferSource> mBase; 73 sp<IOmxBufferSource> mOmxBufferSource; 74 75 TWGraphicBufferSource(sp<GraphicBufferSource> const& base); 76 Return<Status> configure( 77 const sp<IOmxNode>& omxNode, Dataspace dataspace) override; 78 Return<Status> setSuspend(bool suspend, int64_t timeUs) override; 79 Return<Status> setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs) override; 80 Return<Status> setMaxFps(float maxFps) override; 81 Return<Status> setTimeLapseConfig(double fps, double captureFps) override; 82 Return<Status> setStartTimeUs(int64_t startTimeUs) override; 83 Return<Status> setStopTimeUs(int64_t stopTimeUs) override; 84 Return<void> getStopTimeOffsetUs(getStopTimeOffsetUs_cb _hidl_cb) override; 85 Return<Status> setColorAspects(const ColorAspects& aspects) override; 86 Return<Status> setTimeOffsetUs(int64_t timeOffsetUs) override; 87 Return<Status> signalEndOfInputStream() override; 88 }; 89 90 } // namespace implementation 91 } // namespace V1_0 92 } // namespace omx 93 } // namespace media 94 } // namespace hardware 95 } // namespace android 96 97 #endif // ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H 98