mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
libs: utils: avoid macro evaluation when stringify
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.
This commit is contained in:
parent
7c0ec687cd
commit
3c86fd12cb
1 changed files with 5 additions and 1 deletions
|
@ -34,9 +34,13 @@
|
|||
#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)
|
||||
|
@ -294,7 +298,7 @@ string_of_va_chroma_format (guint chroma_format)
|
|||
{
|
||||
switch (chroma_format) {
|
||||
#define MAP(value) \
|
||||
STRCASEP(VA_RT_FORMAT_, value)
|
||||
STRCASEM(VA_RT_FORMAT_, value)
|
||||
MAP (YUV420);
|
||||
MAP (YUV422);
|
||||
MAP (YUV444);
|
||||
|
|
Loading…
Reference in a new issue