Commit f5c73d8a authored by Alexander I Osin's avatar Alexander I Osin Committed by Austin Yuan

Fixed number bugs in va_TraceSurface.

parent 0b8b9764
...@@ -343,14 +343,16 @@ void va_TraceSurface(VADisplay dpy) ...@@ -343,14 +343,16 @@ void va_TraceSurface(VADisplay dpy)
truncate_file(trace_context[idx].trace_fp_surface); truncate_file(trace_context[idx].trace_fp_surface);
} }
va_status = vaLockSurface(dpy, trace_context[idx].trace_rendertarget, &fourcc, va_status = vaLockSurface(
&luma_stride, &chroma_u_stride, &chroma_v_stride, dpy,
&luma_offset, &chroma_u_offset, &chroma_v_offset, trace_context[idx].trace_rendertarget,
&buffer_name, &buffer); &fourcc,
&luma_stride, &chroma_u_stride, &chroma_v_stride,
&luma_offset, &chroma_u_offset, &chroma_v_offset,
&buffer_name, &buffer);
if (va_status != VA_STATUS_SUCCESS) { if (va_status != VA_STATUS_SUCCESS) {
va_TraceMsg(idx, "Error:vaLockSurface failed\n"); va_TraceMsg(idx, "Error:vaLockSurface failed\n");
return; return;
} }
...@@ -364,7 +366,7 @@ void va_TraceSurface(VADisplay dpy) ...@@ -364,7 +366,7 @@ void va_TraceSurface(VADisplay dpy)
va_TraceMsg(idx, "\tchroma_u_offset = %d\n", chroma_u_offset); va_TraceMsg(idx, "\tchroma_u_offset = %d\n", chroma_u_offset);
va_TraceMsg(idx, "\tchroma_v_offset = %d\n", chroma_v_offset); va_TraceMsg(idx, "\tchroma_v_offset = %d\n", chroma_v_offset);
if (*(unsigned int *)buffer == 0) { if (buffer == NULL) {
va_TraceMsg(idx, "Error:vaLockSurface return NULL buffer\n"); va_TraceMsg(idx, "Error:vaLockSurface return NULL buffer\n");
vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget); vaUnlockSurface(dpy, trace_context[idx].trace_rendertarget);
...@@ -372,8 +374,8 @@ void va_TraceSurface(VADisplay dpy) ...@@ -372,8 +374,8 @@ void va_TraceSurface(VADisplay dpy)
} }
va_TraceMsg(idx, "\tbuffer location = 0x%08x\n", buffer); va_TraceMsg(idx, "\tbuffer location = 0x%08x\n", buffer);
Y_data = buffer; Y_data = (unsigned char*)buffer;
UV_data = buffer + chroma_u_offset; UV_data = (unsigned char*)buffer + chroma_u_offset;
tmp = Y_data; tmp = Y_data;
for (i=0; i<trace_context[idx].trace_frame_height; i++) { for (i=0; i<trace_context[idx].trace_frame_height; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment