Update of /cvsroot/playerstage/code/player/server/drivers/blobfinder/acts
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4552/server/drivers/blobfinder/acts

Modified Files:
      Tag: release-2-0-patches
        acts.cc 
Log Message:
backported lots of stuff from HEAD

Index: acts.cc
===================================================================
RCS file: 
/cvsroot/playerstage/code/player/server/drivers/blobfinder/acts/acts.cc,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** acts.cc     23 Feb 2006 18:54:54 -0000      1.3
--- acts.cc     7 Jun 2006 16:12:39 -0000       1.3.2.1
***************
*** 152,161 ****
  #include <stdlib.h>  /* for atexit(3),atoi(3) */
  #include <pthread.h>  /* for pthread stuff */
! #include <socket_util.h>
  
! #include "drivertable.h"
! #include "driver.h"
! #include "error.h"
! #include "player.h"
  
  #define ACTS_NUM_CHANNELS 32
--- 152,158 ----
  #include <stdlib.h>  /* for atexit(3),atoi(3) */
  #include <pthread.h>  /* for pthread stuff */
! //#include <socket_util.h>
  
! #include <libplayercore/playercore.h>
  
  #define ACTS_NUM_CHANNELS 32
***************
*** 334,338 ****
  
  Acts::Acts( ConfigFile* cf, int section)
!   : Driver(cf, section, true, PLAYER_MSGQUEUE_DEFAULT_MAXLEN, 
PLAYER_BLOBFINDER_CODE, PLAYER_ALL_MODE)
  {
    char tmpstr[MAX_FILENAME_SIZE];
--- 331,335 ----
  
  Acts::Acts( ConfigFile* cf, int section)
!   : Driver(cf, section, true, PLAYER_MSGQUEUE_DEFAULT_MAXLEN, 
PLAYER_BLOBFINDER_CODE)
  {
    char tmpstr[MAX_FILENAME_SIZE];
***************
*** 867,871 ****
          // TODO: put a descriptive color in here (I'm not sure where
          // to get it from).
!         acts_data.blobs[i].color = htonl(0xFF0000);
          
          // get the 4-byte area first
--- 864,868 ----
          // TODO: put a descriptive color in here (I'm not sure where
          // to get it from).
!         acts_data.blobs[i].color = 0xFF0000;
          
          // get the 4-byte area first
***************
*** 876,899 ****
            acts_data.blobs[i].area |= acts_blob_buf[tmpptr++] - 1;
          }
-         acts_data.blobs[i].area = htonl(acts_data.blobs[i].area);
  
!         // convert the other 6 one-byte entries to byte-swapped shorts
          acts_data.blobs[i].x = acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].x = htons(acts_data.blobs[i].x);
- 
          acts_data.blobs[i].y = acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].y = htons(acts_data.blobs[i].y);
- 
          acts_data.blobs[i].left = acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].left = htons(acts_data.blobs[i].left);
- 
          acts_data.blobs[i].right = acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].right = htons(acts_data.blobs[i].right);
- 
          acts_data.blobs[i].top = acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].top = htons(acts_data.blobs[i].top);
- 
          acts_data.blobs[i].bottom = acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].bottom = htons(acts_data.blobs[i].bottom);
        }
      }
--- 873,884 ----
            acts_data.blobs[i].area |= acts_blob_buf[tmpptr++] - 1;
          }
  
!         // store the 1 byte values
          acts_data.blobs[i].x = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].y = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].left = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].right = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].top = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].bottom = acts_blob_buf[tmpptr++] - 1;
        }
      }
***************
*** 909,914 ****
          for (int j = 0; j < ACTS_MAX_CHANNELS; j++)
          {
!           if (i >= ntohs(acts_data.header[j].index) &&
!               i < ntohs(acts_data.header[j].index) + 
ntohs(acts_data.header[j].num))
            {
              ch = j;
--- 894,899 ----
          for (int j = 0; j < ACTS_MAX_CHANNELS; j++)
          {
!           if (i >= acts_data.header[j].index &&
!               i < acts_data.header[j].index + acts_data.header[j].num)
            {
              ch = j;
***************
*** 919,925 ****
          // Put in a descriptive color.
          if (ch < (int) (sizeof(colors) / sizeof(colors[0])))
!           acts_data.blobs[i].color = htonl(colors[ch]);            
          else
!           acts_data.blobs[i].color = htonl(0xFF0000);
          
          // get the 4-byte area first
--- 904,910 ----
          // Put in a descriptive color.
          if (ch < (int) (sizeof(colors) / sizeof(colors[0])))
!           acts_data.blobs[i].color = colors[ch];            
          else
!           acts_data.blobs[i].color = 0xFF0000;
          
          // get the 4-byte area first
***************
*** 930,965 ****
            acts_data.blobs[i].area |= acts_blob_buf[tmpptr++] - 1;
          }
-         acts_data.blobs[i].area = htonl(acts_data.blobs[i].area);
          
!         // convert the other 6 two-byte entries to byte-swapped shorts
          acts_data.blobs[i].x = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].x = acts_data.blobs[i].x << 6;
          acts_data.blobs[i].x |= acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].x = htons(acts_data.blobs[i].x);
  
          acts_data.blobs[i].y = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].y = acts_data.blobs[i].y << 6;
          acts_data.blobs[i].y |= acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].y = htons(acts_data.blobs[i].y);
  
          acts_data.blobs[i].left = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].left = acts_data.blobs[i].left << 6;
          acts_data.blobs[i].left |= acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].left = htons(acts_data.blobs[i].left);
  
          acts_data.blobs[i].right = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].right = acts_data.blobs[i].right << 6;
          acts_data.blobs[i].right |= acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].right = htons(acts_data.blobs[i].right);
  
          acts_data.blobs[i].top = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].top = acts_data.blobs[i].top << 6;
          acts_data.blobs[i].top |= acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].top = htons(acts_data.blobs[i].top);
  
          acts_data.blobs[i].bottom = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].bottom = acts_data.blobs[i].bottom << 6;
          acts_data.blobs[i].bottom |= acts_blob_buf[tmpptr++] - 1;
-         acts_data.blobs[i].bottom = htons(acts_data.blobs[i].bottom);
        }
      }
--- 915,943 ----
            acts_data.blobs[i].area |= acts_blob_buf[tmpptr++] - 1;
          }
          
!         // Get the other 2 byte values
          acts_data.blobs[i].x = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].x = acts_data.blobs[i].x << 6;
          acts_data.blobs[i].x |= acts_blob_buf[tmpptr++] - 1;
  
          acts_data.blobs[i].y = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].y = acts_data.blobs[i].y << 6;
          acts_data.blobs[i].y |= acts_blob_buf[tmpptr++] - 1;
  
          acts_data.blobs[i].left = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].left = acts_data.blobs[i].left << 6;
          acts_data.blobs[i].left |= acts_blob_buf[tmpptr++] - 1;
  
          acts_data.blobs[i].right = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].right = acts_data.blobs[i].right << 6;
          acts_data.blobs[i].right |= acts_blob_buf[tmpptr++] - 1;
  
          acts_data.blobs[i].top = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].top = acts_data.blobs[i].top << 6;
          acts_data.blobs[i].top |= acts_blob_buf[tmpptr++] - 1;
  
          acts_data.blobs[i].bottom = acts_blob_buf[tmpptr++] - 1;
          acts_data.blobs[i].bottom = acts_data.blobs[i].bottom << 6;
          acts_data.blobs[i].bottom |= acts_blob_buf[tmpptr++] - 1;
        }
      }
***************
*** 968,972 ****
      local_data.width = acts_data.width;
      local_data.height = acts_data.height;
!     local_data.blob_count = htons(num_blobs);
        
      for (i = 0; i < num_blobs; i++)
--- 946,950 ----
      local_data.width = acts_data.width;
      local_data.height = acts_data.height;
!     local_data.blobs_count = num_blobs;
        
      for (i = 0; i < num_blobs; i++)
***************
*** 974,978 ****
        src = acts_data.blobs + i;
        dst = local_data.blobs + i;
!       dst->id = htons(0);
        dst->color = src->color;
        dst->x = src->x;
--- 952,956 ----
        src = acts_data.blobs + i;
        dst = local_data.blobs + i;
!       dst->id = 0;
        dst->color = src->color;
        dst->x = src->x;
***************
*** 982,991 ****
        dst->top = src->top;
        dst->bottom = src->bottom;
!       dst->range = htons(0);
      }
  
      /* got the data. now fill it in */
!     PutMsg(device_id, NULL, PLAYER_MSGTYPE_DATA, 0, &local_data, 
sizeof(local_data) - sizeof(local_data.blobs) +
!             ntohs(local_data.blob_count) * sizeof(local_data.blobs[0]), NULL);
    }
  
--- 960,969 ----
        dst->top = src->top;
        dst->bottom = src->bottom;
!       dst->range = 0;
      }
  
      /* got the data. now fill it in */
!     Publish(device_addr, NULL, PLAYER_MSGTYPE_DATA, 
PLAYER_BLOBFINDER_DATA_BLOBS, &local_data, sizeof(local_data) - 
sizeof(local_data.blobs) +
!             (local_data.blobs_count) * sizeof(local_data.blobs[0]), NULL);
    }
  



_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to