summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Yuan <shengquan.yuan@gmail.com>2010-10-26 10:42:57 -0700
committerAustin Yuan <shengquan.yuan@gmail.com>2010-10-26 10:42:57 -0700
commitfa4729399847fdacf9790d0835ebf4aabee87a09 (patch)
tree9df11713da415d66fedaeab4a0740e71006147e6
parentce38ce0fdea95a16745927ce883dc0b2fbbee0a6 (diff)
downloadlibva-fa4729399847fdacf9790d0835ebf4aabee87a09.tar.gz
fix build warning issue
Signed-off-by: Austin Yuan <shengquan.yuan@gmail.com>
-rw-r--r--va/va.c4
-rw-r--r--va/va_fool.c12
-rw-r--r--va/va_fool.h7
-rw-r--r--va/va_trace.c21
4 files changed, 26 insertions, 18 deletions
diff --git a/va/va.c b/va/va.c
index af09939..5bc0d34 100644
--- a/va/va.c
+++ b/va/va.c
@@ -1187,7 +1187,7 @@ int vaMaxNumDisplayAttributes (
tmp = CTX(dpy)->max_display_attributes;
- VA_TRACE(va_MaxNumDisplayAttributes, dpy, tmp);
+ VA_TRACE(va_TraceMaxNumDisplayAttributes, dpy, tmp);
return tmp;
}
@@ -1212,7 +1212,7 @@ VAStatus vaQueryDisplayAttributes (
va_status = ctx->vtable.vaQueryDisplayAttributes ( ctx, attr_list, num_attributes );
- VA_TRACE(va_QueryDisplayAttributes, dpy, attr_list, num_attributes);
+ VA_TRACE(va_TraceQueryDisplayAttributes, dpy, attr_list, num_attributes);
return va_status;
diff --git a/va/va_fool.c b/va/va_fool.c
index 9732c92..0947400 100644
--- a/va/va_fool.c
+++ b/va/va_fool.c
@@ -37,6 +37,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <time.h>
#include "va_fool_264.h"
@@ -83,7 +84,7 @@ static struct _fool_context {
unsigned int fool_buf_size[VABufferTypeMax]; /* size of memory of fool buffers */
unsigned int fool_buf_count[VABufferTypeMax]; /* count of created buffers */
VAContextID context;
-} fool_context[FOOL_CONTEXT_MAX] = { 0 }; /* trace five context at the same time */
+} fool_context[FOOL_CONTEXT_MAX] = { {0} }; /* trace five context at the same time */
#define FOOL_DECODE(idx) (fool_decode && (fool_context[idx].fool_entrypoint == VAEntrypointVLD))
#define FOOL_ENCODE(idx) \
@@ -138,9 +139,7 @@ VAStatus vaUnlockSurface(VADisplay dpy,
void va_FoolInit(VADisplay dpy)
{
char env_value[1024];
- unsigned int suffix = 0xffff & ((unsigned int)time(NULL));
int fool_index = 0;
- FILE *tmp;
for (fool_index = 0; fool_index < FOOL_CONTEXT_MAX; fool_index++)
if (fool_context[fool_index].dpy == 0)
@@ -283,7 +282,7 @@ int va_FoolCreateSurfaces(
VASurfaceID *surfaces /* out */
)
{
- int i, j;
+ int i;
unsigned int fourcc; /* following are output argument */
unsigned int luma_stride;
unsigned int chroma_u_stride;
@@ -313,11 +312,11 @@ int va_FoolCreateSurfaces(
&buffer_name, &buffer);
if (va_status != VA_STATUS_SUCCESS)
- return;
+ return 0;
if (!buffer) {
vaUnlockSurface(dpy, surfaces[i]);
- return;
+ return 0;
}
Y_data = buffer;
@@ -358,7 +357,6 @@ VAStatus va_FoolCreateBuffer (
if (FOOL_ENCODE(idx) || FOOL_DECODE(idx)) { /* fool buffer creation */
int new_size = size * num_elements;
- VABufferID bufid = type;
if (type == VAEncCodedBufferType) /* only a VACodedBufferSegment */
new_size = sizeof(VACodedBufferSegment);
diff --git a/va/va_fool.h b/va/va_fool.h
index 792d6c6..a3d0a92 100644
--- a/va/va_fool.h
+++ b/va/va_fool.h
@@ -65,17 +65,20 @@ VAStatus va_FoolMapBuffer (
VABufferID buf_id, /* in */
void **pbuf /* out */
);
+
int va_FoolBeginPicture(
VADisplay dpy,
VAContextID context,
VASurfaceID render_target
);
+
int va_FoolRenderPicture(
VADisplay dpy,
VAContextID context,
VABufferID *buffers,
int num_buffers
);
+
int va_FoolEndPicture(
VADisplay dpy,
VAContextID context
@@ -93,6 +96,10 @@ VAStatus va_FoolQuerySubpictureFormats (
unsigned int *flags,
unsigned int *num_formats
);
+int va_FoolSyncSurface(
+ VADisplay dpy,
+ VASurfaceID render_target
+);
diff --git a/va/va_trace.c b/va/va_trace.c
index 01a6972..c2e31cd 100644
--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -91,7 +91,7 @@ static struct _trace_context {
unsigned int trace_frame_width; /* current frame width */
unsigned int trace_frame_height; /* current frame height */
unsigned int trace_sequence_start; /* get a new sequence for encoding or not */
-} trace_context[TRACE_CONTEXT_MAX] = { 0 }; /* trace five context at the same time */
+} trace_context[TRACE_CONTEXT_MAX] = { {0} }; /* trace five context at the same time */
#define DPY2INDEX(dpy) \
int idx; \
@@ -278,7 +278,7 @@ void va_TraceCodedBuf(VADisplay dpy)
va_TraceMsg(idx, "==========dump codedbuf into file %s\n", trace_context[idx].trace_codedbuf_fn);
while (buf_list != NULL) {
- int i;
+ unsigned int i;
va_TraceMsg(idx, "\tsize = %d\n", buf_list->size);
if (trace_context[idx].trace_fp_log)
@@ -297,7 +297,7 @@ void va_TraceCodedBuf(VADisplay dpy)
void va_TraceSurface(VADisplay dpy)
{
- int i, j;
+ unsigned int i, j;
unsigned int fourcc; /* following are output argument */
unsigned int luma_stride;
unsigned int chroma_u_stride;
@@ -492,9 +492,8 @@ static void va_TraceVABuffers(
void *pbuf
)
{
- int i, j;
+ unsigned int i;
unsigned char *p = pbuf;
- unsigned int *pi = (unsigned int *)pbuf;
unsigned char check_sum = 0;
DPY2INDEX(dpy);
@@ -514,7 +513,7 @@ static void va_TraceVABuffers(
va_TraceMsg(idx, "\tchecksum = 0x%02x\n", check_sum & 0xff);
- return 0;
+ return;
}
@@ -1154,6 +1153,8 @@ static void va_TraceMPEG2Buf(
break;
case VAEncH264SEIBufferType:
break;
+ default:
+ break;
}
}
@@ -1368,7 +1369,7 @@ void va_TraceRenderPicture(
va_TraceMsg(idx, "\tnum_buffers = %d\n", num_buffers);
for (i = 0; i < num_buffers; i++) {
void *pbuf;
- int j;
+ unsigned int j;
/* get buffer type information */
vaBufferInfo(dpy, context, buffers[i], &type, &size, &num_elements);
@@ -1418,6 +1419,8 @@ void va_TraceRenderPicture(
va_TraceMPEG4Buf(dpy, context, buffers[i], type, size, num_elements, pbuf + size*j);
}
break;
+ default:
+ break;
}
vaUnmapBuffer(dpy, buffers[i]);
@@ -1438,8 +1441,8 @@ void va_TraceEndPicture(
/* want to trace codedbuf, and it is encode */
if (trace_context[idx].trace_fp_codedbuf &&
- (trace_context[idx].trace_entrypoint == VAEntrypointEncSlice) ||
- (trace_context[idx].trace_entrypoint == VAEntrypointEncPicture)) {
+ ((trace_context[idx].trace_entrypoint == VAEntrypointEncSlice) ||
+ (trace_context[idx].trace_entrypoint == VAEntrypointEncPicture))) {
/* force the pipleline finish rendering */
vaSyncSurface(dpy, trace_context[idx].trace_rendertarget);
va_TraceCodedBuf(dpy);