OSDN Git Service

add the support of multiple context tracing
[android-x86/hardware-intel-common-libva.git] / va / va_trace.h
1 /*
2  * Copyright (c) 2009 Intel Corporation. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24
25 #ifndef VA_TRACE_H
26 #define VA_TRACE_H
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 extern int trace_flag;
33
34 #define VA_TRACE_FLAG_LOG             0x1
35 #define VA_TRACE_FLAG_BUFDATA         0x2
36 #define VA_TRACE_FLAG_CODEDBUF        0x4
37 #define VA_TRACE_FLAG_SURFACE_DECODE  0x8
38 #define VA_TRACE_FLAG_SURFACE_ENCODE  0x10
39 #define VA_TRACE_FLAG_SURFACE_JPEG    0x20
40 #define VA_TRACE_FLAG_SURFACE         (VA_TRACE_FLAG_SURFACE_DECODE | \
41                                        VA_TRACE_FLAG_SURFACE_ENCODE | \
42                                        VA_TRACE_FLAG_SURFACE_JPEG)
43
44 #define VA_TRACE_LOG(trace_func,...)            \
45     if (trace_flag & VA_TRACE_FLAG_LOG) {       \
46         trace_func(__VA_ARGS__);                \
47     }
48 #define VA_TRACE_ALL(trace_func,...)            \
49     if (trace_flag) {                           \
50         trace_func(__VA_ARGS__);                \
51     }
52
53 DLL_HIDDEN
54 void va_TraceInit(VADisplay dpy);
55 DLL_HIDDEN
56 void va_TraceEnd(VADisplay dpy);
57
58 DLL_HIDDEN
59 void va_TraceInitialize (
60     VADisplay dpy,
61     int *major_version,  /* out */
62     int *minor_version   /* out */
63 );
64
65 DLL_HIDDEN
66 void va_TraceTerminate (
67     VADisplay dpy
68 );
69
70 DLL_HIDDEN
71 void va_TraceCreateConfig(
72     VADisplay dpy,
73     VAProfile profile, 
74     VAEntrypoint entrypoint, 
75     VAConfigAttrib *attrib_list,
76     int num_attribs,
77     VAConfigID *config_id /* out */
78 );
79
80 DLL_HIDDEN
81 void va_TraceDestroyConfig (
82     VADisplay dpy,
83     VAConfigID config_id
84 );
85
86 DLL_HIDDEN
87 void va_TraceCreateSurfaces(
88     VADisplay dpy,
89     int width,
90     int height,
91     int format,
92     int num_surfaces,
93     VASurfaceID *surfaces,      /* out */
94     VASurfaceAttrib    *attrib_list,
95     unsigned int        num_attribs
96 );
97
98 DLL_HIDDEN
99 void va_TraceDestroySurfaces(
100     VADisplay dpy,
101     VASurfaceID *surface_list,
102     int num_surfaces
103 );
104
105 DLL_HIDDEN
106 void va_TraceCreateContext(
107     VADisplay dpy,
108     VAConfigID config_id,
109     int picture_width,
110     int picture_height,
111     int flag,
112     VASurfaceID *render_targets,
113     int num_render_targets,
114     VAContextID *context                /* out */
115 );
116
117 DLL_HIDDEN
118 void va_TraceDestroyContext (
119     VADisplay dpy,
120     VAContextID context
121 );
122
123 DLL_HIDDEN
124 void va_TraceCreateBuffer (
125     VADisplay dpy,
126     VAContextID context,        /* in */
127     VABufferType type,          /* in */
128     unsigned int size,          /* in */
129     unsigned int num_elements,  /* in */
130     void *data,                 /* in */
131     VABufferID *buf_id          /* out */
132 );
133
134 DLL_HIDDEN
135 void va_TraceDestroyBuffer (
136     VADisplay dpy,
137     VABufferID buf_id    /* in */
138 );
139
140 DLL_HIDDEN
141 void va_TraceMapBuffer (
142     VADisplay dpy,
143     VABufferID buf_id,  /* in */
144     void **pbuf         /* out */
145 );
146
147
148 DLL_HIDDEN
149 void va_TraceBeginPicture(
150     VADisplay dpy,
151     VAContextID context,
152     VASurfaceID render_target
153 );
154
155 DLL_HIDDEN
156 void va_TraceRenderPicture(
157     VADisplay dpy,
158     VAContextID context,
159     VABufferID *buffers,
160     int num_buffers
161 );
162
163 DLL_HIDDEN
164 void va_TraceEndPicture(
165     VADisplay dpy,
166     VAContextID context,
167     int endpic_done
168 );
169
170 DLL_HIDDEN
171 void va_TraceSyncSurface(
172     VADisplay dpy,
173     VASurfaceID render_target
174 );
175
176 DLL_HIDDEN
177 void va_TraceQuerySurfaceAttributes(
178     VADisplay           dpy,
179     VAConfigID          config,
180     VASurfaceAttrib    *attrib_list,
181     unsigned int       *num_attribs
182 );
183
184 DLL_HIDDEN
185 void va_TraceQuerySurfaceStatus(
186     VADisplay dpy,
187     VASurfaceID render_target,
188     VASurfaceStatus *status     /* out */
189 );
190
191 DLL_HIDDEN
192 void va_TraceQuerySurfaceError(
193         VADisplay dpy,
194         VASurfaceID surface,
195         VAStatus error_status,
196         void **error_info /*out*/
197 );
198
199
200 DLL_HIDDEN
201 void va_TraceMaxNumDisplayAttributes (
202     VADisplay dpy,
203     int number
204 );
205
206 DLL_HIDDEN
207 void va_TraceQueryDisplayAttributes (
208     VADisplay dpy,
209     VADisplayAttribute *attr_list,      /* out */
210     int *num_attributes                 /* out */
211 );
212
213 DLL_HIDDEN
214 void va_TraceGetDisplayAttributes (
215     VADisplay dpy,
216     VADisplayAttribute *attr_list,
217     int num_attributes
218 );
219
220 DLL_HIDDEN
221 void va_TraceSetDisplayAttributes (
222     VADisplay dpy,
223     VADisplayAttribute *attr_list,
224     int num_attributes
225 );
226
227 /* extern function called by display side */
228 void va_TracePutSurface (
229     VADisplay dpy,
230     VASurfaceID surface,
231     void *draw, /* the target Drawable */
232     short srcx,
233     short srcy,
234     unsigned short srcw,
235     unsigned short srch,
236     short destx,
237     short desty,
238     unsigned short destw,
239     unsigned short desth,
240     VARectangle *cliprects, /* client supplied clip list */
241     unsigned int number_cliprects, /* number of clip rects in the clip list */
242     unsigned int flags /* de-interlacing flags */
243 );
244
245 #ifdef __cplusplus
246 }
247 #endif
248     
249
250 #endif /* VA_TRACE_H */