Update of /cvsroot/playerstage/code/player/libplayercore
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25787/libplayercore

Modified Files:
      Tag: b_thjc_dynamic_arrays
        message.cc playerinterfacegen.py driver.cc device.cc driver.h 
        message.h player.h device.h Makefile.am .cvsignore 
Log Message:
Merged some changes from head a while back

Work on updating drivers, A-J done,  laser is next

Index: .cvsignore
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/.cvsignore,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** .cvsignore  20 Aug 2007 06:37:26 -0000      1.5
--- .cvsignore  10 Oct 2007 09:26:06 -0000      1.5.2.1
***************
*** 7,8 ****
--- 7,13 ----
  interface_table.c
  player_interfaces.h
+ .libs
+ .deps
+ *.lo
+ *.a
+ *.la

Index: player.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/player.h,v
retrieving revision 1.139
retrieving revision 1.139.2.1
diff -C2 -d -r1.139 -r1.139.2.1
*** player.h    20 Aug 2007 19:42:47 -0000      1.139
--- player.h    10 Oct 2007 09:26:06 -0000      1.139.2.1
***************
*** 66,70 ****
  #define PLAYER_MAX_DRIVER_STRING_LEN 64
  /** The maximum number of devices the server will support. */
! #define PLAYER_MAX_DEVICES             256
  /** Default maximum length for a message queue */
  #define PLAYER_MSGQUEUE_DEFAULT_MAXLEN 1024
--- 66,70 ----
  #define PLAYER_MAX_DRIVER_STRING_LEN 64
  /** The maximum number of devices the server will support. */
! #define PLAYER_MAX_DEVICES             4096
  /** Default maximum length for a message queue */
  #define PLAYER_MSGQUEUE_DEFAULT_MAXLEN 1024
***************
*** 128,235 ****
   */
  
- /** @ingroup message_codes
-  * @{ */
- 
- //#define PLAYER_NULL_CODE           256 // /dev/null analogue
- //#define PLAYER_PLAYER_CODE         1   // the server itself
- //#define PLAYER_POWER_CODE          2   // power subsystem
- //#define PLAYER_GRIPPER_CODE        3   // gripper
- //#define PLAYER_POSITION2D_CODE     4   // device that moves about in the 
plane
- //#define PLAYER_SONAR_CODE          5   // fixed range-finder
- //#define PLAYER_LASER_CODE          6   // scanning range-finder
- //#define PLAYER_BLOBFINDER_CODE     7   // visual blobfinder
- //#define PLAYER_PTZ_CODE            8   // pan-tilt-zoom unit
- //#define PLAYER_AUDIO_CODE          9   // audio I/O
- //#define PLAYER_FIDUCIAL_CODE       10  // fiducial detector
- //#define PLAYER_SPEECH_CODE         12  // speech I/O
- //#define PLAYER_GPS_CODE            13  // GPS unit
- //#define PLAYER_BUMPER_CODE         14  // bumper array
- //#define PLAYER_DIO_CODE            20  // digital I/O
- //#define PLAYER_AIO_CODE            21  // analog I/O
- //#define PLAYER_IR_CODE             22  // IR array
- //#define PLAYER_WIFI_CODE           23  // wifi card status
- //#define PLAYER_LOCALIZE_CODE       25  // localization
- //#define PLAYER_MCOM_CODE           26  // multicoms
- //#define PLAYER_POSITION3D_CODE     30  // 3-D position
- //#define PLAYER_SIMULATION_CODE     31  // simulators
- //#define PLAYER_BLINKENLIGHT_CODE   33  // blinking lights
- //#define PLAYER_NOMAD_CODE          34  // Nomad robot
- //#define PLAYER_CAMERA_CODE         40  // camera device
- //#define PLAYER_MAP_CODE            42  // get a map
- //#define PLAYER_PLANNER_CODE        44  // 2D motion planner
- //#define PLAYER_LOG_CODE            45  // log read/write control
- //#define PLAYER_MOTOR_CODE          47  // motor interface
- //#define PLAYER_JOYSTICK_CODE       49  // Joytstick
- //#define PLAYER_SPEECH_RECOGNITION_CODE  50  // speech recognition
- //#define PLAYER_OPAQUE_CODE         51  // plugin interface
- //#define PLAYER_POSITION1D_CODE     52  // 1-D position
- //#define PLAYER_ACTARRAY_CODE       53  // Actuator Array interface
- //#define PLAYER_LIMB_CODE           54  // Limb interface
- //#define PLAYER_GRAPHICS2D_CODE     55  // Graphics2D interface
- //#define PLAYER_RFID_CODE           56  // RFID reader interface
- //#define PLAYER_WSN_CODE            57  // Wireless Sensor Networks interface
- //#define PLAYER_GRAPHICS3D_CODE     58  // Graphics3D interface
- //#define PLAYER_HEALTH_CODE     59  // Statgrab Health interface
- //#define PLAYER_IMU_CODE            60  // Inertial Measurement Unit 
interface
- //#define PLAYER_POINTCLOUD3D_CODE   61  // 3-D point cloud
- //#define PLAYER_RANGER_CODE         62  // Range sensor device
- /** @} */
- 
- /** @ingroup message_basics
-  * @defgroup message_strings Interface string names
-  * Used in configuration file parsing and console output, each interface is
-  * assigned a string name. See @ref interfaces for
-  * detailed descriptions of each interface.
-  */
- 
- /** @ingroup message_strings
-  * @{ */
- 
- //#define PLAYER_ACTARRAY_STRING        "actarray"
- //#define PLAYER_AIO_STRING             "aio"
- //#define PLAYER_AUDIO_STRING           "audio"
- //#define PLAYER_BLINKENLIGHT_STRING    "blinkenlight"
- //#define PLAYER_BLOBFINDER_STRING      "blobfinder"
- //#define PLAYER_BUMPER_STRING          "bumper"
- //#define PLAYER_CAMERA_STRING          "camera"
- //#define PLAYER_DIO_STRING             "dio"
- //#define PLAYER_GRIPPER_STRING         "gripper"
- //#define PLAYER_FIDUCIAL_STRING        "fiducial"
- //#define PLAYER_GPS_STRING             "gps"
- //#define PLAYER_GRAPHICS2D_STRING      "graphics2d"
- //#define PLAYER_GRAPHICS3D_STRING      "graphics3d"
- //#define PLAYER_IMU_STRING             "imu"
- //#define PLAYER_POINTCLOUD3D_STRING    "pointcloud3d"
- //#define PLAYER_HEALTH_STRING              "health"
- //#define PLAYER_IR_STRING              "ir"
- //#define PLAYER_JOYSTICK_STRING        "joystick"
- //#define PLAYER_LASER_STRING           "laser"
- //#define PLAYER_LIMB_STRING            "limb"
- //#define PLAYER_LOCALIZE_STRING        "localize"
- //#define PLAYER_LOG_STRING             "log"
- //#define PLAYER_MAP_STRING             "map"
- //#define PLAYER_MCOM_STRING            "mcom"
- //#define PLAYER_MOTOR_STRING           "motor"
- //#define PLAYER_NOMAD_STRING           "nomad"
- //#define PLAYER_NULL_STRING            "null"
- //#define PLAYER_OPAQUE_STRING          "opaque"
- //#define PLAYER_PLANNER_STRING         "planner"
- //#define PLAYER_PLAYER_STRING          "player"
- //#define PLAYER_POSITION1D_STRING      "position1d"
- //#define PLAYER_POSITION2D_STRING      "position2d"
- //#define PLAYER_POSITION3D_STRING      "position3d"
- //#define PLAYER_POWER_STRING           "power"
- //#define PLAYER_PTZ_STRING             "ptz"
- //#define PLAYER_RFID_STRING            "rfid"
- //#define PLAYER_SIMULATION_STRING      "simulation"
- //#define PLAYER_SONAR_STRING           "sonar"
- //#define PLAYER_SPEECH_STRING          "speech"
- //#define PLAYER_SPEECH_RECOGNITION_STRING  "speech_recognition"
- //#define PLAYER_WIFI_STRING            "wifi"
- //#define PLAYER_WSN_STRING             "wsn"
- //#define PLAYER_RANGER_STRING          "ranger"
- 
- /** @} */
- 
  /** @ingroup message_basics
   * @defgroup address_structs Address structures
--- 128,131 ----
***************
*** 279,283 ****
   * @{ */
  
! /** @breif A null structure for parsing completeness */
  typedef struct player_null
  {
--- 175,179 ----
   * @{ */
  
! /** @brief A null structure for parsing completeness */
  typedef struct player_null
  {

Index: message.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/message.h,v
retrieving revision 1.20
retrieving revision 1.20.2.1
diff -C2 -d -r1.20 -r1.20.2.1
*** message.h   23 Aug 2007 19:58:42 -0000      1.20
--- message.h   10 Oct 2007 09:26:06 -0000      1.20.2.1
***************
*** 123,138 ****
  {
    public:
!     /// Create a new message.
      Message(const struct player_msghdr & Header,
!             const void* data,
!             unsigned int data_size,
!             bool do_deepcopy = true);
  
!     /// Create a new message with an associated queue
      Message(const struct player_msghdr & Header,
!             const void* data,
!             unsigned int data_size,
              QueuePointer &_queue,
!             bool do_deepcopy = true);
  
      /// Copy pointers from existing message and increment refcount.
--- 123,138 ----
  {
    public:
!     /// Create a new message. If copy is set to false then the pointer is 
claimed by the message, 
!     /// otherwise it is copied.
      Message(const struct player_msghdr & Header,
!             void* data,
!             bool copy = true);
  
!     /// Create a new message with an associated queue. If copy is set to 
false then the pointer is 
!     /// claimed by the message, otherwise it is copied.
      Message(const struct player_msghdr & Header,
!             void* data,
              QueuePointer &_queue,
!             bool copy = true);
  
      /// Copy pointers from existing message and increment refcount.
***************
*** 160,175 ****
      }
  
-     /// GetData from message.
-     void* GetData() {return (void*)Data;};
      /// Get pointer to header.
!     player_msghdr_t * GetHeader() {return reinterpret_cast<player_msghdr_t *> 
(Data);};
      /// Get pointer to payload.
!     void* GetPayload() {return (void*)(&Data[sizeof(player_msghdr_t)]);};
!     /// Get Payload size.
!     size_t GetPayloadSize() {return Size - sizeof(player_msghdr_t);};
!     /// Get dynamic data size.
!     size_t GetDynDataSize() {return DynDataSize;};
      /// Size of message data.
!     unsigned int GetSize() {return Size;};
      /// Compare type, subtype, device, and device_index.
      bool Compare(Message &other);
--- 160,169 ----
      }
  
      /// Get pointer to header.
!     player_msghdr_t * GetHeader() {return &Header;};
      /// Get pointer to payload.
!     void* GetPayload() {return (void*)Data;};
      /// Size of message data.
!     unsigned int GetDataSize() {return Header.size;};
      /// Compare type, subtype, device, and device_index.
      bool Compare(Message &other);
***************
*** 188,197 ****
  
    private:
      /// Pointer to the message data.
      uint8_t * Data;
-     /// Length (in bytes) of Data.
-     unsigned int Size;
-     /// Length (in bytes) of any dynamic data the message uses
-     unsigned int DynDataSize;
      /// Used to lock access to Data.
      pthread_mutex_t * Lock;
--- 182,193 ----
  
    private:
+     void CreateMessage(const struct player_msghdr & Header,
+             void* data,
+             bool copy = true);
+         
+     /// message header
+     player_msghdr_t Header;
      /// Pointer to the message data.
      uint8_t * Data;
      /// Used to lock access to Data.
      pthread_mutex_t * Lock;

Index: driver.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/driver.h,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -C2 -d -r1.22 -r1.22.2.1
*** driver.h    23 Aug 2007 19:58:42 -0000      1.22
--- driver.h    10 Oct 2007 09:26:06 -0000      1.22.2.1
***************
*** 176,180 ****
      @param subtype The message subtype
      @param src The message body
!     @param len Length of the message body
      @param timestamp Timestamp for the message body (if NULL, then the
      current time will be filled in) */
--- 176,180 ----
      @param subtype The message subtype
      @param src The message body
!     @param deprecated Used to be the length of the message this is now 
calculated
      @param timestamp Timestamp for the message body (if NULL, then the
      current time will be filled in) */
***************
*** 184,188 ****
                   uint8_t subtype,
                   void* src=NULL,
!                  size_t len=0,
                   double* timestamp=NULL);
  
--- 184,188 ----
                   uint8_t subtype,
                   void* src=NULL,
!                  size_t deprecated=0,
                   double* timestamp=NULL);
  
***************
*** 196,200 ****
       @param subtype The message subtype
       @param src The message body
!      @param len Length of the message body
       @param timestamp Timestamp for the message body (if NULL, then the
       current time will be filled in) */
--- 196,200 ----
       @param subtype The message subtype
       @param src The message body
!      @param deprecated Used to be the length of the message this is now 
calculated
       @param timestamp Timestamp for the message body (if NULL, then the
       current time will be filled in) */
***************
*** 203,207 ****
                    uint8_t subtype,
                    void* src=NULL, 
!                   size_t len=0,
                    double* timestamp=NULL);
   
--- 203,207 ----
                    uint8_t subtype,
                    void* src=NULL, 
!                   size_t deprecated=0,
                    double* timestamp=NULL);
   
***************
*** 214,221 ****
      @param queue the target queue.
      @param hdr The message header
!     @param src The message body */
      void Publish(QueuePointer &queue,
                   player_msghdr_t* hdr,
!                  void* src);
  
      /** @brief Publish a message via one of this driver's interfaces.
--- 214,223 ----
      @param queue the target queue.
      @param hdr The message header
!     @param src The message body 
!     @param copy if set to false the data will be claimed and the caller 
should no longer use or free it */
      void Publish(QueuePointer &queue,
                   player_msghdr_t* hdr,
!                  void* src,
!                  bool copy = true);
  
      /** @brief Publish a message via one of this driver's interfaces.
***************
*** 224,230 ****
      assembled and wish to broadcast the message to all subscribed parties.
      @param hdr The message header
!     @param src The message body */
      void Publish(player_msghdr_t* hdr,
!                  void* src);
  
  
--- 226,234 ----
      assembled and wish to broadcast the message to all subscribed parties.
      @param hdr The message header
!     @param src The message body 
!     @param copy if set to false the data will be claimed and the caller 
should no longer use or free it */ 
      void Publish(player_msghdr_t* hdr,
!                  void* src,
!                  bool copy = true);
  
  

Index: message.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/message.cc,v
retrieving revision 1.25
retrieving revision 1.25.2.1
diff -C2 -d -r1.25 -r1.25.2.1
*** message.cc  27 Aug 2007 03:52:17 -0000      1.25
--- message.cc  10 Oct 2007 09:26:05 -0000      1.25.2.1
***************
*** 55,135 ****
  #include <libplayerxdr/playerxdr.h>
  
! Message::Message(const struct player_msghdr & Header,
!                   const void * data,
!                   unsigned int data_size,
!                   bool do_deepcopy) : DynDataSize(0)
  {
!   this->Lock = new pthread_mutex_t;
!   assert(this->Lock);
!   pthread_mutex_init(this->Lock,NULL);
!   this->Size = sizeof(struct player_msghdr)+data_size;
!   assert(this->Size);
!   this->Data = new unsigned char[this->Size];
!   assert(this->Data);
!   
! 
!   // copy the header and then the data into out message data buffer
!   memcpy(this->Data,&Header,sizeof(struct player_msghdr));
!   // Force header size to be same as data size
!   ((player_msghdr *) Data)->size = data_size;
! 
!   memcpy(&this->Data[sizeof(struct player_msghdr)],data,data_size);
!   if (do_deepcopy && data != NULL)
!   {
!     player_dpcpy_fn_t dpcpyfunc = NULL;
!     if((dpcpyfunc = playerxdr_get_dpcpyfunc(Header.addr.interf, Header.type, 
Header.subtype)) != NULL)
!     {
!       if((this->DynDataSize = (*dpcpyfunc)(data, this->GetPayload())) == 0)
!       {
!         // Possible error
!         PLAYER_WARN3 ("copied zero bytes in deep copy of message %s: %s, %d", 
interf_to_str (Header.addr.interf), msgtype_to_str (Header.type), 
Header.subtype);
!       }
!     }
!   }
! 
!   this->RefCount = new unsigned int;
!   assert(this->RefCount);
!   *this->RefCount = 1;
  }
  
! Message::Message(const struct player_msghdr & Header,
!                  const void * data,
!                  unsigned int data_size,
                   QueuePointer &_queue,
!                  bool do_deepcopy) : DynDataSize(0)
  {
!   this->Queue = _queue;
!   this->Lock = new pthread_mutex_t;
!   assert(this->Lock);
!   pthread_mutex_init(this->Lock,NULL);
!   this->Size = sizeof(struct player_msghdr)+data_size;
!   assert(this->Size);
!   this->Data = new unsigned char[this->Size];
!   assert(this->Data);
! 
!   // copy the header and then the data into out message data buffer
!   memcpy(this->Data,&Header,sizeof(struct player_msghdr));
!   // Force header size to be same as data size
!   ((player_msghdr *) Data)->size = data_size;
! 
!   memcpy(&this->Data[sizeof(struct player_msghdr)],data,data_size);
!   // Perform deep copy if necessary
!   if (do_deepcopy && data != NULL && data_size > 0)
!   {
!     player_dpcpy_fn_t dpcpyfunc = NULL;
!     if((dpcpyfunc = playerxdr_get_dpcpyfunc(Header.addr.interf, Header.type, 
Header.subtype)) != NULL)
!     {
!       if((this->DynDataSize = (*dpcpyfunc)(data, this->GetPayload())) == 0)
!       {
!         // Possible error
!         PLAYER_WARN3 ("copied zero bytes in deep copy of message %s: %s, %d", 
interf_to_str (Header.addr.interf), msgtype_to_str (Header.type), 
Header.subtype);
!         assert(0);
!       }
!     }
!   }
! 
!   this->RefCount = new unsigned int;
!   assert(this->RefCount);
!   *this->RefCount = 1;
  }
  
--- 55,71 ----
  #include <libplayerxdr/playerxdr.h>
  
! Message::Message(const struct player_msghdr & aHeader,
!                   void * data,
!                   bool copy) 
  {
!   CreateMessage(aHeader, data, copy);
  }
  
! Message::Message(const struct player_msghdr & aHeader,
!                  void * data,
                   QueuePointer &_queue,
!                  bool copy) : Queue(_queue)
  {
!   CreateMessage(aHeader, data, copy);
  }
  
***************
*** 139,149 ****
    pthread_mutex_lock(rhs.Lock);
  
-   assert(rhs.Data);
    assert(rhs.RefCount);
    assert(*(rhs.RefCount));
    Lock = rhs.Lock;
    Data = rhs.Data;
!   Size = rhs.Size;
!   DynDataSize = rhs.DynDataSize;
    Queue = rhs.Queue;
    RefCount = rhs.RefCount;
--- 75,83 ----
    pthread_mutex_lock(rhs.Lock);
  
    assert(rhs.RefCount);
    assert(*(rhs.RefCount));
    Lock = rhs.Lock;
    Data = rhs.Data;
!   Header = rhs.Header;
    Queue = rhs.Queue;
    RefCount = rhs.RefCount;
***************
*** 151,155 ****
    ready = false;
  
!   pthread_mutex_unlock(Lock);
  }
  
--- 85,89 ----
    ready = false;
  
!   pthread_mutex_unlock(rhs.Lock);
  }
  
***************
*** 159,162 ****
--- 93,140 ----
  }
  
+ void Message::CreateMessage(const struct player_msghdr & aHeader,
+                   void * data,
+                   bool copy) 
+ {
+   this->Lock = new pthread_mutex_t;
+   assert(this->Lock);
+   pthread_mutex_init(this->Lock,NULL);
+   this->RefCount = new unsigned int;
+   assert(this->RefCount);
+   *this->RefCount = 1;
+ 
+   // copy the header and then the data into out message data buffer
+   memcpy(&this->Header,&aHeader,sizeof(struct player_msghdr));
+   if (data == NULL)
+   {
+     Data = NULL;
+     Header.size = 0;
+     return;
+   }
+   // Force header size to be same as data size
+   player_sizeof_fn_t sizeoffunc;
+   if((sizeoffunc = playerxdr_get_sizeoffunc(Header.addr.interf, Header.type, 
Header.subtype)) != NULL)
+   {
+     Header.size = (*sizeoffunc)(data);
+   }
+   
+   //((player_msghdr *) Data)->size = data_size;
+   if (copy)
+   {
+     player_clone_fn_t clonefunc = NULL;
+     if((clonefunc = playerxdr_get_clonefunc(Header.addr.interf, Header.type, 
Header.subtype)) != NULL)
+     {
+       if ((this->Data = (uint8_t*)(*clonefunc)(data)) == NULL)
+       {
+         PLAYER_ERROR3 ("failed to clone message %s: %s, %d", interf_to_str 
(Header.addr.interf), msgtype_to_str (Header.type), Header.subtype);
+       }
+     }
+   }
+   else
+   {
+     this->Data = (uint8_t*)data;
+   }
+ }
+ 
  bool
  Message::Compare(Message &other)
***************
*** 178,184 ****
    if((*RefCount)==0)
    {
!     if (this->GetPayloadSize() > 0 && DynDataSize > 0)
!       playerxdr_delete_message (this->GetPayload(), 
this->GetHeader()->addr.interf, this->GetHeader()->type, 
this->GetHeader()->subtype);
!     delete [] Data;
      Data = NULL;
      delete RefCount;
--- 156,161 ----
    if((*RefCount)==0)
    {
!     if (Data)
!       playerxdr_free_message (Data, Header.addr.interf, Header.type, 
Header.subtype);
      Data = NULL;
      delete RefCount;

Index: driver.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/driver.cc,v
retrieving revision 1.31
retrieving revision 1.31.2.1
diff -C2 -d -r1.31 -r1.31.2.1
*** driver.cc   23 Aug 2007 19:58:42 -0000      1.31
--- driver.cc   10 Oct 2007 09:26:05 -0000      1.31.2.1
***************
*** 135,141 ****
  Driver::Publish(QueuePointer &queue,
                  player_msghdr_t* hdr,
!                 void* src)
  {
!   Message msg(*hdr,src,hdr->size);
    // push onto the given queue, which provides its own locking
    if(!queue->Push(msg))
--- 135,141 ----
  Driver::Publish(QueuePointer &queue,
                  player_msghdr_t* hdr,
!                 void* src, bool copy)
  {
!   Message msg(*hdr,src);
    // push onto the given queue, which provides its own locking
    if(!queue->Push(msg))
***************
*** 149,157 ****
  void
  Driver::Publish(player_msghdr_t* hdr,
!                 void* src)
  {
    Device* dev;
  
!   Message msg(*hdr,src,hdr->size);
    // lock here, because we're accessing our device's queue list
    this->Lock();
--- 149,157 ----
  void
  Driver::Publish(player_msghdr_t* hdr,
!                 void* src, bool copy)
  {
    Device* dev;
  
!   Message msg(*hdr,src);
    // lock here, because we're accessing our device's queue list
    this->Lock();
***************
*** 188,192 ****
                  uint8_t subtype,
                  void* src,
!                 size_t len,
                  double* timestamp)
  {
--- 188,192 ----
                  uint8_t subtype,
                  void* src,
!                 size_t deprecated,
                  double* timestamp)
  {
***************
*** 205,209 ****
    hdr.subtype = subtype;
    hdr.timestamp = t;
!   hdr.size = len;
  
    this->Publish(queue, &hdr, src);
--- 205,209 ----
    hdr.subtype = subtype;
    hdr.timestamp = t;
!   hdr.size = 0;
  
    this->Publish(queue, &hdr, src);
***************
*** 215,219 ****
                  uint8_t subtype,
                  void* src, 
!                 size_t len,
                  double* timestamp)
  {
--- 215,219 ----
                  uint8_t subtype,
                  void* src, 
!                 size_t deprecated,
                  double* timestamp)
  {
***************
*** 232,236 ****
    hdr.subtype = subtype;
    hdr.timestamp = t;
!   hdr.size = len;
  
    this->Publish(&hdr, src);
--- 232,236 ----
    hdr.subtype = subtype;
    hdr.timestamp = t;
!   hdr.size = 0;
  
    this->Publish(&hdr, src);
***************
*** 370,379 ****
      void * data = msg->GetPayload();
  
-     if (msg->GetPayloadSize() != hdr->size)
-     {
-       PLAYER_WARN2("Message Size does not match msg header, %d != %d\n",
-                    msg->GetPayloadSize(), hdr->size);
-     }
- 
      // Try the driver's process function first
      // Drivers can override internal message handlers this way
--- 370,373 ----

Index: device.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/device.cc,v
retrieving revision 1.21
retrieving revision 1.21.2.1
diff -C2 -d -r1.21 -r1.21.2.1
*** device.cc   23 Aug 2007 19:58:42 -0000      1.21
--- device.cc   10 Oct 2007 09:26:06 -0000      1.21.2.1
***************
*** 186,195 ****
  Device::PutMsg(QueuePointer &resp_queue,
                 player_msghdr_t* hdr,
!                void* src)
  {
    hdr->addr = this->addr;
!   Message msg(*hdr,src,hdr->size,resp_queue);
    // don't need to lock here, because the queue does its own locking in Push
-   //if(!this->driver->InQueue->Push(msg))
    if(!this->InQueue->Push(msg))
    {
--- 186,195 ----
  Device::PutMsg(QueuePointer &resp_queue,
                 player_msghdr_t* hdr,
!                void* src,
!                bool copy)
  {
    hdr->addr = this->addr;
!   Message msg(*hdr,src,resp_queue,copy);
    // don't need to lock here, because the queue does its own locking in Push
    if(!this->InQueue->Push(msg))
    {

Index: playerinterfacegen.py
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/playerinterfacegen.py,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -C2 -d -r1.2 -r1.2.2.1
*** playerinterfacegen.py       27 Aug 2007 03:51:44 -0000      1.2
--- playerinterfacegen.py       10 Oct 2007 09:26:05 -0000      1.2.2.1
***************
*** 114,118 ****
      for m in interface_messages:
        print "  {", interface_def, ",", m.msg_type, ",", m.msg_subtype_string, 
","
!       print "    (player_pack_fn_t)%(dt_base)s_pack, 
(player_dpcpy_fn_t)%(dt)s_dpcpy, (player_cleanup_fn_t)%(dt)s_cleanup}," % { 
"dt_base": m.datatype[:-2], "dt": m.datatype}
  
  def process_for_utils(targetfile):
--- 114,118 ----
      for m in interface_messages:
        print "  {", interface_def, ",", m.msg_type, ",", m.msg_subtype_string, 
","
!       print "    (player_pack_fn_t)%(dt_base)s_pack, 
(player_copy_fn_t)%(dt)s_copy, 
(player_cleanup_fn_t)%(dt)s_cleanup,(player_clone_fn_t)%(dt)s_clone,(player_free_fn_t)%(dt)s_free,(player_sizeof_fn_t)%(dt)s_sizeof},"
 % { "dt_base": m.datatype[:-2], "dt": m.datatype}
  
  def process_for_utils(targetfile):

Index: device.h
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/device.h,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -C2 -d -r1.15 -r1.15.2.1
*** device.h    23 Aug 2007 19:58:42 -0000      1.15
--- device.h    10 Oct 2007 09:26:06 -0000      1.15.2.1
***************
*** 112,118 ****
      /// @param hdr The message header.
      /// @param src The message body (its size is stored in hdr->size).
      void PutMsg(QueuePointer &resp_queue,
                  player_msghdr_t* hdr,
!                 void* src);
  
      /// @brief Make a request of another device.
--- 112,120 ----
      /// @param hdr The message header.
      /// @param src The message body (its size is stored in hdr->size).
+     /// @param copy If copy is false then the message will be claimed by the 
device
      void PutMsg(QueuePointer &resp_queue,
                  player_msghdr_t* hdr,
!                 void* src,
!                 bool copy=true);
  
      /// @brief Make a request of another device.

Index: Makefile.am
===================================================================
RCS file: /cvsroot/playerstage/code/player/libplayercore/Makefile.am,v
retrieving revision 1.20.2.1
retrieving revision 1.20.2.2
diff -C2 -d -r1.20.2.1 -r1.20.2.2
*** Makefile.am 10 Sep 2007 04:11:00 -0000      1.20.2.1
--- Makefile.am 10 Oct 2007 09:26:06 -0000      1.20.2.2
***************
*** 7,11 ****
  dist_bin_SCRIPTS = playerinterfacegen.py
  
! EXTRA_DIST = playercore.pc.in playererror.pc.in interfaces/ADDING_INTERFACES 
interfaces/*.def
  
  player_interfaces.h: ./interfaces/* playerinterfacegen.py
--- 7,11 ----
  dist_bin_SCRIPTS = playerinterfacegen.py
  
! EXTRA_DIST = playercore.pc.in playererror.pc.in interfaces/ADDING_INTERFACES 
player_interfaces.h interface_table.c $(shell find $(srcdir)/interfaces -name 
"*.def")
  
  player_interfaces.h: ./interfaces/* playerinterfacegen.py
***************
*** 66,73 ****
                        player_interfaces.h
                        
! player_interfaces.h: ./interfaces/* playerinterfacegen.py
!       if ! ./playerinterfacegen.py > player_interfaces.h; then rm 
player_interfaces.h; fi
! 
! interface_table.c: ./interfaces/* playerinterfacegen.py
!       if ! ./playerinterfacegen.py --utils > interface_table.c; then rm 
interface_table.c; fi
  
--- 66,74 ----
                        player_interfaces.h
                        
! player_interfaces.h: $(srcdir)/interfaces/* playerinterfacegen.py
!       python $(srcdir)/playerinterfacegen.py > 
$(top_builddir)/libplayercore/player_interfaces.h
! #     if ! ./playerinterfacegen.py > player_interfaces.h; then rm 
player_interfaces.h; fi
  
+ interface_table.c: $(srcdir)/interfaces/* playerinterfacegen.py
+       python $(srcdir)/playerinterfacegen.py --utils > 
$(top_builddir)/libplayercore/interface_table.c
+ #     if ! ./playerinterfacegen.py --utils > interface_table.c; then rm 
interface_table.c; fi


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to