libcvd-members
[Top][All Lists]
Advanced

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

[libcvd-members] libcvd/cvd videosource.h


From: Gerhard Reitmayr
Subject: [libcvd-members] libcvd/cvd videosource.h
Date: Fri, 17 Nov 2006 14:50:26 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Gerhard Reitmayr <gerhard>      06/11/17 14:50:24

Modified files:
        cvd            : videosource.h 

Log message:
        added documentation from the checkin log

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/videosource.h?cvsroot=libcvd&r1=1.1&r2=1.2

Patches:
Index: videosource.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/videosource.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- videosource.h       28 Sep 2006 17:14:47 -0000      1.1
+++ videosource.h       17 Nov 2006 14:50:24 -0000      1.2
@@ -149,6 +149,12 @@
                                       "files");
     }
     
+/**
+opens a video device described by a video source url given from an input 
stream. See
address@hidden open_video_source(const std::string &) for details on the url 
syntax.
+
address@hidden gVideo
+*/
     template <class T> VideoBuffer<T>* open_video_source(std::istream& in)
     {
        VideoSource vs;
@@ -156,6 +162,68 @@
        return open_video_source<T>(vs);
     }
     
+/**
+opens a video device described by a video source url. This allows to decide at
+runtime what kind of video input your program is using. Basic use is to call
+open_video_source<T>(url) to get a VideoBuffer<T>*.
+
+The url syntax is the following:
address@hidden
+url      := protocol ':' [ '[' options ']' ] // identifier
+protocol := "files" | "file" | "v4l2" | "dc1394"
+options  := option [ ',' options ]
+option   := name [ '=' value ]
address@hidden
+
+identifier and values can be quoted literals with escapes, all other text is 
unquoted.
+Some Examples:
+
address@hidden
+Open a DiskBuffer2 for *.pgm in /local/capture/:
+files:///local/capture/*.pgmKilled by signal 2.
+files:///local/capture/*.pgm
+Open a DiskBuffer2 that loops and uses a ReadAheadVideoBuffer wrapper with
+40 frame buffer, with 30 fps:
+files:[read_ahead=40, fps=30, on_end=loop]///local/capture/*.pgm
+
+Open a V4L2 device at /dev/video0:
+v4l2:///dev/video0
+
+Open a V4L2 device with fields on input 2:
+v4l2:[input=2,fields]\///dev/video0
+
+Open firewire camera 1 with 3 dma bufs and default brightness/exposure and fps:
+dc1394:[dma_bufs=3]//1
+
+Open an avi file relative to the current directory:
+file://../../stuff/movie.avi
address@hidden
+
+Options supported by the various protocols are:
address@hidden
+'files' protocol (DiskBuffer2):  identifier is glob pattern
+        fps = <number>
+        read_ahead [= <number>] (default is 50 if specified without value)
+        on_end = repeat_last | unset_pending | loop (default is repeat_last)
+
+'file' protocol (VideoFileBuffer): identifier is path to file
+       read_ahead  [= <number>] (default is 50 if specified without value)
+       on_end = repeat_last | unset_pending | loop (default is repeat_last)
+
+'v4l2' protocol (V4LBuffer): identifier is device name
+       size = vga | qvga | pal | ntsc | <width>x<height>  (default vga)
+       input = <number>
+       interlaced | fields [= true | false | yes | no]
+
+'dc1394' protocol (DVBuffer): identifier is camera number
+       fps = <number> (default 30)
+       dma_bufs | dma_buffers = <number> (default 3)
+       brightness | bright = <number> (default -1)
+       exposure | exp = <number> (default -1)
address@hidden
+
address@hidden gVideo
+*/
     template <class T> VideoBuffer<T>* open_video_source(const std::string& 
src)
     {
        std::istringstream in(src);




reply via email to

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