2 * vaapi_utils.c - VA-API utilities
4 * gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "vaapi_utils.h"
26 void vaapi_dprintf(const char *format, ...)
29 va_start(args, format);
30 fprintf(stdout, "[GstVaapi] ");
31 vfprintf(stdout, format, args);
35 /* Check VA status for success or print out an error */
36 int vaapi_check_status(VAStatus status, const char *msg)
38 if (status != VA_STATUS_SUCCESS) {
39 vaapi_dprintf("%s: %s\n", msg, vaErrorStr(status));
45 /* Return a string representation of a FOURCC */
46 const char *string_of_FOURCC(guint32 fourcc)
49 static char str[2][5]; // XXX: 2 buffers should be enough for most purposes
53 str[buf][1] = fourcc >> 8;
54 str[buf][2] = fourcc >> 16;
55 str[buf][3] = fourcc >> 24;
60 /* Return a string representation of a VAProfile */
61 const char *string_of_VAProfile(VAProfile profile)
64 #define PROFILE(profile) \
65 case VAProfile##profile: return "VAProfile" #profile
69 PROFILE(MPEG4AdvancedSimple);
71 PROFILE(H264Baseline);
83 /* Return a string representation of a VAEntrypoint */
84 const char *string_of_VAEntrypoint(VAEntrypoint entrypoint)
87 #define ENTRYPOINT(entrypoint) \
88 case VAEntrypoint##entrypoint: return "VAEntrypoint" #entrypoint
93 ENTRYPOINT(Deblocking);