vdpau_x11.h 6.1 KB
Newer Older
Aaron Plattner's avatar
Aaron Plattner committed
1
2
3
4
5
6
7
8
/*
 * This source file is documented using Doxygen markup.
 * See http://www.stack.nl/~dimitri/doxygen/
 */

/*
 * This copyright notice applies to this header file:
 *
9
 * Copyright (c) 2008-2009 NVIDIA Corporation
10
 *
Aaron Plattner's avatar
Aaron Plattner committed
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
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

/**
 * \file vdpau_x11.h
 * \brief X11 Window System Integration Layer
36
37
38
39
40
 *
 * This file contains the \ref api_winsys_x11 "X11 Window System
 * Integration Layer".
 */

Aaron Plattner's avatar
Aaron Plattner committed
41
42
43
44
45
46
47
48
49
50
51
#ifndef _VDPAU_X11_H
#define _VDPAU_X11_H

#include <X11/Xlib.h>
#include "vdpau.h"

#ifdef __cplusplus
extern "C" {
#endif

/**
52
53
 * \ingroup api_winsys
 * @{
Aaron Plattner's avatar
Aaron Plattner committed
54
55
56
57
 */

/**
 * \defgroup api_winsys_x11 X11 Window System Integration Layer
58
59
 *
 * The set of VDPAU functionality specific to usage with the X
Aaron Plattner's avatar
Aaron Plattner committed
60
 * Window System.
61
62
63
64
65
66
67
 *
 * \section Driver Library Layout
 *
 * An X11-oriented VDPAU installation consists of the following
 * components:
 *
 * - Header files. These files are located in the standard
Aaron Plattner's avatar
Aaron Plattner committed
68
69
70
 *   system header file path.
 *   - \c vdpau/vdpau.h
 *   - \c vdpau/vdpau_x11.h
71
 * - The VDPAU wrapper library. These files are located in the
Aaron Plattner's avatar
Aaron Plattner committed
72
73
74
 *   standard system (possibly X11-specific) library path.
 *   - \c libvdpau.so.1 (runtime)
 *   - \c libvdpau.so (development)
75
76
77
78
79
 * - Back-end driver files. These files are located in a
 *   system-defined library path, which is configurable at compile
 *   time but is typically /usr/lib/vdpau.  Use `pkg-config
 *   --variable=moduledir vdpau` to locate the driver install path.
 *   - \c $moduledir/libvdpau_\%s.so.1
Aaron Plattner's avatar
Aaron Plattner committed
80
 *   For example:
81
82
83
 *   - \c /usr/lib/vdpau/libvdpau_nvidia.so.1
 *   - \c /usr/lib/vdpau/libvdpau_intel.so.1
 *   - \c /usr/lib/vdpau/libvdpau_ati.so.1
84
85
86
87
 *
 * The VDPAU wrapper library implements just one function; \ref
 * vdp_device_create_x11. The wrapper will implement this function
 * by dynamically loading the appropriate back-end driver file
Aaron Plattner's avatar
Aaron Plattner committed
88
89
90
 * mentioned above. Long-term, the wrapper will use a
 * VDPAU-specific X  extension to determine which back-end driver
 * to load. Currently, the wrapper library hard-codes the driver
91
 * name as "nvidia", although this can be overridden using the
Aaron Plattner's avatar
Aaron Plattner committed
92
93
 * environment variable VDPAU_DRIVER.
 *
94
 * The back-end driver is expected to implement a function named
Aaron Plattner's avatar
Aaron Plattner committed
95
 * \b vdp_imp_device_create_x11. The wrapper will call this function to
96
97
98
99
100
101
102
103
 * actually implement the \ref vdp_device_create_x11 application call.
 *
 * Note that it is theoretically possible for an application to
 * create multiple \ref VdpDevice "VdpDevice" objects. In this
 * case, the wrapper library may load multiple back-end drivers
 * into the same application, and/or invoke a specific back-end
 * driver's \b VdpImpDeviceCreateX11 multiple times. The wrapper
 * libray imposes no policy regarding whether the application
Aaron Plattner's avatar
Aaron Plattner committed
104
 * may instantiate multiple \ref VdpDevice "VdpDevice" objects for
105
106
107
108
109
 * the same display and/or screen. However, back-end drivers are
 * free to limit the number of \ref VdpDevice "VdpDevice" objects
 * as required by their implementation.
 *
 * @{
Aaron Plattner's avatar
Aaron Plattner committed
110
111
 */

112
113
/**
 * \brief Create a VdpDevice object for use with X11.
Aaron Plattner's avatar
Aaron Plattner committed
114
115
 * \param[in] display The X Display that the VdpDevice VdpDevice
 *       will operate against.
116
 * \param[in] screen The X screen that the VdpDevice will operate
Aaron Plattner's avatar
Aaron Plattner committed
117
 *       against.
118
119
 * \param[out] device The new device's handle.
 * \param[out] get_proc_address The get_proc_address entry point
Aaron Plattner's avatar
Aaron Plattner committed
120
 *       to use with this device.
121
 * \return VdpStatus The completion status of the operation.
Aaron Plattner's avatar
Aaron Plattner committed
122
123
124
125
126
127
128
129
130
 */
typedef VdpStatus VdpDeviceCreateX11(
    Display *             display,
    int                   screen,
    /* output parameters follow */
    VdpDevice *           device,
    VdpGetProcAddress * * get_proc_address
);

131
132
/**
 * \brief Create a VdpDevice object for use with X11.
Aaron Plattner's avatar
Aaron Plattner committed
133
 * This is an actual symbol of type \ref VdpDeviceCreateX11
134
 *
Aaron Plattner's avatar
Aaron Plattner committed
135
136
137
 */
VdpDeviceCreateX11 vdp_device_create_x11;

138
/**
Aaron Plattner's avatar
Aaron Plattner committed
139
 * \brief Create a VdpPresentationQueueTarget for use with X11.
140
 * \param[in] device The device that will contain the queue
Aaron Plattner's avatar
Aaron Plattner committed
141
 *       target.
142
 * \param[in] drawable The X11 Drawable that the presentation
Aaron Plattner's avatar
Aaron Plattner committed
143
 *       queue will present into.
144
145
 * \param[out] target The new queue target's handle.
 * \return VdpStatus The completion status of the operation.
Aaron Plattner's avatar
Aaron Plattner committed
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
 *
 * Note: VDPAU expects to own the entire drawable for the duration of time
 * that the presentation queue target exists. In particular,
 * implementations may choose to manipulate client-visible X11 window state
 * as required. As such, it is recommended that applications create a
 * dedicated window for the presentation queue target, as a child
 * (grand-child, ...) of their top-level application window.
 *
 * Applications may also create child-windows of the presentation queue
 * target, which will cover any presented video in the normal fashion. VDPAU
 * implementations will not manipulate such child windows in any fashion.
 */
typedef VdpStatus VdpPresentationQueueTargetCreateX11(
    VdpDevice                   device,
    Drawable                    drawable,
    /* output parameters follow */
    VdpPresentationQueueTarget * target
);

/** \hideinitializer */
#define VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 (VdpFuncId)(VDP_FUNC_ID_BASE_WINSYS + 0)

/*@}*/
/*@}*/

#ifdef __cplusplus
}
#endif

#endif