Commit 696e11da authored by Austin Yuan's avatar Austin Yuan

vainfo: print more information about supported profile:entrypoints

Signed-off-by: default avatarAustin Yuan <shengquan.yuan@intel.com>
parent d8618bcd
...@@ -29,6 +29,44 @@ ...@@ -29,6 +29,44 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#define CHECK_VASTATUS(va_status,func, ret) \
if (va_status != VA_STATUS_SUCCESS) { \
fprintf(stderr,"%s failed with error code %d (%s),exit\n",func, vaErrorStr(va_status)); \
exit(ret); \
}
static char * profile_string(VAProfile profile)
{
switch (profile) {
case VAProfileMPEG2Simple: return "VAProfileMPEG2Simple";
case VAProfileMPEG2Main: return "VAProfileMPEG2Main";
case VAProfileMPEG4Simple: return "VAProfileMPEG4Simple";
case VAProfileMPEG4AdvancedSimple: return "VAProfileMPEG4AdvancedSimple";
case VAProfileMPEG4Main: return "VAProfileMPEG4Main";
case VAProfileH264Baseline: return "VAProfileH264Baseline";
case VAProfileH264Main: return "VAProfileH264Main";
case VAProfileH264High: return "VAProfileH264High";
case VAProfileVC1Simple: return "VAProfileVC1Simple";
case VAProfileVC1Main: return "VAProfileVC1Main";
case VAProfileVC1Advanced: return "VAProfileVC1Advanced";
case VAProfileH263Baseline: return "VAProfileH263Baseline";
}
}
static char * entrypoint_string(VAEntrypoint entrypoint)
{
switch (entrypoint) {
case VAEntrypointVLD:return "VAEntrypointVLD";
case VAEntrypointIZZ:return "VAEntrypointIZZ";
case VAEntrypointIDCT:return "VAEntrypointIDCT";
case VAEntrypointMoComp:return "VAEntrypointMoComp";
case VAEntrypointDeblocking:return "VAEntrypointDeblocking";
case VAEntrypointEncSlice:return "VAEntrypointEncSlice";
}
}
int main(int argc, const char* argv[]) int main(int argc, const char* argv[])
{ {
Display *dpy; Display *dpy;
...@@ -38,6 +76,9 @@ int main(int argc, const char* argv[]) ...@@ -38,6 +76,9 @@ int main(int argc, const char* argv[])
const char *driver; const char *driver;
const char *display = getenv("DISPLAY"); const char *display = getenv("DISPLAY");
const char *name = rindex(argv[0], '/'); const char *name = rindex(argv[0], '/');
VAProfile profile;
VAEntrypoint entrypoint, entrypoints[10];
int num_entrypoint;
if (name) if (name)
name++; name++;
...@@ -59,16 +100,27 @@ int main(int argc, const char* argv[]) ...@@ -59,16 +100,27 @@ int main(int argc, const char* argv[])
} }
va_status = vaInitialize(va_dpy, &major_version, &minor_version); va_status = vaInitialize(va_dpy, &major_version, &minor_version);
if (VA_STATUS_SUCCESS != va_status ) CHECK_VASTATUS(va_status, "vaInitialize", 3);
{
fprintf(stderr, "%s: vaInitialize failed with error code %d (%s)\n",
name, va_status, vaErrorStr(va_status));
return 3;
}
printf("%s: VA API version: %d.%d\n", name, major_version, minor_version); printf("%s: VA API version: %d.%d\n", name, major_version, minor_version);
driver = vaQueryVendorString(va_dpy); driver = vaQueryVendorString(va_dpy);
printf("%s: Driver version: %s\n", name, driver ? driver : "<unknown>"); printf("%s: Driver version: %s\n", name, driver ? driver : "<unknown>");
printf("%s: Supported profile and entrypoints\n", name);
for (profile = VAProfileMPEG2Simple; profile <= VAProfileH263Baseline; profile++) {
char *profile_str;
va_status = vaQueryConfigEntrypoints(va_dpy, profile, entrypoints,
&num_entrypoint);
CHECK_VASTATUS(va_status, "vaQueryConfigEntrypoints", 4);
profile_str = profile_string(profile);
for (entrypoint = 0; entrypoint < num_entrypoint; entrypoint++)
printf(" %32s:%s\n", profile_str, entrypoint_string(entrypoints[entrypoint]));
}
vaTerminate(va_dpy); vaTerminate(va_dpy);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment