Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | #include "qeglstreamconvenience_p.h" | - |
41 | #include <string.h> | - |
42 | | - |
43 | QT_BEGIN_NAMESPACE | - |
44 | | - |
45 | QEGLStreamConvenience::QEGLStreamConvenience() | - |
46 | : initialized(false), | - |
47 | has_egl_platform_device(false), | - |
48 | has_egl_device_base(false), | - |
49 | has_egl_stream(false), | - |
50 | has_egl_stream_producer_eglsurface(false), | - |
51 | has_egl_stream_consumer_egloutput(false), | - |
52 | has_egl_output_drm(false), | - |
53 | has_egl_output_base(false), | - |
54 | has_egl_stream_cross_process_fd(false), | - |
55 | has_egl_stream_consumer_gltexture(false) | - |
56 | { | - |
57 | const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); | - |
58 | if (!extensions) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
59 | qWarning("Failed to query EGL extensions"); | - |
60 | return; never executed: return; | 0 |
61 | } | - |
62 | | - |
63 | query_devices = reinterpret_cast<PFNEGLQUERYDEVICESEXTPROC>(eglGetProcAddress("eglQueryDevicesEXT")); | - |
64 | query_device_string = reinterpret_cast<PFNEGLQUERYDEVICESTRINGEXTPROC>(eglGetProcAddress("eglQueryDeviceStringEXT")); | - |
65 | get_platform_display = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT")); | - |
66 | | - |
67 | has_egl_device_base = strstr(extensions, "EGL_EXT_device_base"); | - |
68 | has_egl_platform_device = strstr(extensions, "EGL_EXT_platform_device"); | - |
69 | } never executed: end of block | 0 |
70 | | - |
71 | void QEGLStreamConvenience::initialize(EGLDisplay dpy) | - |
72 | { | - |
73 | if (initialized)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
74 | return; never executed: return; | 0 |
75 | | - |
76 | if (!eglBindAPI(EGL_OPENGL_ES_API)) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
77 | qWarning("Failed to bind OpenGL ES API"); | - |
78 | return; never executed: return; | 0 |
79 | } | - |
80 | | - |
81 | const char *extensions = eglQueryString(dpy, EGL_EXTENSIONS); | - |
82 | if (!extensions) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
83 | qWarning("Failed to query EGL extensions"); | - |
84 | return; never executed: return; | 0 |
85 | } | - |
86 | | - |
87 | create_stream = reinterpret_cast<PFNEGLCREATESTREAMKHRPROC>(eglGetProcAddress("eglCreateStreamKHR")); | - |
88 | destroy_stream = reinterpret_cast<PFNEGLDESTROYSTREAMKHRPROC>(eglGetProcAddress("eglDestroyStreamKHR")); | - |
89 | stream_attrib = reinterpret_cast<PFNEGLSTREAMATTRIBKHRPROC>(eglGetProcAddress("eglStreamAttribKHR")); | - |
90 | query_stream = reinterpret_cast<PFNEGLQUERYSTREAMKHRPROC>(eglGetProcAddress("eglQueryStreamKHR")); | - |
91 | query_stream_u64 = reinterpret_cast<PFNEGLQUERYSTREAMU64KHRPROC>(eglGetProcAddress("eglQueryStreamu64KHR")); | - |
92 | create_stream_producer_surface = reinterpret_cast<PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC>(eglGetProcAddress("eglCreateStreamProducerSurfaceKHR")); | - |
93 | stream_consumer_output = reinterpret_cast<PFNEGLSTREAMCONSUMEROUTPUTEXTPROC>(eglGetProcAddress("eglStreamConsumerOutputEXT")); | - |
94 | get_output_layers = reinterpret_cast<PFNEGLGETOUTPUTLAYERSEXTPROC>(eglGetProcAddress("eglGetOutputLayersEXT")); | - |
95 | get_output_ports = reinterpret_cast<PFNEGLGETOUTPUTPORTSEXTPROC>(eglGetProcAddress("eglGetOutputPortsEXT")); | - |
96 | output_layer_attrib = reinterpret_cast<PFNEGLOUTPUTLAYERATTRIBEXTPROC>(eglGetProcAddress("eglOutputLayerAttribEXT")); | - |
97 | query_output_layer_attrib = reinterpret_cast<PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC>(eglGetProcAddress("eglQueryOutputLayerAttribEXT")); | - |
98 | query_output_layer_string = reinterpret_cast<PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC>(eglGetProcAddress("eglQueryOutputLayerStringEXT")); | - |
99 | query_output_port_attrib = reinterpret_cast<PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC>(eglGetProcAddress("eglQueryOutputPortAttribEXT")); | - |
100 | query_output_port_string = reinterpret_cast<PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC>(eglGetProcAddress("eglQueryOutputPortStringEXT")); | - |
101 | get_stream_file_descriptor = reinterpret_cast<PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC>(eglGetProcAddress("eglGetStreamFileDescriptorKHR")); | - |
102 | create_stream_from_file_descriptor = reinterpret_cast<PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC>(eglGetProcAddress("eglCreateStreamFromFileDescriptorKHR")); | - |
103 | stream_consumer_gltexture = reinterpret_cast<PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC>(eglGetProcAddress("eglStreamConsumerGLTextureExternalKHR")); | - |
104 | stream_consumer_acquire = reinterpret_cast<PFNEGLSTREAMCONSUMERACQUIREKHRPROC>(eglGetProcAddress("eglStreamConsumerAcquireKHR")); | - |
105 | stream_consumer_release = reinterpret_cast<PFNEGLSTREAMCONSUMERRELEASEKHRPROC>(eglGetProcAddress("eglStreamConsumerReleaseKHR")); | - |
106 | | - |
107 | has_egl_stream = strstr(extensions, "EGL_KHR_stream"); | - |
108 | has_egl_stream_producer_eglsurface = strstr(extensions, "EGL_KHR_stream_producer_eglsurface"); | - |
109 | has_egl_stream_consumer_egloutput = strstr(extensions, "EGL_EXT_stream_consumer_egloutput"); | - |
110 | has_egl_output_drm = strstr(extensions, "EGL_EXT_output_drm"); | - |
111 | has_egl_output_base = strstr(extensions, "EGL_EXT_output_base"); | - |
112 | has_egl_stream_cross_process_fd = strstr(extensions, "EGL_KHR_stream_cross_process_fd"); | - |
113 | has_egl_stream_consumer_gltexture = strstr(extensions, "EGL_KHR_stream_consumer_gltexture"); | - |
114 | | - |
115 | initialized = true; | - |
116 | } never executed: end of block | 0 |
117 | | - |
118 | QT_END_NAMESPACE | - |
| | |