|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit Service |
f6fdc3 |
* copy of this software and associated documentation files (the "Software"),
|
|
Packit Service |
f6fdc3 |
* to deal in the Software without restriction, including without limitation
|
|
Packit Service |
f6fdc3 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
Packit Service |
f6fdc3 |
* and/or sell copies of the Software, and to permit persons to whom the
|
|
Packit Service |
f6fdc3 |
* Software is furnished to do so, subject to the following conditions:
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* The above copyright notice and this permission notice shall be included in
|
|
Packit Service |
f6fdc3 |
* all copies or substantial portions of the Software.
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit Service |
f6fdc3 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit Service |
f6fdc3 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
Packit Service |
f6fdc3 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
Packit Service |
f6fdc3 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
Packit Service |
f6fdc3 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
Packit Service |
f6fdc3 |
* DEALINGS IN THE SOFTWARE.
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
#ifndef WAYLAND_EGLSTREAM_SERVER_H
|
|
Packit Service |
f6fdc3 |
#define WAYLAND_EGLSTREAM_SERVER_H
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
#include <wayland-server-protocol.h>
|
|
Packit Service |
f6fdc3 |
#include <EGL/egl.h>
|
|
Packit Service |
f6fdc3 |
#include <EGL/eglext.h>
|
|
Packit Service |
f6fdc3 |
#include "wayland-eglhandle.h"
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
#ifdef __cplusplus
|
|
Packit Service |
f6fdc3 |
extern "C" {
|
|
Packit Service |
f6fdc3 |
#endif
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* Forward declarations
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream_display;
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* wl_eglstream_display_bind()
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* Creates and initializes a wl_eglstream_display connection associated to the
|
|
Packit Service |
f6fdc3 |
* given wl_display and EGLDisplay.
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
EGLBoolean
|
|
Packit Service |
f6fdc3 |
wl_eglstream_display_bind(WlEglPlatformData *data,
|
|
Packit Service |
f6fdc3 |
struct wl_display *wlDisplay,
|
|
Packit Service |
f6fdc3 |
EGLDisplay eglDisplay);
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* wl_eglstream_display_unbind()
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* Destroys the given wl_eglstream_display connection result of a previous
|
|
Packit Service |
f6fdc3 |
* wl_eglstream_display_bind() call.
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
void wl_eglstream_display_unbind(struct wl_eglstream_display *wlStreamDpy);
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* wl_eglstream_display_get()
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* Given an EGL display, returns its associated wl_eglstream_display connection.
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream_display* wl_eglstream_display_get(EGLDisplay eglDisplay);
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* wl_eglstream_display_get_stream()
|
|
Packit Service |
f6fdc3 |
*
|
|
Packit Service |
f6fdc3 |
* Given a generic wl_resource, returns its associated wl_eglstream.
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream*
|
|
Packit Service |
f6fdc3 |
wl_eglstream_display_get_stream(struct wl_eglstream_display *wlStreamDpy,
|
|
Packit Service |
f6fdc3 |
struct wl_resource *resource);
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/* wl_eglstream_display definition */
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream_display {
|
|
Packit Service |
f6fdc3 |
WlEglPlatformData *data;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
struct wl_global *global;
|
|
Packit Service |
f6fdc3 |
struct wl_display *wlDisplay;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
EGLDisplay eglDisplay;
|
|
Packit Service |
f6fdc3 |
struct {
|
|
Packit Service |
f6fdc3 |
int stream_attrib : 1;
|
|
Packit Service |
f6fdc3 |
int stream_cross_process_fd : 1;
|
|
Packit Service |
f6fdc3 |
int stream_remote : 1;
|
|
Packit Service |
f6fdc3 |
int stream_socket : 1;
|
|
Packit Service |
f6fdc3 |
int stream_socket_inet : 1;
|
|
Packit Service |
f6fdc3 |
int stream_socket_unix : 1;
|
|
Packit Service |
f6fdc3 |
int stream_origin : 1;
|
|
Packit Service |
f6fdc3 |
} exts;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
int caps_override : 1;
|
|
Packit Service |
f6fdc3 |
int supported_caps;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
struct wl_buffer_interface wl_eglstream_interface;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
struct wl_list link;
|
|
Packit Service |
f6fdc3 |
};
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/* wl_eglstream definition */
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream {
|
|
Packit Service |
f6fdc3 |
struct wl_resource *resource;
|
|
Packit Service |
f6fdc3 |
struct wl_eglstream_display *wlStreamDpy;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
int width, height;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
EGLBoolean fromFd;
|
|
Packit Service |
f6fdc3 |
EGLBoolean isInet;
|
|
Packit Service |
f6fdc3 |
int handle;
|
|
Packit Service |
f6fdc3 |
EGLStreamKHR eglStream;
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
/*
|
|
Packit Service |
f6fdc3 |
* The following attribute encodes the default value for a
|
|
Packit Service |
f6fdc3 |
* stream's image inversion relative to wayland protocol
|
|
Packit Service |
f6fdc3 |
* convention. Vulkan apps will be set to 'true', while
|
|
Packit Service |
f6fdc3 |
* OpenGL apps will be set to 'false'.
|
|
Packit Service |
f6fdc3 |
* NOTE: EGL_NV_stream_origin is the authorative source of
|
|
Packit Service |
f6fdc3 |
* truth regarding a stream's frame orientation and should be
|
|
Packit Service |
f6fdc3 |
* queried for an accurate value. The following attribute is a
|
|
Packit Service |
f6fdc3 |
* 'best guess' fallback mechanism which should only be used
|
|
Packit Service |
f6fdc3 |
* when a query to EGL_NV_stream_origin fails.
|
|
Packit Service |
f6fdc3 |
*/
|
|
Packit Service |
f6fdc3 |
EGLBoolean yInverted;
|
|
Packit Service |
f6fdc3 |
};
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
#ifdef __cplusplus
|
|
Packit Service |
f6fdc3 |
}
|
|
Packit Service |
f6fdc3 |
#endif
|
|
Packit Service |
f6fdc3 |
|
|
Packit Service |
f6fdc3 |
#endif
|