00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <iostream>
00025 #include <l1394_session.h>
00026
00027 using namespace L1394;
00028
00029
00030
00031
00032
00033
00034
00035 void setParameter(Camera* camera)
00036 {
00037 if (camera->whiteBalance()->hasFeature())
00038 camera->whiteBalance()->onePush();
00039
00040
00041
00042
00043
00044
00045
00046 if (camera->zoom()->hasFeature())
00047 {
00048 camera->zoom()->setValue(camera->zoom()->getMinValue());
00049 if (camera->zoom()->getValue() == camera->zoom()->getMinValue())
00050 cout << "Zoom value is set correct" << endl;
00051 else
00052 cout << "Zoom value is not set correct" << endl;
00053 }
00054 else
00055 cout << "Zoom feature not present" << endl;
00056
00057
00058 if (camera->gamma()->hasFeature())
00059 {
00060 camera->gamma()->setValue(camera->gamma()->getMinValue());
00061 if (camera->gamma()->getValue() == camera->gamma()->getMinValue())
00062 cout << "Gamma value is set correct" << endl;
00063 else
00064 cout << "Gamma value is not set correct" << endl;
00065 }
00066 else
00067 cout << "Gamma feature not present" << endl;
00068
00069
00070
00071 if (camera->hue()->hasFeature())
00072 {
00073 camera->hue()->setValue(camera->hue()->getMinValue());
00074 if (camera->hue()->getValue() == camera->hue()->getMinValue())
00075 cout << "Hue value is set correct" << endl;
00076 else
00077 cout << "Hue value is not set correct" << endl;
00078 }
00079 else
00080 cout << "Hue feature not present" << endl;
00081
00082
00083
00084 if (camera->saturation()->hasFeature())
00085 {
00086 camera->saturation()->setValue(camera->saturation()->getMinValue());
00087 if (camera->saturation()->getValue() == camera->saturation()->getMinValue())
00088 cout << "Saturation value is set correct" << endl;
00089 else
00090 cout << "Saturation value is not set correct" << endl;
00091 }
00092 else
00093 cout << "Saturation feature not present" << endl;
00094
00095
00096 }
00097
00098 int main()
00099 {
00100 Session* session = SSession::getInstance();
00101 if (!session) {
00102 cerr << "Could not get Session object" << endl;
00103 return 0;
00104 }
00105
00106
00107 list<DccCamera*> camera_list = session->getAllDccCameras();
00108
00109 if (camera_list.size() == 0) {
00110 cout << "No camera found. " <<endl;
00111 exit(0);
00112 }
00113
00114 DccCamera* camera = 0;
00115 for(list<DccCamera*>::iterator it = camera_list.begin(); it != camera_list.end(); it++)
00116 {
00117
00118 camera = *it;
00119 if (camera->setParameter(30, FREE_ISO_CHANNEL , DEVICE_ISO_RUN, DEVICE_320x240_YUV_422 ,DEVICE_FRAMES_30) != L1394_SUCCESS)
00120 {
00121 cout << "could not set Parameter" << endl;
00122 return 0;
00123 }
00124 if (camera->init() != L1394_SUCCESS)
00125 {
00126 cout << "could not init the camera" << endl;
00127 return 0;
00128 }
00129 camera->start();
00130 }
00131 while(1) {
00132 cout << ".";
00133 cout.flush();
00134 camera->getFrame();
00135
00136 }
00137 return 0;
00138 }