Commit eb8366bb authored by vbystricky's avatar vbystricky

DShow camera as IVideoCapture object

parent e79ceb4b
......@@ -41,6 +41,7 @@
#include "precomp.hpp"
#include "cap_intelperc.hpp"
#include "cap_dshow.hpp"
#if defined _M_X64 && defined _MSC_VER && !defined CV_ICC
#pragma optimize("",off)
......@@ -115,9 +116,6 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
{
int domains[] =
{
#ifdef HAVE_DSHOW
CV_CAP_DSHOW,
#endif
#ifdef HAVE_MSMF
CV_CAP_MSMF,
#endif
......@@ -175,8 +173,7 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
// try every possibly installed camera API
for (int i = 0; domains[i] >= 0; i++)
{
#if defined(HAVE_DSHOW) || \
defined(HAVE_MSMF) || \
#if defined(HAVE_MSMF) || \
defined(HAVE_TYZX) || \
defined(HAVE_VFW) || \
defined(HAVE_LIBV4L) || \
......@@ -205,13 +202,6 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
switch (domains[i])
{
#ifdef HAVE_DSHOW
case CV_CAP_DSHOW:
capture = cvCreateCameraCapture_DShow (index);
if (capture)
return capture;
break;
#endif
#ifdef HAVE_MSMF
case CV_CAP_MSMF:
capture = cvCreateCameraCapture_MSMF (index);
......@@ -589,6 +579,9 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
{
int domains[] =
{
#ifdef HAVE_DSHOW
CV_CAP_DSHOW,
#endif
#ifdef HAVE_INTELPERC
CV_CAP_INTELPERC,
#endif
......@@ -607,18 +600,26 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
// try every possibly installed camera API
for (int i = 0; domains[i] >= 0; i++)
{
#if defined(HAVE_INTELPERC) || \
#if defined(HAVE_DSHOW) || \
defined(HAVE_INTELPERC) || \
(0)
Ptr<IVideoCapture> capture;
switch (domains[i])
{
#ifdef HAVE_DSHOW
case CV_CAP_DSHOW:
capture = Ptr<IVideoCapture>(new cv::VideoCapture_DShow(index));
if (capture)
return capture;
break; // CV_CAP_DSHOW
#endif
#ifdef HAVE_INTELPERC
case CV_CAP_INTELPERC:
capture = Ptr<IVideoCapture>(new cv::VideoCapture_IntelPerC());
if (capture)
return capture;
break; // CV_CAP_INTEL_PERC
break; // CV_CAP_INTEL_PERC
#endif
}
#endif
......@@ -628,7 +629,6 @@ Ptr<IVideoCapture> VideoCapture::createCameraCapture(int index)
return Ptr<IVideoCapture>();
}
VideoWriter::VideoWriter()
{}
......
This diff is collapsed.
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2014, Itseez, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
//M*/
#ifndef _CAP_DSHOW_HPP_
#define _CAP_DSHOW_HPP_
#include "precomp.hpp"
#ifdef HAVE_DSHOW
class videoInput;
namespace cv
{
class VideoCapture_DShow : public IVideoCapture
{
public:
VideoCapture_DShow(int index);
virtual ~VideoCapture_DShow();
virtual double getProperty(int propIdx);
virtual bool setProperty(int propIdx, double propVal);
virtual bool grabFrame();
virtual bool retrieveFrame(int outputType, OutputArray frame);
virtual int getCaptureDomain();
bool isOpened() const;
protected:
void open(int index);
void close();
int m_index, m_width, m_height, m_fourcc;
int m_widthSet, m_heightSet;
IplImage* m_frame;
static videoInput g_VI;
};
}
#endif //HAVE_DSHOW
#endif //_CAP_DSHOW_HPP_
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment