diff --git a/viddec3test.c b/viddec3test.c
index dc50391a1d8432e54af66bdf6a90dc9991dbe964..3788d6eef8553ba0210a0c5d39b58393d1f6b275 100644 (file)
--- a/viddec3test.c
+++ b/viddec3test.c
static struct decoder *
decoder_open(int argc, char **argv)
{
- struct decoder *decoder = NULL;
+ static struct decoder *decoder = NULL;
char *infile = NULL;
int i;
- int width, height, padded_width, padded_height;
+ static int width, height, padded_width, padded_height;
Engine_Error ec;
XDAS_Int32 err;
return -1;
}
decoder->lastOutBuf = buf;
+
+ inArgs->inputID = (XDAS_Int32)buf;
+ outBufs->descs[0].buf = buf->fd[0];
+ outBufs->descs[1].buf = (buf->multiplanar) ?buf->fd[1]:(XDAS_Int8 *)((outBufs->descs[0].buf));
+
+ if(buf->multiplanar){
+ decoder->outBuf_fd[0] = buf->fd[0];
+ decoder->outBuf_fd[1] = buf->fd[1];
+ dce_buf_lock(2,decoder->outBuf_fd);
+ }
+ else{
+ decoder->outBuf_fd[0] = buf->fd[0];
+ dce_buf_lock(1,decoder->outBuf_fd);
+ }
+ decoder->outBufs->descs[0].bufSize.bytes =decoder->padded_width*decoder->padded_height;
+ decoder->outBufs->descs[1].bufSize.bytes = decoder->padded_width* (decoder->padded_height/2);
}
else{
/*For second field decoding, send last output buffer
break;
}
- /*set the parameters if it is not the end of file */
- if (!eof) {
- inArgs->inputID = (XDAS_Int32)buf;
- outBufs->descs[0].buf = buf->fd[0];
- outBufs->descs[1].buf = (buf->multiplanar) ?buf->fd[1]:(XDAS_Int8 *)((outBufs->descs[0].buf));
-
- if(decoder->outBufsInUseFlag == XDAS_FALSE){
- if(buf->multiplanar){
- decoder->outBuf_fd[0] = buf->fd[0];
- decoder->outBuf_fd[1] = buf->fd[1];
- dce_buf_lock(2,decoder->outBuf_fd);
- }
- else{
- decoder->outBuf_fd[0] = buf->fd[0];
- dce_buf_lock(1,decoder->outBuf_fd);
- }
- decoder->outBufs->descs[0].bufSize.bytes =decoder->padded_width*decoder->padded_height;
- decoder->outBufs->descs[1].bufSize.bytes = decoder->padded_width* (decoder->padded_height/2);
- }
- }
do {
if (no_process) {
}
if(freeBufCount){
- if(!eof)dce_buf_unlock(freeBufCount,decoder->outBuf_fd);
+ dce_buf_unlock(freeBufCount,decoder->outBuf_fd);
freeBufCount =0;
}