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