00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <iostream>
00024 #include <l1394_session.h>
00025
00026 using namespace L1394;
00027 using namespace std;
00028
00029 int exit() {
00030 return 0;
00031 }
00032
00033 int main()
00034 {
00035 Session* session = SSession::getInstance();
00036 if (!session) {
00037 cerr << "Could not get Session object" << endl;
00038 return 0;
00039 }
00040
00041
00042 Camera* camera = session->findCamera();
00043
00044 if (camera == NULL) {
00045 cout << "No camera found. " <<endl;
00046 return exit();
00047 }
00048 Videomode video_mode = DEVICE_160x120_YUV_444;
00049
00050 for (int i = DEVICE_160x120_YUV_444; i <= static_cast<int>(DEVICE_1600x1200_MONO); ++i) {
00051 if (camera->hasFramerate(static_cast<L1394::Videomode>(i), DEVICE_FRAMES_30)) {
00052 video_mode = static_cast<L1394::Videomode>(i);
00053 }
00054 }
00055 camera->setParameter(4, FREE_ISO_CHANNEL, DEVICE_ISO_RUN, video_mode,DEVICE_FRAMES_30);
00056 camera->init();
00057 camera->start();
00058 char q = 'a';
00059 while (q != 'q') {
00060 cout << " press 'q' to stop the camera" << endl;
00061 cin >> q;
00062 }
00063
00064 camera->stop();
00065 return exit();
00066 }