a211c82c08bdff3c26fc8292d6aae593e2674c17
[platform/upstream/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_FUNC(trace_func,...)           \
45     if (trace_flag) {                           \
46         trace_func(__VA_ARGS__);                \
47     }
48 #define VA_TRACE_LOG(trace_func,...)            \
49     if (trace_flag & VA_TRACE_FLAG_LOG) {            \
50         trace_func(__VA_ARGS__);                \
51     }
52 #define VA_TRACE_SURFACE(trace_func,...)        \
53     if (trace_flag & (VA_TRACE_FLAG_SURFACE | VA_TRACE_FLAG_CODEDBUF)) {  \
54         trace_func(__VA_ARGS__);                \
55     }
56
57 void va_TraceInit(VADisplay dpy);
58 void va_TraceEnd(VADisplay dpy);
59
60 void va_TraceMsg(int idx, const char *msg, ...);
61
62 void va_TraceInitialize (
63     VADisplay dpy,
64     int *major_version,  /* out */
65     int *minor_version   /* out */
66 );
67
68 void va_TraceTerminate (
69     VADisplay dpy
70 );
71
72 void va_TraceCreateConfig(
73     VADisplay dpy,
74     VAProfile profile, 
75     VAEntrypoint entrypoint, 
76     VAConfigAttrib *attrib_list,
77     int num_attribs,
78     VAConfigID *config_id /* out */
79 );
80
81 void va_TraceCreateSurfaces(
82     VADisplay dpy,
83     int width,
84     int height,
85     int format,
86     int num_surfaces,
87     VASurfaceID *surfaces,      /* out */
88     VASurfaceAttrib    *attrib_list,
89     unsigned int        num_attribs
90 );
91
92 void va_TraceCreateContext(
93     VADisplay dpy,
94     VAConfigID config_id,
95     int picture_width,
96     int picture_height,
97     int flag,
98     VASurfaceID *render_targets,
99     int num_render_targets,
100     VAContextID *context                /* out */
101 );
102
103
104 void va_TraceMapBuffer (
105     VADisplay dpy,
106     VABufferID buf_id,  /* in */
107     void **pbuf         /* out */
108 );
109
110
111 void va_TraceBeginPicture(
112     VADisplay dpy,
113     VAContextID context,
114     VASurfaceID render_target
115 );
116
117 void va_TraceRenderPicture(
118     VADisplay dpy,
119     VAContextID context,
120     VABufferID *buffers,
121     int num_buffers
122 );
123
124 void va_TraceEndPicture(
125     VADisplay dpy,
126     VAContextID context,
127     int endpic_done
128 );
129
130 void va_TraceSyncSurface(
131     VADisplay dpy,
132     VASurfaceID render_target
133 );
134
135 void va_TraceQuerySurfaceStatus(
136     VADisplay dpy,
137     VASurfaceID render_target,
138     VASurfaceStatus *status     /* out */
139 );
140
141 void va_TraceQuerySurfaceError(
142         VADisplay dpy,
143         VASurfaceID surface,
144         VAStatus error_status,
145         void **error_info /*out*/
146 );
147
148
149 void va_TraceMaxNumDisplayAttributes (
150     VADisplay dpy,
151     int number
152 );
153
154 void va_TraceQueryDisplayAttributes (
155     VADisplay dpy,
156     VADisplayAttribute *attr_list,      /* out */
157     int *num_attributes                 /* out */
158 );
159
160 void va_TraceGetDisplayAttributes (
161     VADisplay dpy,
162     VADisplayAttribute *attr_list,
163     int num_attributes
164 );
165
166 void va_TraceSetDisplayAttributes (
167     VADisplay dpy,
168     VADisplayAttribute *attr_list,
169     int num_attributes
170 );
171
172 /* extern function called by display side */
173 void va_TracePutSurface (
174     VADisplay dpy,
175     VASurfaceID surface,
176     void *draw, /* the target Drawable */
177     short srcx,
178     short srcy,
179     unsigned short srcw,
180     unsigned short srch,
181     short destx,
182     short desty,
183     unsigned short destw,
184     unsigned short desth,
185     VARectangle *cliprects, /* client supplied clip list */
186     unsigned int number_cliprects, /* number of clip rects in the clip list */
187     unsigned int flags /* de-interlacing flags */
188 );
189
190 #ifdef __cplusplus
191 }
192 #endif
193     
194
195 #endif /* VA_TRACE_H */