summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/get_frame.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-03-13 19:58:05 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-03-13 19:58:05 +0000
commit25a6bc31f431f59147739876f1d9a96340b65fb2 (patch)
tree818ca96f721cbc42da2ff9f8b18afde4c40fe830 /recordmydesktop/src/get_frame.c
parentee0b215b94e92a1592a9f7c817c8dd0acefdce83 (diff)
fixed xdamage with xshm and
removed anything related to conditional shared memory usage. Added GetZPixmapShm.Cleaned up pdata stuct from unneeded members. Removed argumednts related to conditional shared (--no-cond-shared, --shared threshold).Changed default for Shm and --with-shared is now --no-shared. Also, dummy cursor has been shaped up a bit. Version changed to 0.3.4-cvs. git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@293 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/get_frame.c')
-rw-r--r--recordmydesktop/src/get_frame.c52
1 files changed, 15 insertions, 37 deletions
diff --git a/recordmydesktop/src/get_frame.c b/recordmydesktop/src/get_frame.c
index 87e71aa..635a868 100644
--- a/recordmydesktop/src/get_frame.c
+++ b/recordmydesktop/src/get_frame.c
@@ -29,12 +29,9 @@
void *GetFrame(ProgData *pdata){
int tlist_sel=0;
- unsigned char *dtap=NULL; //pointer switching among shared memory and
- //normal buffer
uint msk_ret;
WGeometry mouse_pos_abs,mouse_pos_rel,mouse_pos_temp;
Window root_ret,child_ret;
- int pixel_total=pdata->brwin.rgeom.width*pdata->brwin.rgeom.height;
XFixesCursorImage *xcim=NULL;
mouse_pos_abs.x=mouse_pos_temp.x=0;
@@ -64,21 +61,6 @@ void *GetFrame(ProgData *pdata){
pdata->list_selector=((pdata->list_selector+1)%2);
pthread_mutex_lock(&pdata->list_mutex[tlist_sel]);
}
- //here we measure the list and decide which way we will go
- if(!pdata->args.nocondshared){
- int level=0;
- RectArea *temp=pdata->rect_root[tlist_sel];
-
- if(temp!=NULL){
- do{
- level+=temp->geom.width*temp->geom.height;
- temp=temp->next;
- }while(temp!=NULL);
- level*=100;
- level/=pixel_total;
- pdata->args.noshared=(level<pdata->args.shared_thres);
- }
- }
if(pdata->args.xfixes_cursor){
//xfixes pointer sequence
//update previous_position
@@ -118,10 +100,6 @@ void *GetFrame(ProgData *pdata){
&mouse_pos_abs.x,&mouse_pos_abs.y,
&mouse_pos_rel.x,&mouse_pos_rel.y,&msk_ret);
}
- if(!pdata->args.noshared)
- XShmGetImage(pdata->dpy,pdata->specs.root,pdata->shimage,
- (pdata->brwin.rgeom.x),
- (pdata->brwin.rgeom.y),AllPlanes);
if(!pdata->args.full_shots)
UpdateImage(pdata->dpy,
&pdata->enc_data->yuv,
@@ -130,16 +108,16 @@ void *GetFrame(ProgData *pdata){
&pdata->rect_root[tlist_sel],
&pdata->brwin,
pdata->enc_data,
- ((pdata->args.noshared)?
- (pdata->datatemp):
- (pdata->shimage->data)),
+ pdata->image->data,
pdata->args.noshared,
+ &pdata->shminfo,
+ pdata->shm_opcode,
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)
+ XShmGetImage(pdata->dpy,pdata->specs.root,pdata->image,
+ (pdata->brwin.rgeom.x),
+ (pdata->brwin.rgeom.y),AllPlanes);
if(pdata->args.noshared){
GetZPixmap( pdata->dpy,
pdata->specs.root,
@@ -150,14 +128,14 @@ void *GetFrame(ProgData *pdata){
pdata->brwin.rgeom.height);
}
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,
- pdata->specs.depth);
+ UPDATE_YUV_BUFFER((&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),
+ pdata->args.no_quick_subsample,
+ pdata->specs.depth);
pthread_mutex_unlock(&pdata->yuv_mutex);
}
if(pdata->args.xfixes_cursor){
© All Rights Reserved