00001 /* --------------------------------------------------------------------------- 00002 Phission : 00003 Realtime Vision Processing System 00004 00005 Copyright (C) 2003-2006 Philip D.S. Thoren (pthoren@cs.uml.edu) 00006 University of Massachusetts at Lowell, 00007 Laboratory for Artificial Intelligence and Robotics 00008 00009 This file is part of Phission. 00010 00011 Phission is free software; you can redistribute it and/or modify 00012 it under the terms of the GNU Lesser General Public License as published by 00013 the Free Software Foundation; either version 2 of the License, or 00014 (at your option) any later version. 00015 00016 Phission is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU Lesser General Public License for more details. 00020 00021 You should have received a copy of the GNU Lesser General Public License 00022 along with Phission; if not, write to the Free Software 00023 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 00025 ---------------------------------------------------------------------------*/ 00026 #ifndef _PHAVCODECCAPTURE_H 00027 #define _PHAVCODECCAPTURE_H 00028 00029 /* ---------------------------------------------------------------------- */ 00030 #include <phImageCapture.h> 00031 00032 /* ---------------------------------------------------------------------- */ 00038 /* ---------------------------------------------------------------------- */ 00039 typedef struct phAvcodecSourceInfo_t *phAvcodecSourceInfo; 00040 /* end \addtogroup Capture */ 00042 00043 /* ---------------------------------------------------------------------- */ 00049 PHAPI(class) phAvcodecSource : public phImageCapture 00050 { 00051 00052 protected: 00053 phAvcodecSourceInfo m_info; 00054 00055 int m_device_fd; 00056 int m_is_open; 00057 00058 int m_stream_open; 00059 int m_codec_open; 00060 int m_buffers_open; 00061 00062 int m_user_fps; 00063 int m_user_delay; 00064 int m_loop; 00065 00066 int resetInfo(); 00067 int freeInfo(); 00068 00069 /* These are called internally and don't actually lock the object */ 00070 /* ... quiet is used to suppress verbose error printing so the constructor 00071 * can try to determine video file information (or the onApplySettings 00072 * method) for a given path */ 00073 void calculateRates(); 00074 int openStream ( int quiet = 0 ); 00075 int openCodec (); 00076 int openBuffers (); 00077 int closeStream (); 00078 int closeCodec (); 00079 int closeBuffers (); 00080 00081 /* on close, the class retains all previous knowledge 00082 * except the device capabilities. */ 00083 virtual int open(char *deviceName); 00084 virtual int close(); 00085 00086 /* phThread overloaded methods */ 00087 virtual int run(); 00088 virtual int cleanup(); 00089 00090 public: 00091 phAvcodecSource(char *deviceName = NULL); 00092 ~phAvcodecSource(); 00093 00094 int setFps( int fps ); 00095 int getFps(); 00096 00097 int setDelay( int delay ); 00098 int getDelay(); 00099 00100 int setLoop( int loop ); 00101 int getLoop(); 00102 00103 virtual int onApplySettings(); 00104 00105 virtual int isOpen(); 00106 }; 00107 00108 #endif /* _PHAVCODECCAPTURE_H */
Copyright (C) 2002 - 2007 |
Philip D.S. Thoren ( pthoren@users.sourceforge.net ) University Of Massachusetts at Lowell Robotics Lab |