summaryrefslogtreecommitdiff
path: root/recordmydesktop
diff options
context:
space:
mode:
Diffstat (limited to 'recordmydesktop')
-rw-r--r--recordmydesktop/include/rmdmacro.h202
-rw-r--r--recordmydesktop/include/rmdtypes.h14
-rw-r--r--recordmydesktop/src/get_frame.c45
-rw-r--r--recordmydesktop/src/initialize_data.c33
-rw-r--r--recordmydesktop/src/recordmydesktop.c4
-rw-r--r--recordmydesktop/src/update_image.c36
6 files changed, 95 insertions, 239 deletions
diff --git a/recordmydesktop/include/rmdmacro.h b/recordmydesktop/include/rmdmacro.h
index b8e529a..31cb52d 100644
--- a/recordmydesktop/include/rmdmacro.h
+++ b/recordmydesktop/include/rmdmacro.h
@@ -51,9 +51,9 @@
#error Only little-endian and big-endian systems are supported
#endif
-#define __RVALUE(tmp_val) (((tmp_val)&0x00ff0000)>>16)
-#define __GVALUE(tmp_val) (((tmp_val)&0x0000ff00)>>8)
-#define __BVALUE(tmp_val) (((tmp_val)&0x000000ff))
+#define __RVALUE_32(tmp_val) (((tmp_val)&0x00ff0000)>>16)
+#define __GVALUE_32(tmp_val) (((tmp_val)&0x0000ff00)>>8)
+#define __BVALUE_32(tmp_val) (((tmp_val)&0x000000ff))
//xfixes pointer data are written as unsigned long
//(even though the server returns CARD32)
@@ -183,190 +183,84 @@
data_array[(k_tm*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset]+\
data_array[((k_tm-1)*width_img+i_tm-1)*RMD_ULONG_SIZE_T+offset])/4)
-#define UPDATE_YUV_BUFFER_SH(yuv,data,x_tm,y_tm,width_tm,height_tm){\
- int k,i;\
- register unsigned int t_val;\
- register unsigned int *datapi=(unsigned int*)data+x_tm+y_tm*yuv->y_width;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb,\
- *_ur=Ur,*_ug=Ug,*_ub=Ub,\
- *_vr=Vr,*_vg=Vg,*_vb=Vb;\
-\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE(t_val)] + _yg[__GVALUE(t_val)] + _yb[__BVALUE(t_val)] ;\
- datapi++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
- datapi+=yuv->y_width-width_tm;\
- }\
- datapi=(unsigned int*)data+x_tm+y_tm*yuv->y_width;\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- t_val=*datapi;\
- *yuv_u=\
- _ur[__RVALUE(t_val)] + _ug[__GVALUE(t_val)] + _ub[__BVALUE(t_val)];\
- *yuv_v=\
- _vr[__RVALUE(t_val)] + _vg[__GVALUE(t_val)] + _vb[__BVALUE(t_val)];\
- datapi+=2;\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=(2*yuv->y_width-width_tm);\
- }\
+#define CALC_TVAL_AVG_32(t_val,datapi,datapi_next){\
+ register unsigned int t1,t2,t3,t4;\
+ t1=*datapi;\
+ t2=*(datapi+1);\
+ t3=*datapi_next;\
+ t4=*(datapi_next+1);\
+ t_val=((((t1&0xff000000) +(t2&0xff000000)+\
+ (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000) \
+ +((((t1&0x00ff0000) +(t2&0x00ff0000)+\
+ (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)\
+ +((((t1&0x0000ff00) +(t2&0x0000ff00)+\
+ (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)\
+ +((((t1&0x000000ff) +(t2&0x000000ff)+\
+ (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\
}
-#define UPDATE_YUV_BUFFER_SH_AVG(yuv,data,x_tm,y_tm,width_tm,height_tm){\
+#define UPDATE_Y_PLANE_32(data,x_tm,y_tm,height_tm,width_tm,yuv,__copy_type){ \
int k,i;\
- register unsigned int t_val,t1,t2,t3,t4;\
- register unsigned int *datapi=(unsigned int*)data+x_tm+y_tm*yuv->y_width,\
- *datapi_next=(unsigned int*)data+x_tm+(y_tm+1)*yuv->y_width;\
+ register unsigned int t_val;\
register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb,\
- *_ur=Ur,*_ug=Ug,*_ub=Ub,\
- *_vr=Vr,*_vg=Vg,*_vb=Vb;\
-\
+ *_yr=Yr,*_yg=Yg,*_yb=Yb;\
+ register unsigned int *datapi=(unsigned int*)data+\
+ ((__copy_type==__X_SHARED)?(x_tm+y_tm*yuv->y_width):0);\
for(k=0;k<height_tm;k++){\
for(i=0;i<width_tm;i++){\
t_val=*datapi;\
- *yuv_y=_yr[__RVALUE(t_val)] + _yg[__GVALUE(t_val)] + _yb[__BVALUE(t_val)] ;\
+ *yuv_y=_yr[__RVALUE_32(t_val)] + _yg[__GVALUE_32(t_val)] + _yb[__BVALUE_32(t_val)] ;\
datapi++;\
yuv_y++;\
}\
yuv_y+=yuv->y_width-width_tm;\
- datapi+=yuv->y_width-width_tm;\
- }\
- datapi=(unsigned int*)data+x_tm+y_tm*yuv->y_width;\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- t1=*datapi;\
- t2=*(datapi+1);\
- t3=*datapi_next;\
- t4=*(datapi_next+1);\
- t_val=((((t1&0xff000000) +(t2&0xff000000)+\
- (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000) \
- +((((t1&0x00ff0000) +(t2&0x00ff0000)+\
- (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)\
- +((((t1&0x0000ff00) +(t2&0x0000ff00)+\
- (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)\
- +((((t1&0x000000ff) +(t2&0x000000ff)+\
- (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\
-\
- *yuv_u=\
- _ur[__RVALUE(t_val)] + _ug[__GVALUE(t_val)] + _ub[__BVALUE(t_val)];\
- *yuv_v=\
- _vr[__RVALUE(t_val)] + _vg[__GVALUE(t_val)] + _vb[__BVALUE(t_val)];\
- datapi+=2;\
- datapi_next+=2;\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=(2*yuv->y_width-width_tm);\
- datapi_next+=(2*yuv->y_width-width_tm);\
+ if(__copy_type==__X_SHARED)\
+ datapi+=yuv->y_width-width_tm;\
}\
}
-
-
-#define UPDATE_YUV_BUFFER_IM(yuv,data,x_tm,y_tm,width_tm,height_tm){\
+#define UPDATE_UV_PLANES_32(data,x_tm,y_tm,height_tm,width_tm,yuv,__copy_type,__sampling_type){ \
int k,i;\
register unsigned int t_val;\
- register unsigned int *datapi=(unsigned int*)data;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
+ register unsigned char *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
*yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb,\
*_ur=Ur,*_ug=Ug,*_ub=Ub,\
*_vr=Vr,*_vg=Vg,*_vb=Vb;\
-\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE(t_val)] + _yg[__GVALUE(t_val)] + _yb[__BVALUE(t_val)] ;\
- datapi++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
+ register unsigned int *datapi=(unsigned int*)data+\
+ ((__copy_type==__X_SHARED)?(x_tm+y_tm*yuv->y_width):0),\
+ *datapi_next=NULL;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ datapi_next=datapi+\
+ ((__copy_type==__X_SHARED)?(yuv->y_width):(width_tm));\
}\
- datapi=(unsigned int*)data;\
for(k=0;k<height_tm;k+=2){\
for(i=0;i<width_tm;i+=2){\
- t_val=*datapi;\
+ if(__sampling_type==__PXL_AVERAGE){\
+ CALC_TVAL_AVG_32(t_val,datapi,datapi_next)\
+ }\
+ else\
+ t_val=*datapi;\
*yuv_u=\
- _ur[__RVALUE(t_val)] + _ug[__GVALUE(t_val)] + _ub[__BVALUE(t_val)];\
+ _ur[__RVALUE_32(t_val)] + _ug[__GVALUE_32(t_val)] + _ub[__BVALUE_32(t_val)];\
*yuv_v=\
- _vr[__RVALUE(t_val)] + _vg[__GVALUE(t_val)] + _vb[__BVALUE(t_val)];\
+ _vr[__RVALUE_32(t_val)] + _vg[__GVALUE_32(t_val)] + _vb[__BVALUE_32(t_val)];\
datapi+=2;\
+ if(__sampling_type==__PXL_AVERAGE)\
+ datapi_next+=2;\
yuv_u++;\
yuv_v++;\
}\
yuv_u+=(yuv->y_width-width_tm)/2;\
yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
+ datapi+=((__copy_type==__X_SHARED)?(2*yuv->y_width-width_tm):width_tm);\
+ if(__sampling_type==__PXL_AVERAGE)\
+ datapi_next+=((__copy_type==__X_SHARED)?(2*yuv->y_width-width_tm):width_tm);\
}\
}
-#define UPDATE_YUV_BUFFER_IM_AVG(yuv,data,x_tm,y_tm,width_tm,height_tm){\
- int k,i;\
- register unsigned int t_val,t1,t2,t3,t4;\
- register unsigned int *datapi=(unsigned int*)data,\
- *datapi_next=(unsigned int*)data+width_tm;\
- register unsigned char *yuv_y=yuv->y+x_tm+y_tm*yuv->y_width,\
- *yuv_u=yuv->u+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *yuv_v=yuv->v+x_tm/2+(y_tm*yuv->uv_width)/2,\
- *_yr=Yr,*_yg=Yg,*_yb=Yb,\
- *_ur=Ur,*_ug=Ug,*_ub=Ub,\
- *_vr=Vr,*_vg=Vg,*_vb=Vb;\
-\
- for(k=0;k<height_tm;k++){\
- for(i=0;i<width_tm;i++){\
- t_val=*datapi;\
- *yuv_y=_yr[__RVALUE(t_val)] + _yg[__GVALUE(t_val)] + _yb[__BVALUE(t_val)] ;\
- datapi++;\
- yuv_y++;\
- }\
- yuv_y+=yuv->y_width-width_tm;\
- }\
- datapi=(unsigned int*)data;\
- for(k=0;k<height_tm;k+=2){\
- for(i=0;i<width_tm;i+=2){\
- t1=*datapi;\
- t2=*(datapi+1);\
- t3=*datapi_next;\
- t4=*(datapi_next+1);\
- t_val=((((t1&0xff000000) +(t2&0xff000000)+\
- (t3&0xff000000)+(t4&0xff000000))/4)&0xff000000) \
- +((((t1&0x00ff0000) +(t2&0x00ff0000)+\
- (t3&0x00ff0000)+(t4&0x00ff0000))/4)&0x00ff0000)\
- +((((t1&0x0000ff00) +(t2&0x0000ff00)+\
- (t3&0x0000ff00)+(t4&0x0000ff00))/4)&0x0000ff00)\
- +((((t1&0x000000ff) +(t2&0x000000ff)+\
- (t3&0x000000ff)+(t4&0x000000ff))/4)&0x000000ff);\
-\
- *yuv_u=\
- _ur[__RVALUE(t_val)] + _ug[__GVALUE(t_val)] + _ub[__BVALUE(t_val)];\
- *yuv_v=\
- _vr[__RVALUE(t_val)] + _vg[__GVALUE(t_val)] + _vb[__BVALUE(t_val)];\
- datapi+=2;\
- datapi_next+=2;\
- yuv_u++;\
- yuv_v++;\
- }\
- yuv_u+=(yuv->y_width-width_tm)/2;\
- yuv_v+=(yuv->y_width-width_tm)/2;\
- datapi+=width_tm;\
- datapi_next+=width_tm;\
- }\
+#define UPDATE_YUV_BUFFER(yuv,data,x_tm,y_tm,width_tm,height_tm,__copy_type,__sampling_type){\
+ UPDATE_Y_PLANE_32(data,x_tm,y_tm,height_tm,width_tm,yuv,__copy_type)\
+ UPDATE_UV_PLANES_32(data,x_tm,y_tm,height_tm,width_tm,yuv,__copy_type,__sampling_type)\
}
diff --git a/recordmydesktop/include/rmdtypes.h b/recordmydesktop/include/rmdtypes.h
index b52817c..870abe4 100644
--- a/recordmydesktop/include/rmdtypes.h
+++ b/recordmydesktop/include/rmdtypes.h
@@ -61,6 +61,18 @@
#include <ogg/ogg.h>
#include <alsa/asoundlib.h>
+//how we obtained the image we are converting to yuv
+enum{
+ __X_SHARED, //through MIT/Shm
+ __X_IPC //through the regular X IPC mechanism
+};
+//type of pixel proccessing for the Cb,Cr planes
+//when converting from full rgb to 4:2:2 Ycbcr
+enum{
+ __PXL_DISCARD, //only select 1 pixel in every block of four
+ __PXL_AVERAGE //calculate the average of all four pixels
+};
+
typedef struct _DisplaySpecs{ //this struct holds some basic information
int screen; //about the display,needed mostly for
uint width; //validity checks at startup
@@ -221,8 +233,6 @@ typedef struct _ProgData{
pthread_mutex_t list_mutex[2],//mutexes for concurrency protection of the lists
sound_buffer_mutex,
libogg_mutex,//libogg is not thread safe,
-// libtheora_mutex,//same for libtheora
-// libvorbis_mutex,//and libvorbis.
yuv_mutex;//this might not be needed since we only have
//one read-only and one write-only thread
//also on previous versions, y component was looped separately
diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c
index d020f97..d3fb2ab 100644
--- a/recordmydesktop/src/get_frame.c
+++ b/recordmydesktop/src/get_frame.c
@@ -29,6 +29,8 @@
void *GetFrame(ProgData *pdata){
int tlist_sel=0;
+ unsigned char *dtap=NULL; //pointer switching among shared memory and
+ //normal buffer
pthread_mutex_t pmut,tmut;
uint msk_ret;
WGeometry mouse_pos_abs,mouse_pos_rel,mouse_pos_temp;
@@ -76,9 +78,6 @@ void *GetFrame(ProgData *pdata){
level*=100;
level/=pixel_total;
pdata->args.noshared=(level<pdata->args.shared_thres);
-// if(!pdata->args.noshared){
-// fprintf(stderr,"shared screenshot with %d\n",level);
-// }
}
}
if(pdata->args.xfixes_cursor){
@@ -126,6 +125,10 @@ void *GetFrame(ProgData *pdata){
pdata->args.noshared,
pdata->args.no_quick_subsample);
else{
+
+ dtap=(((pdata->args.nocondshared)&&(!pdata->args.noshared))?
+ ((unsigned char*)pdata->shimage->data):
+ ((unsigned char*)pdata->image->data));
if(pdata->args.noshared){
GetZPixmap( pdata->dpy,
pdata->specs.root,
@@ -134,34 +137,16 @@ void *GetFrame(ProgData *pdata){
pdata->brwin.rgeom.y,
pdata->brwin.rgeom.width,
pdata->brwin.rgeom.height);
- pthread_mutex_lock(&pdata->yuv_mutex);
- if(pdata->args.no_quick_subsample){
- UPDATE_YUV_BUFFER_IM_AVG((&pdata->enc_data->yuv),((unsigned char*)pdata->image->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- else{
- UPDATE_YUV_BUFFER_IM((&pdata->enc_data->yuv),((unsigned char*)pdata->image->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- pthread_mutex_unlock(&pdata->yuv_mutex);
- }
- else{
- pthread_mutex_lock(&pdata->yuv_mutex);
- if(pdata->args.no_quick_subsample){
- UPDATE_YUV_BUFFER_IM_AVG((&pdata->enc_data->yuv),((unsigned char*)pdata->shimage->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- else{
- UPDATE_YUV_BUFFER_IM((&pdata->enc_data->yuv),((unsigned char*)pdata->shimage->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
-
- pthread_mutex_unlock(&pdata->yuv_mutex);
}
+ pthread_mutex_lock(&pdata->yuv_mutex);
+ UPDATE_YUV_BUFFER((&pdata->enc_data->yuv),dtap,
+ (pdata->enc_data->x_offset),
+ (pdata->enc_data->y_offset),
+ (pdata->brwin.rgeom.width),
+ (pdata->brwin.rgeom.height),
+ pdata->args.noshared,
+ pdata->args.no_quick_subsample);
+ pthread_mutex_unlock(&pdata->yuv_mutex);
}
if(pdata->args.xfixes_cursor){
//avoid segfaults
diff --git a/recordmydesktop/src/initialize_data.c b/recordmydesktop/src/initialize_data.c
index f06d71e..2a710b5 100644
--- a/recordmydesktop/src/initialize_data.c
+++ b/recordmydesktop/src/initialize_data.c
@@ -31,6 +31,8 @@ int InitializeData(ProgData *pdata,
EncData *enc_data,
CacheData *cache_data){
int i;
+ unsigned char *dtap=NULL; //pointer switching among shared memory and
+ //normal buffer
//these are globals, look for them at the header
frames_total=frames_lost=encoder_busy=capture_busy=0;
@@ -115,30 +117,15 @@ int InitializeData(ProgData *pdata,
pdata->enc_data->yuv.v[i]=pdata->enc_data->yuv.u[i]=127;
}
- if((pdata->args.nocondshared)&&(!pdata->args.noshared)){
- if(pdata->args.no_quick_subsample){
- UPDATE_YUV_BUFFER_IM_AVG((&pdata->enc_data->yuv),((unsigned char*)pdata->shimage->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- else{
- UPDATE_YUV_BUFFER_IM((&pdata->enc_data->yuv),((unsigned char*)pdata->shimage->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- }
- else{
- if(pdata->args.no_quick_subsample){
- UPDATE_YUV_BUFFER_IM_AVG((&pdata->enc_data->yuv),((unsigned char*)pdata->image->data),
- (pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- else{
- UPDATE_YUV_BUFFER_IM((&pdata->enc_data->yuv),((unsigned char*)pdata->image->data),
+ dtap=(((pdata->args.nocondshared)&&(!pdata->args.noshared))?
+ ((unsigned char*)pdata->shimage->data):
+ ((unsigned char*)pdata->image->data));
+
+
+ UPDATE_YUV_BUFFER((&pdata->enc_data->yuv),dtap,
(pdata->enc_data->x_offset),(pdata->enc_data->y_offset),
- (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height));
- }
- }
+ (pdata->brwin.rgeom.width),(pdata->brwin.rgeom.height),
+ __X_IPC,(pdata->args.no_quick_subsample));
pdata->frametime=(1000000)/pdata->args.fps;
diff --git a/recordmydesktop/src/recordmydesktop.c b/recordmydesktop/src/recordmydesktop.c
index decc86d..7f41e6e 100644
--- a/recordmydesktop/src/recordmydesktop.c
+++ b/recordmydesktop/src/recordmydesktop.c
@@ -54,8 +54,8 @@ int main(int argc,char **argv){
CacheData cache_data;
QUERY_DISPLAY_SPECS(pdata.dpy,&pdata.specs);
- if(pdata.specs.depth!=24){
- fprintf(stderr,"Only 24bpp color depth mode is currently supported.\n");
+ if((pdata.specs.depth!=32)&&(pdata.specs.depth!=24)&&(pdata.specs.depth!=16)){
+ fprintf(stderr,"Only 32bpp,24bpp and 16bpp color depth modes are currently supported.\n");
exit(10);
}
if(SetBRWindow(pdata.dpy,&pdata.brwin,&pdata.specs,&pdata.args))
diff --git a/recordmydesktop/src/update_image.c b/recordmydesktop/src/update_image.c
index 2725011..1bf0cd5 100644
--- a/recordmydesktop/src/update_image.c
+++ b/recordmydesktop/src/update_image.c
@@ -40,7 +40,7 @@ void UpdateImage(Display * dpy,
RectArea *temp;
unsigned char *dtap=(unsigned char*)datatemp;
temp=*root;
-
+
if(temp!=NULL){
do{
if(noshmem){
@@ -51,34 +51,14 @@ void UpdateImage(Display * dpy,
temp->geom.y,
temp->geom.width,
temp->geom.height);
-
- pthread_mutex_lock(yuv_mutex);
- if(no_quick_subsample){
- UPDATE_YUV_BUFFER_IM_AVG(yuv,dtap,
- (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset),
- (temp->geom.width),(temp->geom.height));
- }
- else{
- UPDATE_YUV_BUFFER_IM(yuv,dtap,
- (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset),
- (temp->geom.width),(temp->geom.height));
- }
-
- pthread_mutex_unlock(yuv_mutex);
- }
- else{
- if(no_quick_subsample){
- UPDATE_YUV_BUFFER_SH_AVG(yuv,dtap,
- (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset),
- (temp->geom.width),(temp->geom.height));
- }
- else{
- UPDATE_YUV_BUFFER_SH(yuv,dtap,
- (temp->geom.x-brwin->rgeom.x+enc->x_offset),(temp->geom.y-brwin->rgeom.y+enc->y_offset),
- (temp->geom.width),(temp->geom.height));
- }
-
}
+ pthread_mutex_lock(yuv_mutex);
+ UPDATE_YUV_BUFFER(yuv,dtap,
+ (temp->geom.x-brwin->rgeom.x+enc->x_offset),
+ (temp->geom.y-brwin->rgeom.y+enc->y_offset),
+ (temp->geom.width),(temp->geom.height),
+ noshmem,no_quick_subsample);
+ pthread_mutex_unlock(yuv_mutex);
temp=temp->next;
}while(temp!=NULL);
}
© All Rights Reserved