2014-07-10 22:27:32 +08:00
|
|
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
|
|
|
//
|
|
|
|
// By downloading, copying, installing or using the software you agree to this license.
|
|
|
|
// If you do not agree to this license, do not download, install,
|
|
|
|
// copy or use the software.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Intel License Agreement
|
|
|
|
// For Open Source Computer Vision Library
|
|
|
|
//
|
|
|
|
// Copyright (C) 2000, Intel Corporation, all rights reserved.
|
|
|
|
// Third party copyrights are property of their respective owners.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
// are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistribution's of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
//
|
|
|
|
// * Redistribution's in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
//
|
|
|
|
// * The name of Intel Corporation may not be used to endorse or promote products
|
|
|
|
// derived from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// This software is provided by the copyright holders and contributors "as is" and
|
|
|
|
// any express or implied warranties, including, but not limited to, the implied
|
|
|
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
|
|
|
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
|
|
|
// indirect, incidental, special, exemplary, or consequential damages
|
|
|
|
// (including, but not limited to, procurement of substitute goods or services;
|
|
|
|
// loss of use, data, or profits; or business interruption) however caused
|
|
|
|
// and on any theory of liability, whether in contract, strict liability,
|
|
|
|
// or tort (including negligence or otherwise) arising in any way out of
|
|
|
|
// the use of this software, even if advised of the possibility of such damage.
|
|
|
|
//
|
|
|
|
//M*/
|
|
|
|
|
|
|
|
#ifndef __VIDEOIO_H_
|
|
|
|
#define __VIDEOIO_H_
|
|
|
|
|
|
|
|
#include "opencv2/videoio.hpp"
|
|
|
|
|
|
|
|
#include "opencv2/core/utility.hpp"
|
|
|
|
#include "opencv2/core/private.hpp"
|
|
|
|
|
2014-07-20 22:27:14 +08:00
|
|
|
#include "opencv2/imgcodecs.hpp"
|
|
|
|
|
2015-10-10 19:42:26 +08:00
|
|
|
#include "opencv2/imgproc.hpp"
|
2014-07-10 22:27:32 +08:00
|
|
|
#include "opencv2/imgproc/imgproc_c.h"
|
|
|
|
#include "opencv2/imgcodecs/imgcodecs_c.h"
|
|
|
|
#include "opencv2/videoio/videoio_c.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <limits.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
2017-07-25 18:23:44 +08:00
|
|
|
#if defined _WIN32 || defined WINCE
|
2014-07-10 22:27:32 +08:00
|
|
|
#if !defined _WIN32_WINNT
|
|
|
|
#ifdef HAVE_MSMF
|
|
|
|
#define _WIN32_WINNT 0x0600 // Windows Vista
|
|
|
|
#else
|
2016-08-25 21:21:52 +08:00
|
|
|
#define _WIN32_WINNT 0x0501 // Windows XP
|
2014-07-10 22:27:32 +08:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#undef small
|
|
|
|
#undef min
|
|
|
|
#undef max
|
|
|
|
#undef abs
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __BEGIN__ __CV_BEGIN__
|
|
|
|
#define __END__ __CV_END__
|
|
|
|
#define EXIT __CV_EXIT__
|
|
|
|
|
|
|
|
/***************************** CvCapture structure ******************************/
|
|
|
|
|
|
|
|
struct CvCapture
|
|
|
|
{
|
|
|
|
virtual ~CvCapture() {}
|
2014-12-11 01:17:35 +08:00
|
|
|
virtual double getProperty(int) const { return 0; }
|
2014-07-10 22:27:32 +08:00
|
|
|
virtual bool setProperty(int, double) { return 0; }
|
|
|
|
virtual bool grabFrame() { return true; }
|
|
|
|
virtual IplImage* retrieveFrame(int) { return 0; }
|
2017-06-26 04:27:33 +08:00
|
|
|
virtual int getCaptureDomain() { return cv::CAP_ANY; } // Return the type of the capture object: CAP_VFW, etc...
|
2014-07-10 22:27:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
/*************************** CvVideoWriter structure ****************************/
|
|
|
|
|
|
|
|
struct CvVideoWriter
|
|
|
|
{
|
|
|
|
virtual ~CvVideoWriter() {}
|
|
|
|
virtual bool writeFrame(const IplImage*) { return false; }
|
|
|
|
};
|
|
|
|
|
|
|
|
CvCapture * cvCreateCameraCapture_V4L( int index );
|
2016-04-12 13:00:37 +08:00
|
|
|
CvCapture * cvCreateCameraCapture_V4L( const char* deviceName );
|
2014-07-10 22:27:32 +08:00
|
|
|
CvCapture * cvCreateCameraCapture_DC1394( int index );
|
|
|
|
CvCapture * cvCreateCameraCapture_DC1394_2( int index );
|
|
|
|
CvCapture* cvCreateCameraCapture_MIL( int index );
|
|
|
|
CvCapture* cvCreateCameraCapture_Giganetix( int index );
|
|
|
|
CvCapture * cvCreateCameraCapture_CMU( int index );
|
|
|
|
CvCapture* cvCreateFileCapture_Win32( const char* filename );
|
|
|
|
CvCapture* cvCreateCameraCapture_VFW( int index );
|
|
|
|
CvCapture* cvCreateFileCapture_VFW( const char* filename );
|
|
|
|
CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
|
|
|
|
double fps, CvSize frameSize, int is_color );
|
|
|
|
CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
|
|
|
|
double fps, CvSize frameSize, int is_color );
|
|
|
|
CvCapture* cvCreateCameraCapture_DShow( int index );
|
|
|
|
CvCapture* cvCreateCameraCapture_OpenNI( int index );
|
2015-08-09 11:42:48 +08:00
|
|
|
CvCapture* cvCreateCameraCapture_OpenNI2( int index );
|
2014-07-10 22:27:32 +08:00
|
|
|
CvCapture* cvCreateFileCapture_OpenNI( const char* filename );
|
2016-09-15 20:20:02 +08:00
|
|
|
CvCapture* cvCreateFileCapture_OpenNI2( const char* filename );
|
2014-07-10 22:27:32 +08:00
|
|
|
CvCapture* cvCreateCameraCapture_Android( int index );
|
|
|
|
CvCapture* cvCreateCameraCapture_XIMEA( int index );
|
2017-08-28 22:57:52 +08:00
|
|
|
CvCapture* cvCreateCameraCapture_XIMEA( const char* serialNumber );
|
2014-07-10 22:27:32 +08:00
|
|
|
CvCapture* cvCreateCameraCapture_AVFoundation(int index);
|
2016-10-08 04:22:46 +08:00
|
|
|
CvCapture* cvCreateCameraCapture_Aravis( int index );
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
CvCapture* cvCreateFileCapture_Images(const char* filename);
|
|
|
|
CvVideoWriter* cvCreateVideoWriter_Images(const char* filename);
|
|
|
|
|
|
|
|
|
|
|
|
#define CV_CAP_GSTREAMER_1394 0
|
|
|
|
#define CV_CAP_GSTREAMER_V4L 1
|
|
|
|
#define CV_CAP_GSTREAMER_V4L2 2
|
|
|
|
#define CV_CAP_GSTREAMER_FILE 3
|
|
|
|
|
|
|
|
CvCapture * cvCreateFileCapture_QT (const char * filename);
|
|
|
|
CvCapture * cvCreateCameraCapture_QT (const int index);
|
|
|
|
|
|
|
|
CvVideoWriter* cvCreateVideoWriter_QT ( const char* filename, int fourcc,
|
|
|
|
double fps, CvSize frameSize, int is_color );
|
|
|
|
|
|
|
|
CvCapture* cvCreateFileCapture_AVFoundation (const char * filename);
|
|
|
|
CvVideoWriter* cvCreateVideoWriter_AVFoundation( const char* filename, int fourcc,
|
|
|
|
double fps, CvSize frameSize, int is_color );
|
|
|
|
|
|
|
|
|
|
|
|
CvCapture * cvCreateCameraCapture_Unicap (const int index);
|
|
|
|
CvCapture * cvCreateCameraCapture_PvAPI (const int index);
|
|
|
|
CvVideoWriter* cvCreateVideoWriter_GStreamer( const char* filename, int fourcc,
|
|
|
|
double fps, CvSize frameSize, int is_color );
|
2017-06-14 22:09:32 +08:00
|
|
|
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
namespace cv
|
|
|
|
{
|
|
|
|
class IVideoCapture
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IVideoCapture() {}
|
2014-12-11 01:17:35 +08:00
|
|
|
virtual double getProperty(int) const { return 0; }
|
2015-03-27 20:15:59 +08:00
|
|
|
virtual bool setProperty(int, double) { return false; }
|
2014-07-10 22:27:32 +08:00
|
|
|
virtual bool grabFrame() = 0;
|
2015-03-26 05:39:29 +08:00
|
|
|
virtual bool retrieveFrame(int, OutputArray) = 0;
|
|
|
|
virtual bool isOpened() const = 0;
|
2014-07-10 22:27:32 +08:00
|
|
|
virtual int getCaptureDomain() { return CAP_ANY; } // Return the type of the capture object: CAP_VFW, etc...
|
|
|
|
};
|
2015-03-26 05:39:29 +08:00
|
|
|
|
|
|
|
class IVideoWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IVideoWriter() {}
|
|
|
|
virtual double getProperty(int) const { return 0; }
|
2015-03-27 20:15:59 +08:00
|
|
|
virtual bool setProperty(int, double) { return false; }
|
2015-03-26 05:39:29 +08:00
|
|
|
|
|
|
|
virtual bool isOpened() const = 0;
|
|
|
|
virtual void write(InputArray) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
Ptr<IVideoCapture> createMotionJpegCapture(const String& filename);
|
|
|
|
Ptr<IVideoWriter> createMotionJpegWriter( const String& filename, double fps, Size frameSize, bool iscolor );
|
2015-05-21 06:41:39 +08:00
|
|
|
|
|
|
|
Ptr<IVideoCapture> createGPhoto2Capture(int index);
|
|
|
|
Ptr<IVideoCapture> createGPhoto2Capture(const String& deviceName);
|
2018-04-20 17:30:54 +08:00
|
|
|
|
2018-04-16 20:59:25 +08:00
|
|
|
|
2018-04-20 17:30:54 +08:00
|
|
|
Ptr<IVideoCapture> createXINECapture(const char* filename);
|
2018-04-16 20:59:25 +08:00
|
|
|
|
|
|
|
Ptr<IVideoCapture> createGStreamerCapture(const String& filename);
|
|
|
|
Ptr<IVideoCapture> createGStreamerCapture(int index);
|
2018-05-15 20:12:49 +08:00
|
|
|
|
|
|
|
Ptr<cv::IVideoCapture> cvCreateFileCapture_FFMPEG_proxy(const String& filename);
|
|
|
|
Ptr<IVideoWriter> cvCreateVideoWriter_FFMPEG_proxy(const String& filename, int fourcc, double fps, Size frameSize, int isColor);
|
2018-04-25 23:19:14 +08:00
|
|
|
|
|
|
|
Ptr<IVideoCapture> cvCreateCapture_MSMF(int index);
|
|
|
|
Ptr<IVideoCapture> cvCreateCapture_MSMF(const String& filename);
|
|
|
|
Ptr<IVideoWriter> cvCreateVideoWriter_MSMF(const String& filename, int fourcc, double fps, Size frameSize, int is_color);
|
2016-09-15 04:22:35 +08:00
|
|
|
}
|
2014-07-10 22:27:32 +08:00
|
|
|
|
|
|
|
#endif /* __VIDEOIO_H_ */
|