string_of_va_chroma_format() gets a wrong string format description.
For example, the YUV420_10BPP get a string of 0x00000100 as output.
It's because VA_RT_FORMAT_xxx values are macro definitions. And
STRINGIFY(VA_RT_FORMAT_xxx) will expand to its real value
0x00000XXX.
To avoid the macro evaluation, it is changed to show only the color
format without VA_RT_FORMAT_ prefix.
#define DEBUG 1
#include "gstvaapidebug.h"
+/* string case an enum */
#define STRCASEP(p, x) STRCASE(G_PASTE(p, x))
#define STRCASE(x) case x: return G_STRINGIFY(x)
+/* string case a macro */
+#define STRCASEM(p, x) case G_PASTE(p, x): return G_STRINGIFY(x)
+
#if VA_CHECK_VERSION (0,40,0)
static gchar *
strip_msg (const char *message)
{
switch (chroma_format) {
#define MAP(value) \
- STRCASEP(VA_RT_FORMAT_, value)
+ STRCASEM(VA_RT_FORMAT_, value)
MAP (YUV420);
MAP (YUV422);
MAP (YUV444);