Haoxiang Li | b21a13e | 2019-06-18 13:16:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 CAR_EVS_APP_RENDERDIRECTVIEW_H |
| 18 | #define CAR_EVS_APP_RENDERDIRECTVIEW_H |
| 19 | |
| 20 | |
| 21 | #include "RenderBase.h" |
| 22 | |
| 23 | #include <android/hardware/automotive/evs/1.0/IEvsEnumerator.h> |
| 24 | #include "ConfigManager.h" |
| 25 | #include "VideoTex.h" |
| 26 | |
Haoxiang Li | d2454a5 | 2019-06-18 13:23:12 -0700 | [diff] [blame] | 27 | namespace android { |
| 28 | namespace automotive { |
| 29 | namespace evs { |
| 30 | namespace support { |
Haoxiang Li | b21a13e | 2019-06-18 13:16:28 -0700 | [diff] [blame] | 31 | |
| 32 | using namespace ::android::hardware::automotive::evs::V1_0; |
| 33 | |
| 34 | |
| 35 | /* |
| 36 | * Renders the view from a single specified camera directly to the full display. |
| 37 | */ |
| 38 | class RenderDirectView: public RenderBase { |
| 39 | public: |
Haoxiang Li | b21a13e | 2019-06-18 13:16:28 -0700 | [diff] [blame] | 40 | virtual bool activate() override; |
| 41 | virtual void deactivate() override; |
| 42 | |
Haoxiang Li | 1709b37 | 2019-09-18 15:08:52 -0700 | [diff] [blame] | 43 | virtual bool drawFrame(const BufferDesc& tgtBuffer, |
| 44 | const BufferDesc& imageBuffer) override; |
Haoxiang Li | b21a13e | 2019-06-18 13:16:28 -0700 | [diff] [blame] | 45 | |
| 46 | protected: |
Haoxiang Li | b21a13e | 2019-06-18 13:16:28 -0700 | [diff] [blame] | 47 | std::unique_ptr<VideoTex> mTexture; |
| 48 | |
| 49 | GLuint mShaderProgram = 0; |
| 50 | }; |
| 51 | |
Haoxiang Li | d2454a5 | 2019-06-18 13:23:12 -0700 | [diff] [blame] | 52 | } // namespace support |
| 53 | } // namespace evs |
| 54 | } // namespace automotive |
| 55 | } // namespace android |
Haoxiang Li | b21a13e | 2019-06-18 13:16:28 -0700 | [diff] [blame] | 56 | |
| 57 | #endif //CAR_EVS_APP_RENDERDIRECTVIEW_H |