summaryrefslogtreecommitdiff
path: root/va
diff options
context:
space:
mode:
authorintel <carl.zhang@intel.com>2019-03-22 18:28:22 -0400
committerXinfengZhang <carl.zhang@intel.com>2019-05-09 15:10:40 +0800
commit7da0abb2803086c0bb6192a262cece2fc19099f8 (patch)
tree04998d4bf07e19dab33a4ec6ead3a2eac00793dc /va
parent98be67c43ec5cf07ee1f839b3a279b6a674fd811 (diff)
downloadlibva-7da0abb2803086c0bb6192a262cece2fc19099f8.tar.gz
add return value into logs
only take effect when the call failed Signed-off-by: intel <carl.zhang@intel.com>
Diffstat (limited to 'va')
-rw-r--r--va/va.c149
-rw-r--r--va/va_str.c40
-rw-r--r--va/va_str.h2
-rwxr-xr-xva/va_trace.c11
-rw-r--r--va/va_trace.h6
5 files changed, 181 insertions, 27 deletions
diff --git a/va/va.c b/va/va.c
index 0fc3b03..fcd512a 100644
--- a/va/va.c
+++ b/va/va.c
@@ -712,7 +712,7 @@ VAStatus vaInitialize (
free(driver_name);
VA_TRACE_LOG(va_TraceInitialize, dpy, major_version, minor_version);
-
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -747,6 +747,7 @@ VAStatus vaTerminate (
}
VA_TRACE_LOG(va_TraceTerminate, dpy);
+ VA_TRACE_RET(dpy, vaStatus);
va_TraceEnd(dpy);
@@ -819,10 +820,13 @@ VAStatus vaQueryConfigEntrypoints (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaQueryConfigEntrypoints ( ctx, profile, entrypoints, num_entrypoints);
+ vaStatus = ctx->vtable->vaQueryConfigEntrypoints ( ctx, profile, entrypoints, num_entrypoints);
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaGetConfigAttributes (
@@ -834,10 +838,13 @@ VAStatus vaGetConfigAttributes (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaGetConfigAttributes ( ctx, profile, entrypoint, attrib_list, num_attribs );
+ vaStatus = ctx->vtable->vaGetConfigAttributes ( ctx, profile, entrypoint, attrib_list, num_attribs );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaQueryConfigProfiles (
@@ -847,10 +854,13 @@ VAStatus vaQueryConfigProfiles (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaQueryConfigProfiles ( ctx, profile_list, num_profiles );
+ vaStatus = ctx->vtable->vaQueryConfigProfiles ( ctx, profile_list, num_profiles );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaCreateConfig (
@@ -873,7 +883,7 @@ VAStatus vaCreateConfig (
/* record the current entrypoint for further trace/fool determination */
VA_TRACE_ALL(va_TraceCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id);
VA_FOOL_FUNC(va_FoolCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id);
-
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -891,6 +901,7 @@ VAStatus vaDestroyConfig (
vaStatus = ctx->vtable->vaDestroyConfig ( ctx, config_id );
VA_TRACE_ALL(va_TraceDestroyConfig, dpy, config_id);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -905,10 +916,13 @@ VAStatus vaQueryConfigAttributes (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaQueryConfigAttributes( ctx, config_id, profile, entrypoint, attrib_list, num_attribs);
+ vaStatus = ctx->vtable->vaQueryConfigAttributes( ctx, config_id, profile, entrypoint, attrib_list, num_attribs);
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaQueryProcessingRate (
@@ -919,11 +933,15 @@ VAStatus vaQueryProcessingRate (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
if(!ctx->vtable->vaQueryProcessingRate)
- return VA_STATUS_ERROR_UNIMPLEMENTED;
- return ctx->vtable->vaQueryProcessingRate( ctx, config_id, proc_buf, processing_rate);
+ vaStatus = VA_STATUS_ERROR_UNIMPLEMENTED;
+ else
+ vaStatus = ctx->vtable->vaQueryProcessingRate( ctx, config_id, proc_buf, processing_rate);
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
/* XXX: this is a slow implementation that will be removed */
@@ -1086,6 +1104,7 @@ vaQuerySurfaceAttributes(
attrib_list, num_attribs);
VA_TRACE_LOG(va_TraceQuerySurfaceAttributes, dpy, config, attrib_list, num_attribs);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1122,6 +1141,7 @@ vaCreateSurfaces(
VA_TRACE_LOG(va_TraceCreateSurfaces,
dpy, width, height, format, num_surfaces, surfaces,
attrib_list, num_attribs);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1143,6 +1163,7 @@ VAStatus vaDestroySurfaces (
dpy, surface_list, num_surfaces);
vaStatus = ctx->vtable->vaDestroySurfaces( ctx, surface_list, num_surfaces );
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1169,6 +1190,7 @@ VAStatus vaCreateContext (
/* keep current encode/decode resoluton */
VA_TRACE_ALL(va_TraceCreateContext, dpy, config_id, picture_width, picture_height, flag, render_targets, num_render_targets, context);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1187,6 +1209,7 @@ VAStatus vaDestroyContext (
vaStatus = ctx->vtable->vaDestroyContext( ctx, context );
VA_TRACE_ALL(va_TraceDestroyContext, dpy, context);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1209,6 +1232,7 @@ VAStatus vaCreateMFContext (
VA_TRACE_ALL(va_TraceCreateMFContext, dpy, mf_context);
}
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1232,6 +1256,7 @@ VAStatus vaMFAddContext (
VA_TRACE_ALL(va_TraceMFAddContext, dpy, context, mf_context);
}
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1253,6 +1278,7 @@ VAStatus vaMFReleaseContext (
vaStatus = ctx->vtable->vaMFReleaseContext( ctx, context, mf_context);
VA_TRACE_ALL(va_TraceMFReleaseContext, dpy, context, mf_context);
}
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1277,6 +1303,7 @@ VAStatus vaMFSubmit (
vaStatus = ctx->vtable->vaMFSubmit( ctx, mf_context, contexts, num_contexts);
VA_TRACE_ALL(va_TraceMFSubmit, dpy, mf_context, contexts, num_contexts);
}
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1304,6 +1331,7 @@ VAStatus vaCreateBuffer (
VA_TRACE_LOG(va_TraceCreateBuffer,
dpy, context, type, size, num_elements, data, buf_id);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1330,6 +1358,7 @@ VAStatus vaCreateBuffer2 (
VA_TRACE_LOG(va_TraceCreateBuffer,
dpy, context, type, *pitch, height, NULL, buf_id);
+ VA_TRACE_RET(dpy, vaStatus);
return vaStatus;
}
@@ -1341,12 +1370,15 @@ VAStatus vaBufferSetNumElements (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
VA_FOOL_FUNC(va_FoolCheckContinuity, dpy);
- return ctx->vtable->vaBufferSetNumElements( ctx, buf_id, num_elements );
+ vaStatus = ctx->vtable->vaBufferSetNumElements( ctx, buf_id, num_elements );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
@@ -1367,6 +1399,7 @@ VAStatus vaMapBuffer (
va_status = ctx->vtable->vaMapBuffer( ctx, buf_id, pbuf );
VA_TRACE_ALL(va_TraceMapBuffer, dpy, buf_id, pbuf);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1377,12 +1410,15 @@ VAStatus vaUnmapBuffer (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
VA_FOOL_FUNC(va_FoolCheckContinuity, dpy);
- return ctx->vtable->vaUnmapBuffer( ctx, buf_id );
+ vaStatus = ctx->vtable->vaUnmapBuffer( ctx, buf_id );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaDestroyBuffer (
@@ -1391,6 +1427,7 @@ VAStatus vaDestroyBuffer (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
@@ -1399,7 +1436,9 @@ VAStatus vaDestroyBuffer (
VA_TRACE_LOG(va_TraceDestroyBuffer,
dpy, buffer_id);
- return ctx->vtable->vaDestroyBuffer( ctx, buffer_id );
+ vaStatus = ctx->vtable->vaDestroyBuffer( ctx, buffer_id );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaBufferInfo (
@@ -1412,13 +1451,16 @@ VAStatus vaBufferInfo (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
VA_FOOL_FUNC(va_FoolBufferInfo, dpy, buf_id, type, size, num_elements);
- return ctx->vtable->vaBufferInfo( ctx, buf_id, type, size, num_elements );
+ vaStatus = ctx->vtable->vaBufferInfo( ctx, buf_id, type, size, num_elements );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
/* Locks buffer for external API usage */
@@ -1426,13 +1468,17 @@ VAStatus
vaAcquireBufferHandle(VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
if (!ctx->vtable->vaAcquireBufferHandle)
- return VA_STATUS_ERROR_UNIMPLEMENTED;
- return ctx->vtable->vaAcquireBufferHandle(ctx, buf_id, buf_info);
+ vaStatus = VA_STATUS_ERROR_UNIMPLEMENTED;
+ else
+ vaStatus = ctx->vtable->vaAcquireBufferHandle(ctx, buf_id, buf_info);
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
/* Unlocks buffer after usage from external API */
@@ -1440,13 +1486,17 @@ VAStatus
vaReleaseBufferHandle(VADisplay dpy, VABufferID buf_id)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
if (!ctx->vtable->vaReleaseBufferHandle)
- return VA_STATUS_ERROR_UNIMPLEMENTED;
- return ctx->vtable->vaReleaseBufferHandle(ctx, buf_id);
+ vaStatus = VA_STATUS_ERROR_UNIMPLEMENTED;
+ else
+ vaStatus = ctx->vtable->vaReleaseBufferHandle(ctx, buf_id);
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus
@@ -1455,15 +1505,19 @@ vaExportSurfaceHandle(VADisplay dpy, VASurfaceID surface_id,
void *descriptor)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
if (!ctx->vtable->vaExportSurfaceHandle)
- return VA_STATUS_ERROR_UNIMPLEMENTED;
- return ctx->vtable->vaExportSurfaceHandle(ctx, surface_id,
+ vaStatus = VA_STATUS_ERROR_UNIMPLEMENTED;
+ else
+ vaStatus = ctx->vtable->vaExportSurfaceHandle(ctx, surface_id,
mem_type, flags,
descriptor);
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaBeginPicture (
@@ -1482,6 +1536,7 @@ VAStatus vaBeginPicture (
VA_FOOL_FUNC(va_FoolCheckContinuity, dpy);
va_status = ctx->vtable->vaBeginPicture( ctx, context, render_target );
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1494,6 +1549,7 @@ VAStatus vaRenderPicture (
)
{
VADriverContextP ctx;
+ VAStatus vaStatus = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
@@ -1501,7 +1557,9 @@ VAStatus vaRenderPicture (
VA_TRACE_LOG(va_TraceRenderPicture, dpy, context, buffers, num_buffers);
VA_FOOL_FUNC(va_FoolCheckContinuity, dpy);
- return ctx->vtable->vaRenderPicture( ctx, context, buffers, num_buffers );
+ vaStatus = ctx->vtable->vaRenderPicture( ctx, context, buffers, num_buffers );
+ VA_TRACE_RET(dpy, vaStatus);
+ return vaStatus;
}
VAStatus vaEndPicture (
@@ -1521,6 +1579,7 @@ VAStatus vaEndPicture (
/* dump surface content */
VA_TRACE_ALL(va_TraceEndPicture, dpy, context, 1);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1538,6 +1597,7 @@ VAStatus vaSyncSurface (
va_status = ctx->vtable->vaSyncSurface( ctx, render_target );
VA_TRACE_LOG(va_TraceSyncSurface, dpy, render_target);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1556,6 +1616,7 @@ VAStatus vaQuerySurfaceStatus (
va_status = ctx->vtable->vaQuerySurfaceStatus( ctx, render_target, status );
VA_TRACE_LOG(va_TraceQuerySurfaceStatus, dpy, render_target, status);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1575,6 +1636,7 @@ VAStatus vaQuerySurfaceError (
va_status = ctx->vtable->vaQuerySurfaceError( ctx, surface, error_status, error_info );
VA_TRACE_LOG(va_TraceQuerySurfaceError, dpy, surface, error_status, error_info);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1620,10 +1682,13 @@ VAStatus vaCreateImage (
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaCreateImage ( ctx, format, width, height, image);
+ va_status = ctx->vtable->vaCreateImage ( ctx, format, width, height, image);
+ VA_TRACE_RET(dpy, va_status);
+ return va_status;
}
/*
@@ -1635,10 +1700,13 @@ VAStatus vaDestroyImage (
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaDestroyImage ( ctx, image);
+ va_status = ctx->vtable->vaDestroyImage ( ctx, image);
+ VA_TRACE_RET(dpy, va_status);
+ return va_status;
}
VAStatus vaSetImagePalette (
@@ -1648,10 +1716,13 @@ VAStatus vaSetImagePalette (
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaSetImagePalette ( ctx, image, palette);
+ va_status = ctx->vtable->vaSetImagePalette ( ctx, image, palette);
+ VA_TRACE_RET(dpy, va_status);
+ return va_status;
}
/*
@@ -1669,10 +1740,13 @@ VAStatus vaGetImage (
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaGetImage ( ctx, surface, x, y, width, height, image);
+ va_status = ctx->vtable->vaGetImage ( ctx, surface, x, y, width, height, image);
+ VA_TRACE_RET(dpy, va_status);
+ return va_status;
}
/*
@@ -1694,10 +1768,13 @@ VAStatus vaPutImage (
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaPutImage ( ctx, surface, image, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height );
+ va_status = ctx->vtable->vaPutImage ( ctx, surface, image, src_x, src_y, src_width, src_height, dest_x, dest_y, dest_width, dest_height );
+ VA_TRACE_RET(dpy, va_status);
+ return va_status;
}
/*
@@ -1738,10 +1815,13 @@ VAStatus vaDeriveImage (
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaDeriveImage ( ctx, surface, image );
+ va_status = ctx->vtable->vaDeriveImage ( ctx, surface, image );
+ VA_TRACE_RET(dpy, va_status);
+ return va_status;
}
@@ -1950,6 +2030,7 @@ VAStatus vaQueryDisplayAttributes (
va_status = ctx->vtable->vaQueryDisplayAttributes ( ctx, attr_list, num_attributes );
VA_TRACE_LOG(va_TraceQueryDisplayAttributes, dpy, attr_list, num_attributes);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
@@ -1975,6 +2056,7 @@ VAStatus vaGetDisplayAttributes (
va_status = ctx->vtable->vaGetDisplayAttributes ( ctx, attr_list, num_attributes );
VA_TRACE_LOG(va_TraceGetDisplayAttributes, dpy, attr_list, num_attributes);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -1998,6 +2080,7 @@ VAStatus vaSetDisplayAttributes (
va_status = ctx->vtable->vaSetDisplayAttributes ( ctx, attr_list, num_attributes );
VA_TRACE_LOG(va_TraceSetDisplayAttributes, dpy, attr_list, num_attributes);
+ VA_TRACE_RET(dpy, va_status);
return va_status;
}
@@ -2016,10 +2099,14 @@ VAStatus vaLockSurface(VADisplay dpy,
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaLockSurface( ctx, surface, fourcc, luma_stride, chroma_u_stride, chroma_v_stride, luma_offset, chroma_u_offset, chroma_v_offset, buffer_name, buffer);
+ va_status = ctx->vtable->vaLockSurface( ctx, surface, fourcc, luma_stride, chroma_u_stride, chroma_v_stride, luma_offset, chroma_u_offset, chroma_v_offset, buffer_name, buffer);
+ VA_TRACE_RET(dpy, va_status);
+
+ return va_status;
}
@@ -2028,10 +2115,14 @@ VAStatus vaUnlockSurface(VADisplay dpy,
)
{
VADriverContextP ctx;
+ VAStatus va_status = VA_STATUS_SUCCESS;
CHECK_DISPLAY(dpy);
ctx = CTX(dpy);
- return ctx->vtable->vaUnlockSurface( ctx, surface );
+ va_status = ctx->vtable->vaUnlockSurface( ctx, surface );
+ VA_TRACE_RET(dpy, va_status);
+
+ return va_status;
}
/* Video Processing */
@@ -2065,6 +2156,8 @@ vaQueryVideoProcFilters(
QueryVideoProcFilters,
(ctx, context, filters, num_filters)
);
+ VA_TRACE_RET(dpy, status);
+
return status;
}
@@ -2086,6 +2179,7 @@ vaQueryVideoProcFilterCaps(
QueryVideoProcFilterCaps,
(ctx, context, type, filter_caps, num_filter_caps)
);
+ VA_TRACE_RET(dpy, status);
return status;
}
@@ -2107,5 +2201,6 @@ vaQueryVideoProcPipelineCaps(
QueryVideoProcPipelineCaps,
(ctx, context, filters, num_filters, pipeline_caps)
);
+ VA_TRACE_RET(dpy, status);
return status;
}
diff --git a/va/va_str.c b/va/va_str.c
index f223515..bda1a72 100644
--- a/va/va_str.c
+++ b/va/va_str.c
@@ -177,4 +177,44 @@ const char *vaBufferTypeStr(VABufferType bufferType)
return "<unknown buffer type>";
}
+const char *vaStatusStr(VAStatus status)
+{
+ switch(status){
+ TOSTR(VA_STATUS_SUCCESS);
+ TOSTR(VA_STATUS_ERROR_OPERATION_FAILED);
+ TOSTR(VA_STATUS_ERROR_ALLOCATION_FAILED);
+ TOSTR(VA_STATUS_ERROR_INVALID_DISPLAY);
+ TOSTR(VA_STATUS_ERROR_INVALID_CONFIG);
+ TOSTR(VA_STATUS_ERROR_INVALID_CONTEXT);
+ TOSTR(VA_STATUS_ERROR_INVALID_SURFACE);
+ TOSTR(VA_STATUS_ERROR_INVALID_BUFFER);
+ TOSTR(VA_STATUS_ERROR_INVALID_IMAGE);
+ TOSTR(VA_STATUS_ERROR_INVALID_SUBPICTURE);
+ TOSTR(VA_STATUS_ERROR_ATTR_NOT_SUPPORTED);
+ TOSTR(VA_STATUS_ERROR_MAX_NUM_EXCEEDED);
+ TOSTR(VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
+ TOSTR(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
+ TOSTR(VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT);
+ TOSTR(VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE);
+ TOSTR(VA_STATUS_ERROR_SURFACE_BUSY);
+ TOSTR(VA_STATUS_ERROR_FLAG_NOT_SUPPORTED);
+ TOSTR(VA_STATUS_ERROR_INVALID_PARAMETER);
+ TOSTR(VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED);
+ TOSTR(VA_STATUS_ERROR_UNIMPLEMENTED);
+ TOSTR(VA_STATUS_ERROR_SURFACE_IN_DISPLAYING);
+ TOSTR(VA_STATUS_ERROR_INVALID_IMAGE_FORMAT);
+ TOSTR(VA_STATUS_ERROR_DECODING_ERROR);
+ TOSTR(VA_STATUS_ERROR_ENCODING_ERROR);
+ TOSTR(VA_STATUS_ERROR_INVALID_VALUE);
+ TOSTR(VA_STATUS_ERROR_UNSUPPORTED_FILTER);
+ TOSTR(VA_STATUS_ERROR_INVALID_FILTER_CHAIN);
+ TOSTR(VA_STATUS_ERROR_HW_BUSY);
+ TOSTR(VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE);
+ TOSTR(VA_STATUS_ERROR_NOT_ENOUGH_BUFFER);
+ TOSTR(VA_STATUS_ERROR_UNKNOWN);
+ default: break;
+ }
+ return "unknown return value";
+}
+
#undef TOSTR
diff --git a/va/va_str.h b/va/va_str.h
index e8e02f6..1bfe583 100644
--- a/va/va_str.h
+++ b/va/va_str.h
@@ -40,6 +40,8 @@ const char *vaConfigAttribTypeStr(VAConfigAttribType configAttribType);
const char *vaBufferTypeStr(VABufferType bufferType);
+const char *vaStatusStr(VAStatus status);
+
#ifdef __cplusplus
}
#endif
diff --git a/va/va_trace.c b/va/va_trace.c
index efc86df..905b41d 100755
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -5252,3 +5252,14 @@ void va_TracePutSurface (
DPY2TRACE_VIRCTX_EXIT(pva_trace);
}
+
+void va_TraceStatus(VADisplay dpy, const char * funcName, VAStatus status)
+{
+ if(status == VA_STATUS_SUCCESS)
+ return;
+
+ DPY2TRACE_VIRCTX(dpy);
+
+ va_TraceMsg(trace_ctx, "=========%s ret = %s, %s \n",funcName, vaStatusStr(status), vaErrorStr(status));
+ DPY2TRACE_VIRCTX_EXIT(pva_trace);
+}
diff --git a/va/va_trace.h b/va/va_trace.h
index 48922f5..4c67472 100644
--- a/va/va_trace.h
+++ b/va/va_trace.h
@@ -49,6 +49,10 @@ extern int va_trace_flag;
if (va_trace_flag) { \
trace_func(__VA_ARGS__); \
}
+#define VA_TRACE_RET(dpy,ret) \
+ if (va_trace_flag){ \
+ va_TraceStatus(dpy, __func__, ret); \
+ }
DLL_HIDDEN
void va_TraceInit(VADisplay dpy);
@@ -270,6 +274,8 @@ void va_TracePutSurface (
unsigned int flags /* de-interlacing flags */
);
+void va_TraceStatus(VADisplay dpy, const char * funcName, VAStatus status);
+
#ifdef __cplusplus
}
#endif