From 5076dbf5c8974316119d6bad42c413a3e3bf5ec9 Mon Sep 17 00:00:00 2001 From: iovar Date: Sat, 28 Oct 2006 15:14:57 +0000 Subject: 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 --- rMD-exp/src/encode_image_buffer.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'rMD-exp/src/encode_image_buffer.c') 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 -- cgit v1.2.3