Revision: 8860
          http://playerstage.svn.sourceforge.net/playerstage/?rev=8860&view=rev
Author:   jpgr87
Date:     2010-08-29 00:55:55 +0000 (Sun, 29 Aug 2010)

Log Message:
-----------
Applied patch #3048122: Player SVN: Maemo Linux compat. patch for camera drivers

Modified Paths:
--------------
    code/player/trunk/cmake/internal/SearchForStuff.cmake
    code/player/trunk/config.h.in
    code/player/trunk/server/drivers/camera/gstreamer/cameragst.cc
    code/player/trunk/server/drivers/camera/v4l2/CMakeLists.txt
    code/player/trunk/server/drivers/camera/v4l2/geode.c

Modified: code/player/trunk/cmake/internal/SearchForStuff.cmake
===================================================================
--- code/player/trunk/cmake/internal/SearchForStuff.cmake       2010-08-29 
00:39:27 UTC (rev 8859)
+++ code/player/trunk/cmake/internal/SearchForStuff.cmake       2010-08-29 
00:55:55 UTC (rev 8860)
@@ -95,6 +95,11 @@
     SET (HAVE_ROUND FALSE)
 ENDIF (HAVE_M)
 
+CHECK_INCLUDE_FILES ("sys/types.h;linux/i2c-dev.h;linux/i2c.h" HAVE_I2C_H)
+IF (HAVE_I2C_H)
+    SET (HAVE_I2C TRUE)
+ENDIF (HAVE_I2C_H)
+
 CHECK_LIBRARY_EXISTS (jpeg jpeg_read_header "${PLAYER_EXTRA_LIB_DIRS}" 
HAVE_LIBJPEG)
 CHECK_INCLUDE_FILES ("stdio.h;jpeglib.h" HAVE_JPEGLIB_H)
 IF (HAVE_LIBJPEG AND HAVE_JPEGLIB_H)

Modified: code/player/trunk/config.h.in
===================================================================
--- code/player/trunk/config.h.in       2010-08-29 00:39:27 UTC (rev 8859)
+++ code/player/trunk/config.h.in       2010-08-29 00:55:55 UTC (rev 8860)
@@ -7,6 +7,7 @@
 #cmakedefine ENABLE_TCP_NODELAY 1
 
 #cmakedefine HAVE_GETADDRINFO 1
+#cmakedefine HAVE_I2C 1
 #cmakedefine HAVE_JPEG 1
 #cmakedefine HAVE_Z 1
 #cmakedefine HAVE_LINUX_JOYSTICK_H 1

Modified: code/player/trunk/server/drivers/camera/gstreamer/cameragst.cc
===================================================================
--- code/player/trunk/server/drivers/camera/gstreamer/cameragst.cc      
2010-08-29 00:39:27 UTC (rev 8859)
+++ code/player/trunk/server/drivers/camera/gstreamer/cameragst.cc      
2010-08-29 00:55:55 UTC (rev 8860)
@@ -124,6 +124,10 @@
     virtual int MainSetup ();
     virtual void MainQuit ();
 
+    virtual int ProcessMessage(QueuePointer & resp_queue,
+                               player_msghdr * hdr,
+                               void * data);
+
   private:
 
     // Main function for device thread.
@@ -617,7 +621,30 @@
     tspec.tv_nsec = 1000000;
     nanosleep(&tspec, NULL);
     pthread_testcancel();
-    if (this->GrabFrame() && this->RetrieveFrame()) 
this->Publish(this->device_addr, PLAYER_MSGTYPE_DATA, PLAYER_CAMERA_DATA_STATE, 
&this->data);
+    if (this->GrabFrame() && this->RetrieveFrame()) 
this->Publish(this->device_addr, PLAYER_MSGTYPE_DATA, PLAYER_CAMERA_DATA_STATE, 
reinterpret_cast<void *>(&(this->data)));
     pthread_testcancel();
+    this->ProcessMessages();
+    pthread_testcancel();
   }
 }
+
+int GStreamerDriver::ProcessMessage(QueuePointer & resp_queue,
+                                    player_msghdr * hdr,
+                                    void * data)
+{
+  data = data;
+  assert(hdr);
+  if (Message::MatchMessage(hdr, PLAYER_MSGTYPE_REQ,
+                                 PLAYER_CAMERA_REQ_GET_IMAGE,
+                                 this->device_addr))
+  {
+    if (!(this->GrabFrame() && this->RetrieveFrame())) return -1;
+    this->Publish(this->device_addr,
+                  resp_queue,
+                  PLAYER_MSGTYPE_RESP_ACK,
+                  PLAYER_CAMERA_REQ_GET_IMAGE,
+                  reinterpret_cast<void *>(&(this->data)));
+    return 0;
+  }
+  return -1;
+}

Modified: code/player/trunk/server/drivers/camera/v4l2/CMakeLists.txt
===================================================================
--- code/player/trunk/server/drivers/camera/v4l2/CMakeLists.txt 2010-08-29 
00:39:27 UTC (rev 8859)
+++ code/player/trunk/server/drivers/camera/v4l2/CMakeLists.txt 2010-08-29 
00:55:55 UTC (rev 8860)
@@ -1,6 +1,4 @@
 PLAYERDRIVER_OPTION (camerav4l2 build_camerav4l2 ON)
 PLAYERDRIVER_REJECT_OS (camerav4l2 build_camerav4l2 PLAYER_OS_WIN)
 PLAYERDRIVER_REQUIRE_HEADER (camerav4l2 build_camerav4l2 linux/videodev2.h 
sys/types.h)
-PLAYERDRIVER_REQUIRE_HEADER (camerav4l2 build_camerav4l2 linux/i2c-dev.h 
sys/types.h)
-PLAYERDRIVER_REQUIRE_HEADER (camerav4l2 build_camerav4l2 linux/i2c.h 
sys/types.h)
 PLAYERDRIVER_ADD_DRIVER (camerav4l2 build_camerav4l2 SOURCES bayer.c geode.c 
v4l2.c camerav4l2.cc)

Modified: code/player/trunk/server/drivers/camera/v4l2/geode.c
===================================================================
--- code/player/trunk/server/drivers/camera/v4l2/geode.c        2010-08-29 
00:39:27 UTC (rev 8859)
+++ code/player/trunk/server/drivers/camera/v4l2/geode.c        2010-08-29 
00:55:55 UTC (rev 8860)
@@ -29,8 +29,11 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <linux/videodev2.h>
+#include <config.h>
+#if HAVE_I2C
 #include <linux/i2c-dev.h>
 #include <linux/i2c.h>
+#endif
 #include <fcntl.h>
 #include <string.h>
 #include <stdio.h>
@@ -44,6 +47,7 @@
 
 int geode_select_cam(const char * dev, int cam)
 {
+#if HAVE_I2C
   int i;
   struct i2c_smbus_ioctl_data args;
   union i2c_smbus_data data;
@@ -80,6 +84,11 @@
   }
   close(i);
   return 0;
+#else
+#warning I2C kernel headers cannot be used, geode_select_cam() function will 
always fail
+  dev = dev; cam = cam;
+  return -1;
+#endif
 }
 
 void * geode_open_fg(const char * dev, const char * pixformat, int width, int 
height, int imgdepth, int buffers)


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

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to