OSDN Git Service

va_trace: refine the log format
[android-x86/hardware-intel-common-libva.git] / va / va.c
diff --git a/va/va.c b/va/va.c
index e331f74..400273e 100644 (file)
--- a/va/va.c
+++ b/va/va.c
@@ -88,7 +88,8 @@ int va_parseConfig(char *env, char *env_value)
     /* no setting in config file, use env setting */
     value = getenv(env);
     if (value) {
-        strncpy(env_value, value, 1024);
+        if (env_value)
+            strncpy(env_value, value, 1024);
         return 0;
     }
     
@@ -626,7 +627,7 @@ VAStatus vaCreateConfig (
   vaStatus = ctx->vtable->vaCreateConfig ( ctx, profile, entrypoint, attrib_list, num_attribs, config_id );
 
   /* record the current entrypoint for further trace/fool determination */
-  VA_TRACE_FUNC(va_TraceCreateConfig, dpy, profile, entrypoint, attrib_list, num_attribs, config_id);
+  VA_TRACE_LOG(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);
   
   return vaStatus;
@@ -894,7 +895,7 @@ VAStatus vaCreateContext (
                                       flag, render_targets, num_render_targets, context );
 
   /* keep current encode/decode resoluton */
-  VA_TRACE_FUNC(va_TraceCreateContext, dpy, config_id, picture_width, picture_height, flag, render_targets, num_render_targets, context);
+  VA_TRACE_LOG(va_TraceCreateContext, dpy, config_id, picture_width, picture_height, flag, render_targets, num_render_targets, context);
 
   return vaStatus;
 }
@@ -1038,7 +1039,7 @@ VAStatus vaBeginPicture (
   CHECK_DISPLAY(dpy);
   ctx = CTX(dpy);
 
-  VA_TRACE_FUNC(va_TraceBeginPicture, dpy, context, render_target);
+  VA_TRACE_LOG(va_TraceBeginPicture, dpy, context, render_target);
   VA_FOOL_RETURN();
   
   va_status = ctx->vtable->vaBeginPicture( ctx, context, render_target );
@@ -1069,19 +1070,16 @@ VAStatus vaEndPicture (
     VAContextID context
 )
 {
-  VAStatus va_status;
+  VAStatus va_status = VA_STATUS_SUCCESS;
   VADriverContextP ctx;
 
   CHECK_DISPLAY(dpy);
   ctx = CTX(dpy);
 
-  /* dump encode source surface */
-  VA_TRACE_SURFACE(va_TraceEndPicture, dpy, context, 0);
-  /* return directly if do dummy operation */
-  VA_FOOL_RETURN();
-  
-  va_status = ctx->vtable->vaEndPicture( ctx, context );
-  /* dump decode dest surface */
+  if (fool_codec == 0)
+      va_status = ctx->vtable->vaEndPicture( ctx, context );
+
+  /* dump surface content */
   VA_TRACE_SURFACE(va_TraceEndPicture, dpy, context, 1);
 
   return va_status;