FreeBSD Bugzilla – Attachment 172459 Details for
Bug 211077
multimedia/pwcview motionmask broken on svga
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
path for motion mask size
patch-pwcview.c.2 (text/plain), 1.96 KB, created by
you.akira.noda
on 2016-07-13 11:59:07 UTC
(
hide
)
Description:
path for motion mask size
Filename:
MIME Type:
Creator:
you.akira.noda
Created:
2016-07-13 11:59:07 UTC
Size:
1.96 KB
patch
obsolete
>--- pwcview.c.orig 2016-07-13 19:32:26.638524000 +0900 >+++ pwcview.c 2016-07-13 19:35:43.223649000 +0900 >@@ -58,6 +58,9 @@ > #define SCALE_NONE 0 > #define SCALE_DOUBLE 1 > #define SCALE_FULL 2 >+#define MAX_WIDTH 1600 >+#define MAX_HEIGHT 1200 >+ > int scale = SCALE_FULL; > > #ifndef NOGUI >@@ -865,7 +868,7 @@ > } > } > >-uint8_t motionmask[60][80]; >+uint8_t motionmask[MAX_HEIGHT/8][MAX_WIDTH/8]; > int detectmotion(unsigned char *buf, int width, int height) > { > static int newbuf; >@@ -1032,8 +1035,8 @@ > int ylast = (int)(event->button.y / divy); > int x, y; > >- for(y = ystart ;y >= 0 && y < 60 && y <= ylast; y++) >- for(x = xstart; x >= 0 && x < 80 && x <= xlast; x++) >+ for(y = ystart ;y >= 0 && y < MAX_HEIGHT/8 && y <= ylast; y++) >+ for(x = xstart; x >= 0 && x < MAX_WIDTH/8 && x <= xlast; x++) > motionmask[y][x] = (event->button.button == SDL_BUTTON_LEFT) ? 1 : 0; > xstart = ystart = -1; > } >@@ -1044,6 +1047,9 @@ > #undef PSZ_MAX > #endif > #define PSZ_MAX 10 >+/* with and heigt must be multible of 8*/ >+ >+ > struct { > char *name; > int width; >@@ -1271,7 +1277,7 @@ > } > > if((fdmask = open("pwcview.msk",O_RDONLY)) != -1) { >- read(fdmask,motionmask,60*80*sizeof(uint8_t)); >+ read(fdmask,motionmask,MAX_WIDTH*MAX_HEIGHT/8/8*sizeof(uint8_t)); > close(fdmask); > fprintf(stderr,"motion mask loaded\n"); > } >@@ -1432,7 +1438,7 @@ > break; > case SDLK_w: > if((fdmask = open("pwcview.msk",O_CREAT|O_TRUNC|O_WRONLY,0644)) != -1) { >- write(fdmask,motionmask,60*80*sizeof(uint8_t)); >+ write(fdmask,motionmask,MAX_WIDTH*MAX_HEIGHT/8/8*sizeof(uint8_t)); > close(fdmask); > fprintf(stderr,"motion mask saved\n"); > } >@@ -1483,7 +1489,7 @@ > else if(event.type == SDL_MOUSEBUTTONDOWN) { > if(showmask) { > if(event.button.button == SDL_BUTTON_MIDDLE) >- memset(motionmask,0,60*80*sizeof(uint8_t)); >+ memset(motionmask,0,MAX_WIDTH*MAX_HEIGHT/8/8*sizeof(uint8_t)); > else > createmask(&event,&rect,vw.width,vw.height); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211077
: 172459