Experimental MS Media Foundation API support added
This commit is contained in:
@@ -106,7 +106,19 @@ elseif(APPLE)
|
||||
endif()
|
||||
|
||||
if(WIN32 AND NOT ARM)
|
||||
list(APPEND highgui_srcs src/cap_dshow.cpp src/cap_vfw.cpp src/cap_cmu.cpp)
|
||||
list(APPEND highgui_srcs src/cap_cmu.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND HAVE_DSHOW)
|
||||
list(APPEND highgui_srcs src/cap_dshow.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND HAVE_MSMF)
|
||||
list(APPEND highgui_srcs src/cap_msmf.cpp)
|
||||
endif()
|
||||
|
||||
if (WIN32 AND HAVE_VFW)
|
||||
list(APPEND highgui_srcs src/cap_vfw.cpp)
|
||||
endif()
|
||||
|
||||
if(HAVE_XINE)
|
||||
|
@@ -297,6 +297,7 @@ enum
|
||||
CV_CAP_UNICAP =600, // Unicap drivers
|
||||
|
||||
CV_CAP_DSHOW =700, // DirectShow (via videoInput)
|
||||
CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput)
|
||||
|
||||
CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK
|
||||
|
||||
|
@@ -114,7 +114,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
{
|
||||
int domains[] =
|
||||
{
|
||||
#ifdef HAVE_VIDEOINPUT
|
||||
#ifdef HAVE_DSHOW
|
||||
CV_CAP_DSHOW,
|
||||
#endif
|
||||
#if 1
|
||||
@@ -168,7 +168,8 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
// try every possibly installed camera API
|
||||
for (int i = 0; domains[i] >= 0; i++)
|
||||
{
|
||||
#if defined(HAVE_VIDEOINPUT) || \
|
||||
#if defined(HAVE_DSHOW) || \
|
||||
defined(HAVE_MSMF) || \
|
||||
defined(HAVE_TYZX) || \
|
||||
defined(HAVE_VFW) || \
|
||||
defined(HAVE_LIBV4L) || \
|
||||
@@ -195,7 +196,14 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
|
||||
|
||||
switch (domains[i])
|
||||
{
|
||||
#ifdef HAVE_VIDEOINPUT
|
||||
#ifdef HAVE_MSMF
|
||||
case CV_CAP_MSMF:
|
||||
capture = cvCreateCameraCapture_MSMF (index);
|
||||
if (capture)
|
||||
return capture;
|
||||
break;
|
||||
#endif
|
||||
#ifdef HAVE_DSHOW
|
||||
case CV_CAP_DSHOW:
|
||||
capture = cvCreateCameraCapture_DShow (index);
|
||||
if (capture)
|
||||
|
@@ -41,7 +41,7 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#if (defined WIN32 || defined _WIN32) && defined HAVE_VIDEOINPUT
|
||||
#if (defined WIN32 || defined _WIN32) && defined HAVE_DSHOW
|
||||
|
||||
/*
|
||||
DirectShow-based Video Capturing module is based on
|
||||
@@ -3100,6 +3100,7 @@ HRESULT videoInput::routeCrossbar(ICaptureGraphBuilder2 **ppBuild, IBaseFilter *
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
/********************* Capturing video from camera via DirectShow *********************/
|
||||
|
||||
class CvCaptureCAM_DShow : public CvCapture
|
||||
|
3722
modules/highgui/src/cap_msmf.cpp
Normal file
3722
modules/highgui/src/cap_msmf.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -118,6 +118,7 @@ CvVideoWriter* cvCreateVideoWriter_Win32( const char* filename, int fourcc,
|
||||
CvVideoWriter* cvCreateVideoWriter_VFW( const char* filename, int fourcc,
|
||||
double fps, CvSize frameSize, int is_color );
|
||||
CvCapture* cvCreateCameraCapture_DShow( int index );
|
||||
CvCapture* cvCreateCameraCapture_MSMF( int index );
|
||||
CvCapture* cvCreateCameraCapture_OpenNI( int index );
|
||||
CvCapture* cvCreateFileCapture_OpenNI( const char* filename );
|
||||
CvCapture* cvCreateCameraCapture_Android( int index );
|
||||
|
@@ -18,7 +18,7 @@
|
||||
#include "opencv2/imgproc/imgproc_c.h"
|
||||
#include <iostream>
|
||||
|
||||
#if defined(HAVE_VIDEOINPUT) || \
|
||||
#if defined(HAVE_DSHOW) || \
|
||||
defined(HAVE_TYZX) || \
|
||||
defined(HAVE_VFW) || \
|
||||
defined(HAVE_LIBV4L) || \
|
||||
@@ -34,7 +34,7 @@
|
||||
defined(HAVE_OPENNI) || \
|
||||
defined(HAVE_XIMEA) || \
|
||||
defined(HAVE_AVFOUNDATION) || \
|
||||
defined(HAVE_GIGE_API) || \
|
||||
defined(HAVE_GIGE_API) || \
|
||||
(0)
|
||||
//defined(HAVE_ANDROID_NATIVE_CAMERA) || - enable after #1193
|
||||
# define BUILD_WITH_CAMERA_SUPPORT 1
|
||||
|
Reference in New Issue
Block a user