libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd cvd/videosource.h cvd_src/videosource.cpp


From: Gerhard Reitmayr
Subject: [libcvd-members] libcvd cvd/videosource.h cvd_src/videosource.cpp
Date: Mon, 14 Jan 2008 23:14:54 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Gerhard Reitmayr <gerhard>      08/01/14 23:14:54

Modified files:
        cvd            : videosource.h 
        cvd_src        : videosource.cpp 

Log message:
        added new show settings flag for QTBuffer to videosource

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/videosource.h?cvsroot=libcvd&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/videosource.cpp?cvsroot=libcvd&r1=1.2&r2=1.3

Patches:
Index: cvd/videosource.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/videosource.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- cvd/videosource.h   16 Dec 2007 19:18:39 -0000      1.4
+++ cvd/videosource.h   14 Jan 2008 23:14:54 -0000      1.5
@@ -105,13 +105,13 @@
 #endif
 
 #if CVD_HAVE_QTBUFFER
-    template <class T> VideoBuffer<T> * makeQTBuffer( const ImageRef & size, 
int input)
+    template <class T> VideoBuffer<T> * makeQTBuffer( const ImageRef & size, 
int input, bool showsettings)
     {
        throw VideoSourceException("QTBuffer cannot handle types other than 
vuy422");
     }
-    template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, int 
input);
+    template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, int 
input, bool showsettings);
     
-    void get_qt_options(const VideoSource & vs, ImageRef & size);
+    void get_qt_options(const VideoSource & vs, ImageRef & size, bool & 
showsettings);
 #endif
 
     template <class T> VideoBuffer<T>* open_video_source(const VideoSource& vs)
@@ -156,9 +156,10 @@
 #if CVD_HAVE_QTBUFFER
     else if (vs.protocol == "qt") {
         ImageRef size;
+        bool showsettings;
         int input = atoi(vs.identifier.c_str());
-        get_qt_options(vs, size);
-        return makeQTBuffer<T>(size, input);
+        get_qt_options(vs, size, showsettings);
+        return makeQTBuffer<T>(size, input, showsettings);
     }
 #endif
        else
@@ -199,7 +200,7 @@
 The url syntax is the following:
 @verbatim
 url      := protocol ':' [ '[' options ']' ] // identifier
-protocol := "files" | "file" | "v4l2" | "dc1394"
+protocol := "files" | "file" | "v4l2" | "dc1394" | "qt"
 options  := option [ ',' options ]
 option   := name [ '=' value ]
 @endverbatim
@@ -237,6 +238,11 @@
 file://../../stuff/movie.avi
 @endverbatim
 
+Open the first QuickTime camera and show the settings dialog
address@hidden
+qt:[showsettings=1]//0
address@hidden
+
 Options supported by the various protocols are:
 @verbatim
 'files' protocol (DiskBuffer2):  identifier is glob pattern
@@ -258,6 +264,11 @@
        dma_bufs | dma_buffers = <number> (default 3)
        brightness | bright = <number> (default -1)
        exposure | exp = <number> (default -1)
+
+'qt' protocol (QTBuffer): identifier is camera number
+      size = vga | qvga | <width>x<height>  (default vga)
+      showsettings = 0 | 1 (default 0)
+
 @endverbatim
 
 @ingroup gVideo

Index: cvd_src/videosource.cpp
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/videosource.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- cvd_src/videosource.cpp     16 Dec 2007 19:18:39 -0000      1.2
+++ cvd_src/videosource.cpp     14 Jan 2008 23:14:54 -0000      1.3
@@ -361,13 +361,14 @@
 #endif
 
 #if CVD_HAVE_QTBUFFER
-    template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, int 
input)
+    template <> VideoBuffer<vuy422> * makeQTBuffer( const ImageRef & size, int 
input, bool showsettings)
     {
-        return new CVD::QTBuffer<vuy422>(size, input);
+        return new CVD::QTBuffer<vuy422>(size, input, showsettings);
     }
     
-    void get_qt_options(const VideoSource & vs, ImageRef & size){
+    void get_qt_options(const VideoSource & vs, ImageRef & size, bool & 
showsettings){
        size = ImageRef(640, 480);
+       showsettings = false;
        for (VideoSource::option_list::const_iterator it=vs.options.begin(); it 
!= vs.options.end(); ++it) {
                if (it->first == "size") {
                std::string s = it->second;
@@ -382,6 +383,9 @@
                    if (!(size_in >> size.x >> x >> size.y))
                        throw ParseException("invalid image size specification: 
'"+it->second+"'\n\t valid specs: vga, qvga, <width>x<height>");
                }
+               }
+               else if(it->first == "showsettings") {
+                   showsettings = atoi(it->second.c_str());
            } else
                throw VideoSourceException("invalid option for 'qt' protocol: 
"+it->first+"\n\t valid options: size");
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]