summaryrefslogtreecommitdiff
path: root/rMD-exp/src/encode_image_buffer.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-10-28 15:14:57 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-10-28 15:14:57 +0000
commit5076dbf5c8974316119d6bad42c413a3e3bf5ec9 (patch)
tree588c643d5219145f6947c41cda11d7d5e0e72b33 /rMD-exp/src/encode_image_buffer.c
parent29d2e46787bee6bc3a951734d40a215088d58692 (diff)
mostly changes on cache writting/loading/encoding,which is now functional.Also var other minor changes
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@124 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'rMD-exp/src/encode_image_buffer.c')
-rw-r--r--rMD-exp/src/encode_image_buffer.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/rMD-exp/src/encode_image_buffer.c b/rMD-exp/src/encode_image_buffer.c
index 2718d0e..0eb5bfb 100644
--- a/rMD-exp/src/encode_image_buffer.c
+++ b/rMD-exp/src/encode_image_buffer.c
@@ -62,4 +62,21 @@ void *EncodeImageBuffer(void *pdata){
pthread_exit(&errno);
}
-
+//this function is meant to be called normally
+//not through a thread of it's own
+void SyncEncodeImageBuffer(ProgData *pdata){
+ if(theora_encode_YUVin(&pdata->enc_data->m_th_st,
+ &pdata->enc_data->yuv)){
+ fprintf(stderr,"Encoder not ready!\n");
+ }
+ else{
+ if(theora_encode_packetout(&pdata->enc_data->m_th_st,0,
+ &pdata->enc_data->m_ogg_pckt1)==1){
+ pthread_mutex_lock(&pdata->libogg_mutex);
+ ogg_stream_packetin(&pdata->enc_data->m_ogg_ts,
+ &pdata->enc_data->m_ogg_pckt1);
+ pthread_mutex_unlock(&pdata->libogg_mutex);
+ pdata->avd+=pdata->frametime*2*pdata->args.channels;
+ }
+ }
+} \ No newline at end of file
© All Rights Reserved