1 /*M///////////////////////////////////////////////////////////////////////////////////////
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
10 // Intel License Agreement
11 // For Open Source Computer Vision Library
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
14 // Third party copyrights are property of their respective owners.
16 // Redistribution and use in source and binary forms, with or without modification,
17 // are permitted provided that the following conditions are met:
19 // * Redistribution's of source code must retain the above copyright notice,
20 // this list of conditions and the following disclaimer.
22 // * Redistribution's in binary form must reproduce the above copyright notice,
23 // this list of conditions and the following disclaimer in the documentation
24 // and/or other materials provided with the distribution.
26 // * The name of Intel Corporation may not be used to endorse or promote products
27 // derived from this software without specific prior written permission.
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
45 #include "opencv2/videoio.hpp"
47 #include "opencv2/core/utility.hpp"
48 #include "opencv2/core/private.hpp"
50 #include "opencv2/imgcodecs.hpp"
52 #include "opencv2/imgproc/imgproc_c.h"
53 #include "opencv2/imgcodecs/imgcodecs_c.h"
54 #include "opencv2/videoio/videoio_c.h"
63 #if defined WIN32 || defined WINCE
64 #if !defined _WIN32_WINNT
66 #define _WIN32_WINNT 0x0600 // Windows Vista
68 #define _WIN32_WINNT 0x0500 // Windows 2000
79 #ifdef HAVE_TEGRA_OPTIMIZATION
80 #include "opencv2/videoio/videoio_tegra.hpp"
83 #define __BEGIN__ __CV_BEGIN__
84 #define __END__ __CV_END__
85 #define EXIT __CV_EXIT__
87 /***************************** CvCapture structure ******************************/
91 virtual ~CvCapture() {}
92 virtual double getProperty(int) { return 0; }
93 virtual bool setProperty(int, double) { return 0; }
94 virtual bool grabFrame() { return true; }
95 virtual IplImage* retrieveFrame(int) { return 0; }
96 virtual int getCaptureDomain() { return CV_CAP_ANY; } // Return the type of the capture object: CV_CAP_VFW, etc...
99 /*************************** CvVideoWriter structure ****************************/
103 virtual ~CvVideoWriter() {}
104 virtual bool writeFrame(const IplImage*) { return false; }
107 CvCapture * cvCreateCameraCapture_V4L( int index );
108 CvCapture * cvCreateCameraCapture_DC1394( int index );
109 CvCapture * cvCreateCameraCapture_DC1394_2( int index );
110 CvCapture* cvCreateCameraCapture_MIL( int index );
111 CvCapture* cvCreateCameraCapture_Giganetix( int index );
112 CvCapture * cvCreateCameraCapture_CMU( int index );
113 CV_IMPL CvCapture * cvCreateCameraCapture_TYZX( int index );
114 CvCapture* cvCreateFileCapture_Win32( const char* filename );
115 CvCapture* cvCreateCameraCapture_VFW( int index );
116 CvCapture* cvCreateFileCapture_VFW( const char* filename );
117 CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
118 double fps, CvSize frameSize, int is_color );
119 CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
120 double fps, CvSize frameSize, int is_color );
121 CvCapture* cvCreateCameraCapture_DShow( int index );
122 CvCapture* cvCreateCameraCapture_MSMF( int index );
123 CvCapture* cvCreateFileCapture_MSMF (const char* filename);
124 CvVideoWriter* cvCreateVideoWriter_MSMF( const char* filename, int fourcc,
125 double fps, CvSize frameSize, int is_color );
126 CvCapture* cvCreateCameraCapture_OpenNI( int index );
127 CvCapture* cvCreateFileCapture_OpenNI( const char* filename );
128 CvCapture* cvCreateCameraCapture_Android( int index );
129 CvCapture* cvCreateCameraCapture_XIMEA( int index );
130 CvCapture* cvCreateCameraCapture_AVFoundation(int index);
132 CvCapture* cvCreateFileCapture_Images(const char* filename);
133 CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
135 CvCapture* cvCreateFileCapture_XINE (const char* filename);
138 #define CV_CAP_GSTREAMER_1394 0
139 #define CV_CAP_GSTREAMER_V4L 1
140 #define CV_CAP_GSTREAMER_V4L2 2
141 #define CV_CAP_GSTREAMER_FILE 3
143 CvCapture* cvCreateCapture_GStreamer(int type, const char *filename);
144 CvCapture* cvCreateFileCapture_FFMPEG_proxy(const char* filename);
147 CvVideoWriter* cvCreateVideoWriter_FFMPEG_proxy( const char* filename, int fourcc,
148 double fps, CvSize frameSize, int is_color );
150 CvCapture * cvCreateFileCapture_QT (const char * filename);
151 CvCapture * cvCreateCameraCapture_QT (const int index);
153 CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
154 double fps, CvSize frameSize, int is_color );
156 CvCapture* cvCreateFileCapture_AVFoundation (const char * filename);
157 CvVideoWriter* cvCreateVideoWriter_AVFoundation( const char* filename, int fourcc,
158 double fps, CvSize frameSize, int is_color );
161 CvCapture * cvCreateCameraCapture_Unicap (const int index);
162 CvCapture * cvCreateCameraCapture_PvAPI (const int index);
163 CvVideoWriter* cvCreateVideoWriter_GStreamer( const char* filename, int fourcc,
164 double fps, CvSize frameSize, int is_color );
171 virtual ~IVideoCapture() {}
172 virtual double getProperty(int) { return 0; }
173 virtual bool setProperty(int, double) { return 0; }
174 virtual bool grabFrame() = 0;
175 virtual bool retrieveFrame(int, cv::OutputArray) = 0;
176 virtual int getCaptureDomain() { return CAP_ANY; } // Return the type of the capture object: CAP_VFW, etc...
180 #endif /* __VIDEOIO_H_ */