qeglstreamconvenience.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/eglconvenience/qeglstreamconvenience.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2015 The Qt Company Ltd.-
4** Contact: http://www.qt.io/licensing/-
5**-
6** This file is part of the plugins of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL21$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see http://www.qt.io/terms-conditions. For further-
15** information use the contact form at http://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 2.1 or version 3 as published by the Free-
20** Software Foundation and appearing in the file LICENSE.LGPLv21 and-
21** LICENSE.LGPLv3 included in the packaging of this file. Please review the-
22** following information to ensure the GNU Lesser General Public License-
23** requirements will be met: https://www.gnu.org/licenses/lgpl.html and-
24** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.-
25**-
26** As a special exception, The Qt Company gives you certain additional-
27** rights. These rights are described in The Qt Company LGPL Exception-
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.-
29**-
30** $QT_END_LICENSE$-
31**-
32****************************************************************************/-
33-
34#include "qeglstreamconvenience_p.h"-
35#include <string.h>-
36-
37QT_BEGIN_NAMESPACE-
38-
39QEGLStreamConvenience::QEGLStreamConvenience()-
40 : initialized(false),-
41 has_egl_platform_device(false),-
42 has_egl_device_base(false),-
43 has_egl_stream(false),-
44 has_egl_stream_producer_eglsurface(false),-
45 has_egl_stream_consumer_egloutput(false),-
46 has_egl_output_drm(false),-
47 has_egl_output_base(false),-
48 has_egl_stream_cross_process_fd(false),-
49 has_egl_stream_consumer_gltexture(false)-
50{-
51 const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);-
52 if (!extensions) {
!extensionsDescription
TRUEnever evaluated
FALSEnever evaluated
0
53 qWarning("Failed to query EGL extensions");-
54 return;
never executed: return;
0
55 }-
56-
57 query_devices = reinterpret_cast<PFNEGLQUERYDEVICESEXTPROC>(eglGetProcAddress("eglQueryDevicesEXT"));-
58 query_device_string = reinterpret_cast<PFNEGLQUERYDEVICESTRINGEXTPROC>(eglGetProcAddress("eglQueryDeviceStringEXT"));-
59 get_platform_display = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));-
60-
61 has_egl_device_base = strstr(extensions, "EGL_EXT_device_base");-
62 has_egl_platform_device = strstr(extensions, "EGL_EXT_platform_device");-
63}
never executed: end of block
0
64-
65void QEGLStreamConvenience::initialize(EGLDisplay dpy)-
66{-
67 if (initialized)
initializedDescription
TRUEnever evaluated
FALSEnever evaluated
0
68 return;
never executed: return;
0
69-
70 if (!eglBindAPI(EGL_OPENGL_ES_API)) {
!eglBindAPI(0x30A0)Description
TRUEnever evaluated
FALSEnever evaluated
0
71 qWarning("Failed to bind OpenGL ES API");-
72 return;
never executed: return;
0
73 }-
74-
75 const char *extensions = eglQueryString(dpy, EGL_EXTENSIONS);-
76 if (!extensions) {
!extensionsDescription
TRUEnever evaluated
FALSEnever evaluated
0
77 qWarning("Failed to query EGL extensions");-
78 return;
never executed: return;
0
79 }-
80-
81 create_stream = reinterpret_cast<PFNEGLCREATESTREAMKHRPROC>(eglGetProcAddress("eglCreateStreamKHR"));-
82 destroy_stream = reinterpret_cast<PFNEGLDESTROYSTREAMKHRPROC>(eglGetProcAddress("eglDestroyStreamKHR"));-
83 stream_attrib = reinterpret_cast<PFNEGLSTREAMATTRIBKHRPROC>(eglGetProcAddress("eglStreamAttribKHR"));-
84 query_stream = reinterpret_cast<PFNEGLQUERYSTREAMKHRPROC>(eglGetProcAddress("eglQueryStreamKHR"));-
85 query_stream_u64 = reinterpret_cast<PFNEGLQUERYSTREAMU64KHRPROC>(eglGetProcAddress("eglQueryStreamu64KHR"));-
86 create_stream_producer_surface = reinterpret_cast<PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC>(eglGetProcAddress("eglCreateStreamProducerSurfaceKHR"));-
87 stream_consumer_output = reinterpret_cast<PFNEGLSTREAMCONSUMEROUTPUTEXTPROC>(eglGetProcAddress("eglStreamConsumerOutputEXT"));-
88 get_output_layers = reinterpret_cast<PFNEGLGETOUTPUTLAYERSEXTPROC>(eglGetProcAddress("eglGetOutputLayersEXT"));-
89 get_output_ports = reinterpret_cast<PFNEGLGETOUTPUTPORTSEXTPROC>(eglGetProcAddress("eglGetOutputPortsEXT"));-
90 output_layer_attrib = reinterpret_cast<PFNEGLOUTPUTLAYERATTRIBEXTPROC>(eglGetProcAddress("eglOutputLayerAttribEXT"));-
91 query_output_layer_attrib = reinterpret_cast<PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC>(eglGetProcAddress("eglQueryOutputLayerAttribEXT"));-
92 query_output_layer_string = reinterpret_cast<PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC>(eglGetProcAddress("eglQueryOutputLayerStringEXT"));-
93 query_output_port_attrib = reinterpret_cast<PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC>(eglGetProcAddress("eglQueryOutputPortAttribEXT"));-
94 query_output_port_string = reinterpret_cast<PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC>(eglGetProcAddress("eglQueryOutputPortStringEXT"));-
95 get_stream_file_descriptor = reinterpret_cast<PFNEGLGETSTREAMFILEDESCRIPTORKHRPROC>(eglGetProcAddress("eglGetStreamFileDescriptorKHR"));-
96 create_stream_from_file_descriptor = reinterpret_cast<PFNEGLCREATESTREAMFROMFILEDESCRIPTORKHRPROC>(eglGetProcAddress("eglCreateStreamFromFileDescriptorKHR"));-
97 stream_consumer_gltexture = reinterpret_cast<PFNEGLSTREAMCONSUMERGLTEXTUREEXTERNALKHRPROC>(eglGetProcAddress("eglStreamConsumerGLTextureExternalKHR"));-
98 stream_consumer_acquire = reinterpret_cast<PFNEGLSTREAMCONSUMERACQUIREKHRPROC>(eglGetProcAddress("eglStreamConsumerAcquireKHR"));-
99 stream_consumer_release = reinterpret_cast<PFNEGLSTREAMCONSUMERRELEASEKHRPROC>(eglGetProcAddress("eglStreamConsumerReleaseKHR"));-
100-
101 has_egl_stream = strstr(extensions, "EGL_KHR_stream");-
102 has_egl_stream_producer_eglsurface = strstr(extensions, "EGL_KHR_stream_producer_eglsurface");-
103 has_egl_stream_consumer_egloutput = strstr(extensions, "EGL_EXT_stream_consumer_egloutput");-
104 has_egl_output_drm = strstr(extensions, "EGL_EXT_output_drm");-
105 has_egl_output_base = strstr(extensions, "EGL_EXT_output_base");-
106 has_egl_stream_cross_process_fd = strstr(extensions, "EGL_KHR_stream_cross_process_fd");-
107 has_egl_stream_consumer_gltexture = strstr(extensions, "EGL_KHR_stream_consumer_gltexture");-
108-
109 initialized = true;-
110}
never executed: end of block
0
111-
112QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9