Update of /cvsroot/okfw/okfw/src/hwl
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv10854
Modified Files:
okfw_host.c
Log Message:
Video emulation using ffmpeg.
Index: okfw_host.c
===================================================================
RCS file: /cvsroot/okfw/okfw/src/hwl/okfw_host.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- okfw_host.c 27 May 2006 18:44:27 -0000 1.1
+++ okfw_host.c 23 Feb 2008 16:03:48 -0000 1.2
@@ -11,45 +11,250 @@
#include "okfw.h"
#include "hwl/libfip/fip.h"
#include "hwl/ioports.h"
+#include "ffmpeg/avformat.h"
#include <pthread.h>
+#include <math.h>
-unsigned okfw_enc_buf;
-unsigned okfw_chunk1_buf;
-unsigned okfw_chunk2_buf;
+static int debug_frame_delay = 0;
[...2181 lines suppressed...]
+
+ pthread_mutex_lock(&q->mutex);
+ while(q->read == q->write)
+ {
+ // Queue is empty, wait for producer
+ pthread_cond_wait(&q->cond, &q->mutex);
+ }
+ data = q->elements[q->read].data;
+ *size = q->elements[q->read].size;
+
+ q->read = (q->read + 1) % q->size;
+
+ // Signal producer that we have removed an element on the queue.
+ pthread_cond_signal(&q->cond);
+ pthread_mutex_unlock(&q->mutex);
+ return data;
+}
/*
* Local Variables: ***
|