Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vidl2_dc1394_istream.h

Go to the documentation of this file.
00001 // This is brl/bbas/vidl2/vidl2_dc1394_istream.h
00002 #ifndef vidl2_dc1394_istream_h_
00003 #define vidl2_dc1394_istream_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief A video input stream using libdc1394
00010 //
00011 // \author Matt Leotta
00012 // \date 6 Jan 2006
00013 //
00014 // \b WARNING this stream requires version 2 of the libdc1394 API.
00015 // if you are also using the ffmpeg streams make sure your libavcodec
00016 // and libavformat library are compiled without dc1394 support.
00017 // ffmpeg supplies limited 1394 support through the libdc1394
00018 // version 1 API.  Linking to both versions of libdc1394 will result
00019 // in linking errors.
00020 //
00021 // Currently this code works with libdc1394 version 2.0.0-rc9.
00022 // The authors note that the libdc1394 API is subject to change in
00023 // prerelease version.  As a result, the vidl2_dc1394_istream is
00024 // is subject to change with it.
00025 
00026 #include "vidl2_istream.h"
00027 #include "vidl2_iidc1394_params.h"
00028 #include <vcl_string.h>
00029 
00030 
00031 //: A video input stream using libdc1394
00032 // This stream uses the dc1394 API (v2.0) to stream
00033 // video from a IEEE 1394 camera
00034 class vidl2_dc1394_istream
00035   : public vidl2_istream
00036 {
00037  public:
00038   //: Constructor - default
00039   vidl2_dc1394_istream();
00040 
00041   //: Constructor - from a filename
00042   vidl2_dc1394_istream(const vcl_string& filename);
00043 
00044   //: Destructor
00045   virtual ~vidl2_dc1394_istream();
00046 
00047   //: Open a new stream using a filename
00048   virtual bool open(unsigned int num_dma_buffers = 2,
00049                     bool drop_frames = false,
00050                     const vidl2_iidc1394_params& params = vidl2_iidc1394_params());
00051 
00052   //: Close the stream
00053   virtual void close();
00054 
00055   //: Probe the bus to determine the valid parameter options
00056   static bool valid_params(vidl2_iidc1394_params::valid_options& options);
00057 
00058 
00059   //: Return true if the stream is open for reading
00060   virtual bool is_open() const;
00061 
00062   //: Return true if the stream is in a valid state
00063   virtual bool is_valid() const;
00064 
00065   //: Return true if the stream support seeking
00066   virtual bool is_seekable() const;
00067 
00068   //: Return the current frame number
00069   virtual unsigned int frame_number() const;
00070 
00071   //: Advance to the next frame (but don't acquire an image)
00072   virtual bool advance();
00073 
00074   //: Read the next frame from the stream (advance and acquire)
00075   virtual vidl2_frame_sptr read_frame();
00076 
00077   //: Return the current frame in the stream
00078   virtual vidl2_frame_sptr current_frame();
00079 
00080   //: Seek to the given frame number
00081   // \returns true if successful
00082   virtual bool seek_frame(unsigned int frame_number);
00083 
00084  private:
00085   //: The private implementation (PIMPL) details.
00086   //  This isolates the clients from the ffmpeg details
00087   struct pimpl;
00088   pimpl* is_;
00089 };
00090 
00091 #endif // vidl2_dc1394_istream_h_

Generated on Thu Jan 10 14:51:31 2008 for contrib/brl/bbas/vidl2 by  doxygen 1.4.4