00001 /* -------------------------------------------------------------------------- 00002 * Copyright (c) 2004-2007 Philip Lamb (PRL) phil@eden.net.nz. All rights reserved. 00003 * This file is part of ARToolKit. 00004 * 00005 * ARToolKit is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * ARToolKit is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with ARToolKit; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * -------------------------------------------------------------------------*/ 00059 /* -------------------------------------------------------------------------- 00060 * History : 00061 * Rev Date Who Changes 00062 * 2.6.8 2004-07-20 PRL Rewrite for ARToolKit 2.68.2 00063 * 00064 *---------------------------------------------------------------------------- 00065 */ 00066 00067 #ifndef AR_VIDEO_H 00068 #define AR_VIDEO_H 00069 00070 #ifdef __cplusplus 00071 extern "C" { 00072 #endif 00073 00074 // ============================================================================ 00075 // Public includes. 00076 // ============================================================================ 00077 00078 #include <AR/config.h> 00079 #include <AR/ar.h> 00080 00081 // ============================================================================ 00082 // Public types and defines. 00083 // ============================================================================ 00084 00085 #ifdef _WIN32 00086 # include <AR/sys/videoWin32DirectShow.h> 00087 # ifdef LIBARVIDEO_EXPORTS 00088 # define AR_DLL_API __declspec(dllexport) 00089 # else 00090 # ifdef _DLL 00091 # define AR_DLL_API __declspec(dllimport) 00092 # else 00093 # define AR_DLL_API extern 00094 # endif 00095 # endif 00096 #else 00097 # define AR_DLL_API 00098 #endif 00099 00100 #ifdef __linux 00101 # ifdef AR_INPUT_V4L 00102 # include <AR/sys/videoLinuxV4L.h> 00103 # endif 00104 # ifdef AR_INPUT_DV 00105 # include <AR/sys/videoLinuxDV.h> 00106 # endif 00107 # ifdef AR_INPUT_1394CAM 00108 # include <AR/sys/videoLinux1394Cam.h> 00109 # endif 00110 # ifdef AR_INPUT_GSTREAMER 00111 # include <AR/sys/videoGStreamer.h> 00112 # endif 00113 #endif 00114 00115 #ifdef __sgi 00116 # include <AR/sys/videoSGI.h> 00117 #endif 00118 00119 #ifdef __APPLE__ 00120 # include <AR/sys/videoMacOSX.h> 00121 #endif 00122 00123 // ============================================================================ 00124 // Public globals. 00125 // ============================================================================ 00126 00127 // ============================================================================ 00128 // Public functions. 00129 // ============================================================================ 00130 00131 /* 00132 mono-camera 00133 */ 00134 00143 AR_DLL_API int arVideoDispOption(void); 00144 00161 AR_DLL_API int arVideoOpen(char *config); 00162 00171 AR_DLL_API int arVideoClose(void); 00172 00184 AR_DLL_API int arVideoCapStart(void); 00185 00197 AR_DLL_API int arVideoCapStop(void); 00198 00217 AR_DLL_API int arVideoCapNext(void); 00218 00243 AR_DLL_API ARUint8* arVideoGetImage(void); 00244 00254 AR_DLL_API int arVideoInqSize(int *x, int *y); 00255 00256 /* 00257 multiple cameras 00258 */ 00259 00265 AR_DLL_API int ar2VideoDispOption(void); 00266 00285 AR_DLL_API AR2VideoParamT *ar2VideoOpen(char *config); 00286 00293 AR_DLL_API int ar2VideoClose(AR2VideoParamT *vid); 00294 00301 AR_DLL_API int ar2VideoCapStart(AR2VideoParamT *vid); 00302 00309 AR_DLL_API int ar2VideoCapNext(AR2VideoParamT *vid); 00310 00317 AR_DLL_API int ar2VideoCapStop(AR2VideoParamT *vid); 00318 00325 AR_DLL_API ARUint8 *ar2VideoGetImage(AR2VideoParamT *vid); 00326 00333 AR_DLL_API int ar2VideoInqSize(AR2VideoParamT *vid, int *x, int *y); 00334 00335 // Functions added for Studierstube/OpenTracker. 00336 #ifdef _WIN32 00337 # ifndef __MEMORY_BUFFER_HANDLE__ 00338 # define __MEMORY_BUFFER_HANDLE__ 00339 # define DEFAULT_NUMBER_OF_ALLOCATOR_BUFFERS 3 00340 typedef struct _MemoryBufferHandle 00341 { 00342 unsigned long n; // sample number 00343 __int64 t; // timestamp 00344 } MemoryBufferHandle; 00345 # endif // __MEMORY_BUFFER_HANDLE__ 00346 AR_DLL_API int ar2VideoInqFreq(AR2VideoParamT *vid, float *fps); 00347 AR_DLL_API int ar2VideoInqFlipping(AR2VideoParamT *vid, int *flipH, int *flipV); 00348 AR_DLL_API unsigned char *ar2VideoLockBuffer(AR2VideoParamT *vid, MemoryBufferHandle *pHandle); 00349 AR_DLL_API int ar2VideoUnlockBuffer(AR2VideoParamT *vid, MemoryBufferHandle Handle); 00350 #endif // _WIN32 00351 00352 #ifdef __cplusplus 00353 } 00354 #endif 00355 00356 #endif // AR_VIDEO_H