I'm using Ubuntu mate. • Library: libdc1394−2.2.4 • Supporting Library: libraw1394−2.1.2 • Supporting Modules:ohci1394, video1394 ( ieee1394, raw1394 - not found in my kernel) • Linux Kernel: 4.4.0-34-generic, i686 GNU/Linux
my code successfully worked with IEEE1394(VT6306 FireWire controller) + camera.
While developing my card failure. so i purchased new one ( IEEE1394 PCI card with VT6307 FireWire controller) and run the same code. Its not working continuously. only captures 4 frame.
Any Initialization required for this VT6307 controller.
I set DMA Buffer size = 4 like below.
err=dc1394_capture_setup(camera, 4, DC1394_CAPTURE_FLAGS_DEFAULT);
But this code runs my old PCI card with VT6306 controller.
Sample code for reference.
int Dialog::capture()
{
unsigned int width = 1024, height = 1;
dc1394camera_list_t * list;
uint32_t selected_mode = DC1394_VIDEO_MODE_FORMAT7_0;
dc1394video_frame_t *frame=NULL;
dc1394camera_t *camera;
dc1394error_t err;
dc1394_t * d;
dc1394video_modes_t modes;
uint32_t loopcnt = 0;
d = dc1394_new();
if (!d)
return 1;
err=dc1394_camera_enumerate (d, list);
DC1394_ERR_RTN(err,"Failed to enumerate cameras");
if (list->num == 0)
{
dc1394_log_error("No cameras found");
return 1;
}
camera = dc1394_camera_new (d, list->ids[0].guid);
if (!camera)
{
dc1394_log_error("Failed to init cam %llx", list->ids[0].guid);
return 0;
}
dc1394_camera_free_list (list);
//Sets image size
err=dc1394_video_set_iso_speed(camera, DC1394_ISO_SPEED_400);
err=dc1394_video_set_mode(camera,(dc1394video_mode_t) selected_mode);
err=dc1394_format7_set_image_size(camera, (dc1394video_mode_t) selected_mode, width, height);
err=dc1394_capture_setup(camera, 4, DC1394_CAPTURE_FLAGS_DEFAULT);
err=dc1394_video_set_transmission(camera, DC1394_ON);
while(1)
{
loopcnt++;
err=dc1394_capture_dequeue(camera, DC1394_CAPTURE_POLICY_WAIT, &frame); // Capture
DC1394_ERR_RTN(err,"Problem getting an image");
err=dc1394_capture_enqueue(camera, frame); // Release the buffer
qDebug()<<" Capture Cnt = "<<loopcnt;
}
err=dc1394_video_set_transmission(camera, DC1394_OFF);
err=dc1394_capture_stop(camera);
dc1394_camera_free (camera);
dc1394_free (d);
}
help me.
Aucun commentaire:
Enregistrer un commentaire