diff options
-rw-r--r-- | va/va.c | 14 | ||||
-rw-r--r-- | va/va_trace.c | 55 | ||||
-rw-r--r-- | va/va_trace.h | 14 |
3 files changed, 81 insertions, 2 deletions
@@ -929,15 +929,22 @@ VAStatus vaCreateBuffer ( ) { VADriverContextP ctx; + VAStatus vaStatus; + int ret = 0; + CHECK_DISPLAY(dpy); ctx = CTX(dpy); - int ret = 0; VA_FOOL_FUNC(va_FoolCreateBuffer, dpy, context, type, size, num_elements, data, buf_id); if (ret) return VA_STATUS_SUCCESS; - return ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id); + vaStatus = ctx->vtable->vaCreateBuffer( ctx, context, type, size, num_elements, data, buf_id); + + VA_TRACE_LOG(va_TraceCreateBuffer, + dpy, context, type, size, num_elements, data, buf_id); + + return vaStatus; } VAStatus vaBufferSetNumElements ( @@ -1007,6 +1014,9 @@ VAStatus vaDestroyBuffer ( ctx = CTX(dpy); VA_FOOL_RETURN(); + + VA_TRACE_LOG(va_TraceDestroyBuffer, + dpy, buffer_id); return ctx->vtable->vaDestroyBuffer( ctx, buffer_id ); } diff --git a/va/va_trace.c b/va/va_trace.c index 887e24d..b546fe6 100644 --- a/va/va_trace.c +++ b/va/va_trace.c @@ -619,6 +619,61 @@ static char * buffer_type_to_string(int type) } } +void va_TraceCreateBuffer ( + VADisplay dpy, + VAContextID context, /* in */ + VABufferType type, /* in */ + unsigned int size, /* in */ + unsigned int num_elements, /* in */ + void *data, /* in */ + VABufferID *buf_id /* out */ +) +{ + DPY2INDEX(dpy); + + /* only trace CodedBuffer */ + if (type != VAEncCodedBufferType) + return; + + TRACE_FUNCNAME(idx); + va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type)); + va_TraceMsg(idx, "\tbuf_id=0x%x\n", *buf_id); + va_TraceMsg(idx, "\tsize=%d\n", size); + va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements); + + va_TraceMsg(idx, NULL); +} + +void va_TraceDestroyBuffer ( + VADisplay dpy, + VABufferID buf_id /* in */ +) +{ + VABufferType type; + unsigned int size; + unsigned int num_elements; + + VACodedBufferSegment *buf_list; + int i = 0; + + DPY2INDEX(dpy); + + vaBufferInfo(dpy, trace_context[idx].trace_context, buf_id, &type, &size, &num_elements); + + /* only trace CodedBuffer */ + if (type != VAEncCodedBufferType) + return; + + TRACE_FUNCNAME(idx); + va_TraceMsg(idx, "\tbuf_type=%s\n", buffer_type_to_string(type)); + va_TraceMsg(idx, "\tbuf_id=0x%x\n", buf_id); + va_TraceMsg(idx, "\tsize=%d\n", size); + va_TraceMsg(idx, "\tnum_elements=%d\n", num_elements); + + va_TraceMsg(idx, NULL); +} + + void va_TraceMapBuffer ( VADisplay dpy, VABufferID buf_id, /* in */ diff --git a/va/va_trace.h b/va/va_trace.h index 29599ea..70c3847 100644 --- a/va/va_trace.h +++ b/va/va_trace.h @@ -96,6 +96,20 @@ void va_TraceCreateContext( VAContextID *context /* out */ ); +void va_TraceCreateBuffer ( + VADisplay dpy, + VAContextID context, /* in */ + VABufferType type, /* in */ + unsigned int size, /* in */ + unsigned int num_elements, /* in */ + void *data, /* in */ + VABufferID *buf_id /* out */ +); + +void va_TraceDestroyBuffer ( + VADisplay dpy, + VABufferID buf_id /* in */ +); void va_TraceMapBuffer ( VADisplay dpy, |