|
Packit |
38d9dc |
/*
|
|
Packit |
38d9dc |
* va_wayland.h - Wayland API
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* Copyright (c) 2012 Intel Corporation. All Rights Reserved.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit |
38d9dc |
* copy of this software and associated documentation files (the
|
|
Packit |
38d9dc |
* "Software"), to deal in the Software without restriction, including
|
|
Packit |
38d9dc |
* without limitation the rights to use, copy, modify, merge, publish,
|
|
Packit |
38d9dc |
* distribute, sub license, and/or sell copies of the Software, and to
|
|
Packit |
38d9dc |
* permit persons to whom the Software is furnished to do so, subject to
|
|
Packit |
38d9dc |
* the following conditions:
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* The above copyright notice and this permission notice (including the
|
|
Packit |
38d9dc |
* next paragraph) shall be included in all copies or substantial portions
|
|
Packit |
38d9dc |
* of the Software.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
Packit |
38d9dc |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit |
38d9dc |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
Packit |
38d9dc |
* IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
Packit |
38d9dc |
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
Packit |
38d9dc |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
Packit |
38d9dc |
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit |
38d9dc |
*/
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
#ifndef VA_WAYLAND_H
|
|
Packit |
38d9dc |
#define VA_WAYLAND_H
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
#include <va/va.h>
|
|
Packit |
38d9dc |
#include <wayland-client.h>
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
/**
|
|
Packit |
38d9dc |
* \file va_wayland.h
|
|
Packit |
38d9dc |
* \brief The Wayland rendering API
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* This file contains the \ref api_wayland "Wayland rendering API".
|
|
Packit |
38d9dc |
*/
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
#ifdef __cplusplus
|
|
Packit |
38d9dc |
extern "C" {
|
|
Packit |
38d9dc |
#endif
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
/**
|
|
Packit |
38d9dc |
* \defgroup api_wayland Wayland rendering API
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* @{
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* Theory of operations:
|
|
Packit |
38d9dc |
* - Create a VA display for an active Wayland display ;
|
|
Packit |
38d9dc |
* - Perform normal VA-API operations, e.g. decode to a VA surface ;
|
|
Packit |
38d9dc |
* - Get wl_buffer associated to the VA surface ;
|
|
Packit |
38d9dc |
* - Attach wl_buffer to wl_surface ;
|
|
Packit |
38d9dc |
*/
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
/**
|
|
Packit |
38d9dc |
* \brief Returns a VA display wrapping the specified Wayland display.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* This functions returns a (possibly cached) VA display from the
|
|
Packit |
38d9dc |
* specified Wayland @display.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* @param[in] display the native Wayland display
|
|
Packit |
38d9dc |
* @return the VA display
|
|
Packit |
38d9dc |
*/
|
|
Packit |
38d9dc |
VADisplay
|
|
Packit |
38d9dc |
vaGetDisplayWl(struct wl_display *display);
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
/**
|
|
Packit |
38d9dc |
* \brief Returns the Wayland buffer associated with a VA surface.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* This function returns a wl_buffer handle that can be used as an
|
|
Packit |
38d9dc |
* argument to wl_surface_attach(). This buffer references the
|
|
Packit |
38d9dc |
* underlying VA @surface. As such, the VA @surface and Wayland
|
|
Packit |
38d9dc |
* @out_buffer have the same size and color format. Should specific
|
|
Packit |
38d9dc |
* color conversion be needed, then VA/VPP API can fulfill this
|
|
Packit |
38d9dc |
* purpose.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* The @flags describe the desired picture structure. This is useful
|
|
Packit |
38d9dc |
* to expose a de-interlaced buffer. If the VA driver does not support
|
|
Packit |
38d9dc |
* any of the supplied flags, then #VA_STATUS_ERROR_FLAG_NOT_SUPPORTED
|
|
Packit |
38d9dc |
* is returned. The following flags are allowed: \c VA_FRAME_PICTURE,
|
|
Packit |
38d9dc |
* \c VA_TOP_FIELD, \c VA_BOTTOM_FIELD.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* @param[in] dpy the VA display
|
|
Packit |
38d9dc |
* @param[in] surface the VA surface
|
|
Packit |
38d9dc |
* @param[in] flags the deinterlacing flags
|
|
Packit |
38d9dc |
* @param[out] out_buffer a wl_buffer wrapping the VA @surface
|
|
Packit |
38d9dc |
* @return VA_STATUS_SUCCESS if successful
|
|
Packit |
38d9dc |
*/
|
|
Packit |
38d9dc |
VAStatus
|
|
Packit |
38d9dc |
vaGetSurfaceBufferWl(
|
|
Packit |
38d9dc |
VADisplay dpy,
|
|
Packit |
38d9dc |
VASurfaceID surface,
|
|
Packit |
38d9dc |
unsigned int flags,
|
|
Packit |
38d9dc |
struct wl_buffer **out_buffer
|
|
Packit |
38d9dc |
);
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
/**
|
|
Packit |
38d9dc |
* \brief Returns the Wayland buffer associated with a VA image.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* This function returns a wl_buffer handle that can be used as an
|
|
Packit |
38d9dc |
* argument to wl_surface_attach(). This buffer references the
|
|
Packit |
38d9dc |
* underlying VA @image. As such, the VA @image and Wayland
|
|
Packit |
38d9dc |
* @out_buffer have the same size and color format. Should specific
|
|
Packit |
38d9dc |
* color conversion be needed, then VA/VPP API can fulfill this
|
|
Packit |
38d9dc |
* purpose.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* The @flags describe the desired picture structure. See
|
|
Packit |
38d9dc |
* vaGetSurfaceBufferWl() description for more details.
|
|
Packit |
38d9dc |
*
|
|
Packit |
38d9dc |
* @param[in] dpy the VA display
|
|
Packit |
38d9dc |
* @param[in] image the VA image
|
|
Packit |
38d9dc |
* @param[in] flags the deinterlacing flags
|
|
Packit |
38d9dc |
* @param[out] out_buffer a wl_buffer wrapping the VA @image
|
|
Packit |
38d9dc |
* @return VA_STATUS_SUCCESS if successful
|
|
Packit |
38d9dc |
*/
|
|
Packit |
38d9dc |
VAStatus
|
|
Packit |
38d9dc |
vaGetImageBufferWl(
|
|
Packit |
38d9dc |
VADisplay dpy,
|
|
Packit |
38d9dc |
VAImageID image,
|
|
Packit |
38d9dc |
unsigned int flags,
|
|
Packit |
38d9dc |
struct wl_buffer **out_buffer
|
|
Packit |
38d9dc |
);
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
/**@}*/
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
#ifdef __cplusplus
|
|
Packit |
38d9dc |
}
|
|
Packit |
38d9dc |
#endif
|
|
Packit |
38d9dc |
|
|
Packit |
38d9dc |
#endif /* VA_WAYLAND_H */
|