summaryrefslogtreecommitdiff
path: root/rMD-exp/src/init_encoder.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-10-26 01:45:04 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-10-26 01:45:04 +0000
commit3370b5318c1845704ae95f1d919a37bb881f52f9 (patch)
treed66c14908d44b7ad404abbaf5b70bc8726a80b4d /rMD-exp/src/init_encoder.c
parentba11f851311f9f92f92fcd8148a8f621b736e979 (diff)
cache initialization, image flushing
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@115 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'rMD-exp/src/init_encoder.c')
-rw-r--r--rMD-exp/src/init_encoder.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/rMD-exp/src/init_encoder.c b/rMD-exp/src/init_encoder.c
index ed1ad53..34db2a7 100644
--- a/rMD-exp/src/init_encoder.c
+++ b/rMD-exp/src/init_encoder.c
@@ -27,7 +27,7 @@
#include <recordmydesktop.h>
-void InitEncoder(ProgData *pdata,EncData *enc_data_t){
+void InitEncoder(ProgData *pdata,EncData *enc_data_t,int buffer_ready){
int y1,y2;
(pdata)->enc_data=enc_data_t;
srand(time(NULL));
@@ -150,19 +150,20 @@ void InitEncoder(ProgData *pdata,EncData *enc_data_t){
}
+ if(!buffer_ready){
+ (enc_data_t)->yuv.y=(unsigned char *)malloc((enc_data_t)->m_th_inf.height*(enc_data_t)->m_th_inf.width);
+ (enc_data_t)->yuv.u=(unsigned char *)malloc((enc_data_t)->m_th_inf.height*(enc_data_t)->m_th_inf.width/4);
+ (enc_data_t)->yuv.v=(unsigned char *)malloc((enc_data_t)->m_th_inf.height*(enc_data_t)->m_th_inf.width/4);
+ (enc_data_t)->yuv.y_width=(enc_data_t)->m_th_inf.width;
+ (enc_data_t)->yuv.y_height=(enc_data_t)->m_th_inf.height;
+ (enc_data_t)->yuv.y_stride=(enc_data_t)->m_th_inf.width;
- (enc_data_t)->yuv.y=(unsigned char *)malloc((enc_data_t)->m_th_inf.height*(enc_data_t)->m_th_inf.width);
- (enc_data_t)->yuv.u=(unsigned char *)malloc((enc_data_t)->m_th_inf.height*(enc_data_t)->m_th_inf.width/4);
- (enc_data_t)->yuv.v=(unsigned char *)malloc((enc_data_t)->m_th_inf.height*(enc_data_t)->m_th_inf.width/4);
- (enc_data_t)->yuv.y_width=(enc_data_t)->m_th_inf.width;
- (enc_data_t)->yuv.y_height=(enc_data_t)->m_th_inf.height;
- (enc_data_t)->yuv.y_stride=(enc_data_t)->m_th_inf.width;
-
- (enc_data_t)->yuv.uv_width=(enc_data_t)->m_th_inf.width/2;
- (enc_data_t)->yuv.uv_height=(enc_data_t)->m_th_inf.height/2;
- (enc_data_t)->yuv.uv_stride=(enc_data_t)->m_th_inf.width/2;
- (enc_data_t)->x_offset=(enc_data_t)->m_th_inf.offset_x;
- (enc_data_t)->y_offset=(enc_data_t)->m_th_inf.offset_y;
+ (enc_data_t)->yuv.uv_width=(enc_data_t)->m_th_inf.width/2;
+ (enc_data_t)->yuv.uv_height=(enc_data_t)->m_th_inf.height/2;
+ (enc_data_t)->yuv.uv_stride=(enc_data_t)->m_th_inf.width/2;
+ (enc_data_t)->x_offset=(enc_data_t)->m_th_inf.offset_x;
+ (enc_data_t)->y_offset=(enc_data_t)->m_th_inf.offset_y;
+ }
theora_info_clear(&(enc_data_t)->m_th_inf);
}
© All Rights Reserved