Revision: 8309
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8309&view=rev
Author:   thjc
Date:     2009-10-18 15:19:39 +0000 (Sun, 18 Oct 2009)

Log Message:
-----------
applied patch 2875208: camera1394 additional set property message handling

Modified Paths:
--------------
    code/player/trunk/server/drivers/camera/1394/camera1394.cc

Modified: code/player/trunk/server/drivers/camera/1394/camera1394.cc
===================================================================
--- code/player/trunk/server/drivers/camera/1394/camera1394.cc  2009-10-18 
15:17:32 UTC (rev 8308)
+++ code/player/trunk/server/drivers/camera/1394/camera1394.cc  2009-10-18 
15:19:39 UTC (rev 8309)
@@ -427,7 +427,7 @@
        IntProperty MinFocus, MaxFocus, Focus;
        IntProperty MinIris, MaxIris, Iris;
        IntProperty Brightness, Exposure, Shutter, Gain;
-        StringProperty WhiteBalance;
+       StringProperty WhiteBalance;
        /*  private: bool setFocus, setIris, setBrightness, setExposure, 
setWhiteBalance, setShutter, setGain;
         private: bool autoFocus, autoIris, autoBrightness, autoExposure, 
autoShutter, autoGain;
         private: unsigned int focus, iris, brightness, exposure, redBalance, 
blueBalance, shutter, gain;
@@ -455,20 +455,20 @@
 Camera1394::Camera1394(ConfigFile* cf, int section) :
        ThreadedDriver(cf, section, true, PLAYER_MSGQUEUE_DEFAULT_MAXLEN,
                        PLAYER_CAMERA_CODE),
-                       MinZoom("min_zoom", PROPERTY_NOT_SET, true, this, cf, 
section),
-                       MaxZoom("max_zoom", PROPERTY_NOT_SET, true, this, cf, 
section),
-                       Zoom("zoom", PROPERTY_NOT_SET, false, this, cf, 
section),
-                       MinFocus("min_focus", PROPERTY_NOT_SET, true, this, cf, 
section),
-                       MaxFocus("max_focus", PROPERTY_NOT_SET, true, this, cf, 
section),
-                       Focus("focus", PROPERTY_NOT_SET, false, this, cf, 
section),
-                       MinIris("min_iris", PROPERTY_NOT_SET, true, this, cf, 
section),
-                       MaxIris("max_iris", PROPERTY_NOT_SET, true, this, cf, 
section),
-                       Iris("iris", PROPERTY_NOT_SET, false, this, cf, 
section),
-                       Brightness("brightness", PROPERTY_NOT_SET, false, this, 
cf, section),
-                       Exposure("exposure", PROPERTY_NOT_SET, false, this, cf, 
section), 
-                       Shutter("shutter", PROPERTY_NOT_SET, false, this, cf, 
section), 
-                        Gain("gain", PROPERTY_NOT_SET, false, this, cf, 
section), 
-                        WhiteBalance("whitebalance", "None", false, this, cf, 
section)
+       MinZoom("min_zoom", PROPERTY_NOT_SET, true, this, cf, section),
+       MaxZoom("max_zoom", PROPERTY_NOT_SET, true, this, cf, section),
+       Zoom("zoom", PROPERTY_NOT_SET, false, this, cf, section),
+       MinFocus("min_focus", PROPERTY_NOT_SET, true, this, cf, section),
+       MaxFocus("max_focus", PROPERTY_NOT_SET, true, this, cf, section),
+       Focus("focus", PROPERTY_NOT_SET, false, this, cf, section),
+       MinIris("min_iris", PROPERTY_NOT_SET, true, this, cf, section),
+       MaxIris("max_iris", PROPERTY_NOT_SET, true, this, cf, section),
+       Iris("iris", PROPERTY_NOT_SET, false, this, cf, section),
+       Brightness("brightness", PROPERTY_NOT_SET, false, this, cf, section),
+       Exposure("exposure", PROPERTY_NOT_SET, false, this, cf, section), 
+       Shutter("shutter", PROPERTY_NOT_SET, false, this, cf, section), 
+       Gain("gain", PROPERTY_NOT_SET, false, this, cf, section), 
+       WhiteBalance("whitebalance", "None", false, this, cf, section)
 {
        float fps;
 
@@ -1446,7 +1446,56 @@
                        }
                        return -1;
                }
+               else if (strcmp(Brightness.GetKey(),req.key)==0)
+               {
+                       if (SetBrightness(req.value))
+                       {
+                               Publish(device_addr, resp_queue, 
PLAYER_MSGTYPE_RESP_NACK, hdr->subtype);
+                               return 0;
+                       }
+                       return -1;
+               }
+               else if (strcmp(Exposure.GetKey(),req.key)==0)
+               {
+                       if (SetExposure(req.value))
+                       {
+                               Publish(device_addr, resp_queue, 
PLAYER_MSGTYPE_RESP_NACK, hdr->subtype);
+                               return 0;
+                       }
+                       return -1;
+               }
+               else if (strcmp(Shutter.GetKey(),req.key)==0)
+               {
+                       if (SetShutter(req.value))
+                       {
+                               Publish(device_addr, resp_queue, 
PLAYER_MSGTYPE_RESP_NACK, hdr->subtype);
+                               return 0;
+                       }
+                       return -1;
+               }
+               else if (strcmp(Gain.GetKey(),req.key)==0)
+               {
+                       if (SetGain(req.value))
+                       {
+                               Publish(device_addr, resp_queue, 
PLAYER_MSGTYPE_RESP_NACK, hdr->subtype);
+                               return 0;
+                       }
+                       return -1;
+               }
        }
+       else if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
+                       PLAYER_SET_STRPROP_REQ, device_addr)) {
+               player_strprop_req_t &req = 
*reinterpret_cast<player_strprop_req_t*> (data);
+               if (strcmp(WhiteBalance.GetKey(),req.key)==0)
+               {
+                       if (SetWhiteBalance(req.value))
+                       {
+                               Publish(device_addr, resp_queue, 
PLAYER_MSGTYPE_RESP_NACK, hdr->subtype);
+                               return 0;
+                       }
+                       return -1;
+               }
+       }
        return -1;
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Playerstage-commit mailing list
Playerstage-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to