hardware/intel/common/libva
Revision | b4d0874dcbe99d1f47bd39d0c156ea89ecd0ebcc (tree) |
---|---|
Time | 2017-06-12 14:55:40 |
Author | Giuseppe <giuscri@gmai...> |
Commiter | Xiang, Haihao |
Add va_MessagingInit().
Previous to this commit, changing verbosity level
was only possible at build time via the definition
of ENABLE_VA_MESSAGING.
Now it's possible to choose a verbosity level between
{0, 1, 2} by modifying /etc/libva.conf or by setting
the corresponding environment variable LIBVA_MESSAGING_LEVEL.
Signed-off-by: Giuseppe <giuscri@gmail.com>
@@ -159,6 +159,24 @@ vaMessageCallback vaSetInfoCallback(vaMessageCallback callback) | ||
159 | 159 | return old_callback; |
160 | 160 | } |
161 | 161 | |
162 | +void va_MessagingInit() | |
163 | +{ | |
164 | +#if ENABLE_VA_MESSAGING | |
165 | + char env_value[1024]; | |
166 | + | |
167 | + if (va_parseConfig("LIBVA_MESSAGING_LEVEL", &env_value[0]) == 0) { | |
168 | + if (strcmp(env_value, "0") == 0) { | |
169 | + vaSetInfoCallback(NULL); | |
170 | + vaSetErrorCallback(NULL); | |
171 | + } | |
172 | + | |
173 | + if (strcmp(env_value, "1") == 0) { | |
174 | + vaSetInfoCallback(NULL); | |
175 | + } | |
176 | + } | |
177 | +#endif | |
178 | +} | |
179 | + | |
162 | 180 | void va_errorMessage(const char *msg, ...) |
163 | 181 | { |
164 | 182 | #if ENABLE_VA_MESSAGING |
@@ -591,6 +609,8 @@ VAStatus vaInitialize ( | ||
591 | 609 | |
592 | 610 | va_FoolInit(dpy); |
593 | 611 | |
612 | + va_MessagingInit(); | |
613 | + | |
594 | 614 | va_infoMessage("VA-API version %s\n", VA_VERSION_S); |
595 | 615 | |
596 | 616 | vaStatus = va_getDriverName(dpy, &driver_name); |