Update of /cvsroot/playerstage/code/player/server/drivers/camera/1394
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14424/server/drivers/camera/1394
Modified Files:
Tag: release-2-0-patches
camera1394.cc
Log Message:
added yarp driver, merged camera driver updates from HEAD
Index: camera1394.cc
===================================================================
RCS file:
/cvsroot/playerstage/code/player/server/drivers/camera/1394/camera1394.cc,v
retrieving revision 1.25.2.1
retrieving revision 1.25.2.2
diff -C2 -d -r1.25.2.1 -r1.25.2.2
*** camera1394.cc 20 Apr 2006 00:11:23 -0000 1.25.2.1
--- camera1394.cc 23 Sep 2006 00:11:33 -0000 1.25.2.2
***************
*** 138,141 ****
--- 138,144 ----
- a string containing two suitable blue and red value unsigned integers
+ - dma_buffers
+ - Default: 4
+ - the number of DMA buffers to use
@par Example
***************
*** 324,327 ****
--- 327,334 ----
private: unsigned int mode;
#endif
+
+ // number of DMA buffers to use
+ private: unsigned int num_dma_buffers;
+
// Write frames to disk?
private: int save;
***************
*** 636,639 ****
--- 643,650 ----
this->save = cf->ReadInt(section, "save", 0);
+ // Number of DMA buffers?
+ this->num_dma_buffers = cf->ReadInt(section, "dma_buffers",
NUM_DMA_BUFFERS);
+
+
return;
}
***************
*** 653,661 ****
{
case methodRaw:
! dc1394_release_camera(this->camera);
break;
case methodVideo:
//dc1394_dma_unlisten(this->camera);
! dc1394_dma_release_camera(this->camera);
}
dc1394_free_camera(this->camera);
--- 664,673 ----
{
case methodRaw:
! //dc1394_release_camera(this->camera);
break;
case methodVideo:
//dc1394_dma_unlisten(this->camera);
! //dc1394_dma_release_camera(this->camera);
! break;
}
dc1394_free_camera(this->camera);
***************
*** 913,917 ****
dc1394_dma_setup_capture(this->handle, this->camera.node, channel,
this->format, this->mode, speed,
! this->frameRate, NUM_DMA_BUFFERS, 1, NULL,
&this->camera) == DC1394_SUCCESS)
#elif DC1394_DMA_SETUP_CAPTURE_ARGS == 12
--- 925,929 ----
dc1394_dma_setup_capture(this->handle, this->camera.node, channel,
this->format, this->mode, speed,
! this->frameRate, this->num_dma_buffers, 1,
NULL,
&this->camera) == DC1394_SUCCESS)
#elif DC1394_DMA_SETUP_CAPTURE_ARGS == 12
***************
*** 920,947 ****
dc1394_dma_setup_capture(this->handle, this->camera.node, channel,
this->format, this->mode, speed,
! this->frameRate, NUM_DMA_BUFFERS, 1, 0, NULL,
&this->camera) == DC1394_SUCCESS)
#elif LIBDC1394_VERSION == 0200
// Set camera to use DMA, improves performance.
! bool DMA_Success = false;
if (!this->forceRaw)
{
! if (FORMAT_7 == format)
! {
! if (DC1394_SUCCESS == dc1394_dma_setup_format7_capture(camera, mode,
DC1394_COLOR_CODING_RAW8, speed,
! (uint_t)DC1394_QUERY_FROM_CAMERA,
(uint_t)DC1394_QUERY_FROM_CAMERA,
! (uint_t)DC1394_QUERY_FROM_CAMERA,
(uint_t)DC1394_QUERY_FROM_CAMERA,
! (uint_t)DC1394_QUERY_FROM_CAMERA, NUM_DMA_BUFFERS, 1)) {
! DMA_Success = true;
! }
! }
! else
! {
! if (DC1394_SUCCESS == dc1394_dma_setup_capture(this->camera,
this->mode, speed,
! this->frameRate, NUM_DMA_BUFFERS, 1))
! {
! DMA_Success = true;
! }
! }
}
if (DMA_Success)
--- 932,962 ----
dc1394_dma_setup_capture(this->handle, this->camera.node, channel,
this->format, this->mode, speed,
! this->frameRate, this->num_dma_buffers, 1, 0,
NULL,
&this->camera) == DC1394_SUCCESS)
#elif LIBDC1394_VERSION == 0200
// Set camera to use DMA, improves performance.
! bool DMA_Success = true;
if (!this->forceRaw)
{
! // first set parameters that are common between format 7 and other modes
! if (DC1394_SUCCESS != dc1394_video_set_framerate(camera,frameRate))
! {
! PLAYER_WARN("1394 failed to set frameRate");
! DMA_Success = false;
! }
! if (DC1394_SUCCESS != dc1394_video_set_iso_speed(camera,speed))
! {
! PLAYER_WARN("1394 failed to set iso speed");
! DMA_Success = false;
! }
! if (DC1394_SUCCESS != dc1394_video_set_mode(camera,mode))
! {
! PLAYER_WARN("1394 failed to set mode");
! DMA_Success = false;
! }
!
! // now start capture
! if (DC1394_SUCCESS != dc1394_capture_setup_dma(camera,
this->num_dma_buffers, DC1394_RING_BUFFER_LAST))
! DMA_Success = false;
}
if (DMA_Success)
***************
*** 1110,1114 ****
case methodVideo:
#if LIBDC1394_VERSION == 0200
! if (dc1394_dma_capture(&this->camera,1,DC1394_VIDEO1394_WAIT) !=
DC1394_SUCCESS)
#else
if (dc1394_dma_single_capture(&this->camera) != DC1394_SUCCESS)
--- 1125,1129 ----
case methodVideo:
#if LIBDC1394_VERSION == 0200
! if (dc1394_capture_dma(&this->camera,1,DC1394_VIDEO1394_WAIT) !=
DC1394_SUCCESS)
#else
if (dc1394_dma_single_capture(&this->camera) != DC1394_SUCCESS)
***************
*** 1128,1134 ****
int * capture_buffer;
#if LIBDC1394_VERSION == 0200
! frame_width = camera->capture.frame_width;
! frame_height = camera->capture.frame_height;
! capture_buffer = (int *) camera->capture.capture_buffer;
#else
frame_width = this->camera.frame_width;
--- 1143,1149 ----
int * capture_buffer;
#if LIBDC1394_VERSION == 0200
! frame_width = dc1394_capture_get_width(camera);
! frame_height = dc1394_capture_get_height(camera);
! capture_buffer = (int *) dc1394_capture_get_dma_buffer(camera);
#else
frame_width = this->camera.frame_width;
***************
*** 1312,1316 ****
}
#if LIBDC1394_VERSION == 0200
! if (this->method == methodVideo) dc1394_dma_done_with_buffer(this->camera);
#else
if (this->method == methodVideo) dc1394_dma_done_with_buffer(&this->camera);
--- 1327,1331 ----
}
#if LIBDC1394_VERSION == 0200
! if (this->method == methodVideo)
dc1394_capture_dma_done_with_buffer(this->camera);
#else
if (this->method == methodVideo) dc1394_dma_done_with_buffer(&this->camera);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit