CVD 0.8
cvd/IRIX/sgi-video.h
00001 /*                       
00002     This file is part of the CVD Library.
00003 
00004     Copyright (C) 2005 The Authors
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Lesser General Public
00008     License as published by the Free Software Foundation; either
00009     version 2.1 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU Lesser General Public
00017     License along with this library; if not, write to the Free Software
00018     Foundation, Inc., 
00019     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 */
00021 #ifndef _SGI_VIDEO_H
00022 #define _SGI_VIDEO_H
00023 
00024 #include <dmedia/dmedia.h>
00025 #include <dmedia/vl.h>
00026 #include <dmedia/dm_buffer.h>
00027 #include <dmedia/dm_params.h>
00028 //#include <cvd_image.h>
00029 #include <cvd/videoframe.h>
00030 
00031 
00032 namespace CVD
00033 {
00034 
00036 namespace SGI
00037 {
00039     extern int debug;
00041     extern int debug_sgi_events;
00042     
00044     unsigned long long  current_time();
00046     extern const unsigned long long time_div;
00047     
00050     class RawSGIVideo
00051     {
00052         public:
00053             
00056             RawSGIVideo(bool use_frames=false);
00057             ~RawSGIVideo();
00058             
00059 
00061             void    start();
00063             void    stop();
00064 
00066             unsigned char*  next_frame();
00067             
00069             int     x_size() const;
00070             
00072             int     y_size() const ;
00073             
00075             int     frame_size() const;
00076 
00078             float   frame_rate() const ;
00079 
00081             int     frame_number() const;
00082 
00084             unsigned char*  current_frame() const;  
00085             
00087             unsigned long long  frame_time() const;
00088 
00089 
00090         private:
00091 
00092             int         my_frame_number;
00093             int         my_frame_size;
00094             int         my_x_size;
00095             int         my_y_size;
00096             float       my_frame_rate;
00097             unsigned char*      my_current_frame;
00098             unsigned long long  my_timestamp;
00099         
00100             int         frame_number_div;
00101             int         frame_no;
00102         
00103 
00104             VLServer    svr;
00105             VLPath      vid_in;
00106             VLNode      source, drain;
00107             DMbuffer    buf[2];             
00108             int         locked_buffer;
00109             DMbufferpool        buff;
00110             bool        started;    
00111     };
00112             
00113 }
00114 
00115 }
00116 #endif