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 #ifndef VIDEOTEX_H
17 #define VIDEOTEX_H
18 
19 #include <EGL/egl.h>
20 #include <EGL/eglext.h>
21 #include <GLES2/gl2.h>
22 #include <GLES2/gl2ext.h>
23 #include <GLES3/gl3.h>
24 #include <GLES3/gl3ext.h>
25 
26 #include <android/hardware/automotive/evs/1.0/IEvsEnumerator.h>
27 
28 #include "BaseRenderCallback.h"
29 #include "StreamHandler.h"
30 #include "TexWrapper.h"
31 
32 namespace android {
33 namespace automotive {
34 namespace evs {
35 namespace support {
36 
37 using namespace ::android::hardware::automotive::evs::V1_0;
38 
39 
40 class VideoTex: public TexWrapper {
41 public:
42     VideoTex() = delete;
43     VideoTex(EGLDisplay glDisplay);
44     virtual ~VideoTex();
45 
46     // returns true if the texture contents were updated
47     bool refresh(const BufferDesc& imageBuffer);
48 
49 private:
50     EGLDisplay          mDisplay;
51     EGLImageKHR mKHRimage = EGL_NO_IMAGE_KHR;
52 };
53 }  // namespace support
54 }  // namespace evs
55 }  // namespace automotive
56 }  // namespace android
57 
58 #endif  // VIDEOTEX_H
59