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 #include "ConfigManager.h" 21 #include "RenderBase.h" 22 #include "VideoTex.h" 23 24 #include <android/hardware/automotive/evs/1.0/IEvsEnumerator.h> 25 26 namespace android { 27 namespace automotive { 28 namespace evs { 29 namespace support { 30 31 using ::android::hardware::automotive::evs::V1_0::BufferDesc; 32 33 /* 34 * Renders the view from a single specified camera directly to the full display. 35 */ 36 class RenderDirectView : public RenderBase { 37 public: 38 virtual bool activate() override; 39 virtual void deactivate() override; 40 41 virtual bool drawFrame(const BufferDesc& tgtBuffer, const BufferDesc& imageBuffer) override; 42 43 protected: 44 std::unique_ptr<VideoTex> mTexture; 45 46 GLuint mShaderProgram = 0; 47 }; 48 49 } // namespace support 50 } // namespace evs 51 } // namespace automotive 52 } // namespace android 53 54 #endif // CAR_EVS_APP_RENDERDIRECTVIEW_H 55