Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
d7597a86
Commit
d7597a86
authored
Jun 25, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
videoio: do not mix `CV_CAP` and `CAP_` APIs enum values
parent
460e9bf0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
56 deletions
+61
-56
gen_dict.json
modules/videoio/misc/gen_dict.json
+2
-0
cap.cpp
modules/videoio/src/cap.cpp
+57
-54
cap_aravis.cpp
modules/videoio/src/cap_aravis.cpp
+1
-1
precomp.hpp
modules/videoio/src/precomp.hpp
+1
-1
No files found.
modules/videoio/misc/gen_dict.json
View file @
d7597a86
{
"const_ignore_list"
:
[
"CV_CAP_OPENNI"
,
"CV_CAP_OPENNI2"
,
"CV_CAP_PROP_OPENNI_"
,
"CV_CAP_INTELPERC"
,
"CV_CAP_PROP_INTELPERC_"
,
...
...
@@ -20,6 +21,7 @@
"CV_CAP_UNICAP"
,
"CV_CAP_DSHOW"
,
"CV_CAP_PVAPI"
,
"CV_CAP_ARAVIS"
,
"CV_CAP_PROP_DC1394_OFF"
,
"CV_CAP_PROP_DC1394_MODE_MANUAL"
,
"CV_CAP_PROP_DC1394_MODE_AUTO"
,
...
...
modules/videoio/src/cap.cpp
View file @
d7597a86
...
...
@@ -60,6 +60,8 @@
#pragma warning(disable: 4748)
#endif
using
namespace
cv
;
namespace
cv
{
...
...
@@ -178,11 +180,11 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
if
(
pref
)
break
;
#ifdef HAVE_MSMF
case
C
V_C
AP_MSMF
:
case
CAP_MSMF
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_MSMF
(
index
))
if
(
pref
)
break
;
#endif
case
C
V_CAP_VFW
:
case
C
AP_VFW
:
// or CAP_V4L or CAP_V4L2
#ifdef HAVE_VFW
TRY_OPEN
(
capture
,
cvCreateCameraCapture_VFW
(
index
))
#endif
...
...
@@ -190,7 +192,6 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
#if defined HAVE_LIBV4L || defined HAVE_CAMV4L || defined HAVE_CAMV4L2 || defined HAVE_VIDEOIO
TRY_OPEN
(
capture
,
cvCreateCameraCapture_V4L
(
index
))
#endif
if
(
pref
)
break
;
// CV_CAP_VFW
#ifdef HAVE_GSTREAMER
TRY_OPEN
(
capture
,
cvCreateCapture_GStreamer
(
CV_CAP_GSTREAMER_V4L2
,
reinterpret_cast
<
char
*>
(
index
)))
...
...
@@ -198,7 +199,9 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
TRY_OPEN
(
capture
,
cvCreateCapture_GStreamer
(
CV_CAP_GSTREAMER_V4L
,
reinterpret_cast
<
char
*>
(
index
)))
#endif
case
CV_CAP_FIREWIRE
:
if
(
pref
)
break
;
// CAP_VFW or CAP_V4L or CAP_V4L2
case
CAP_FIREWIRE
:
#ifdef HAVE_DC1394_2
TRY_OPEN
(
capture
,
cvCreateCameraCapture_DC1394_2
(
index
))
#endif
...
...
@@ -216,64 +219,64 @@ CV_IMPL CvCapture * cvCreateCameraCapture (int index)
TRY_OPEN
(
capture
,
cvCreateCapture_GStreamer
(
CV_CAP_GSTREAMER_1394
,
0
))
#endif
if
(
pref
)
break
;
// C
V_C
AP_FIREWIRE
if
(
pref
)
break
;
// CAP_FIREWIRE
#ifdef HAVE_MIL
case
C
V_C
AP_MIL
:
case
CAP_MIL
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_MIL
(
index
))
if
(
pref
)
break
;
#endif
#if defined(HAVE_QUICKTIME) || defined(HAVE_QTKIT)
case
C
V_C
AP_QT
:
case
CAP_QT
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_QT
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_UNICAP
case
C
V_C
AP_UNICAP
:
case
CAP_UNICAP
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_Unicap
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_PVAPI
case
C
V_C
AP_PVAPI
:
case
CAP_PVAPI
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_PvAPI
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_OPENNI
case
C
V_C
AP_OPENNI
:
case
CAP_OPENNI
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_OpenNI
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_OPENNI2
case
C
V_C
AP_OPENNI2
:
case
CAP_OPENNI2
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_OpenNI2
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_XIMEA
case
C
V_C
AP_XIAPI
:
case
CAP_XIAPI
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_XIMEA
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_AVFOUNDATION
case
C
V_C
AP_AVFOUNDATION
:
case
CAP_AVFOUNDATION
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_AVFoundation
(
index
))
if
(
pref
)
break
;
#endif
#ifdef HAVE_GIGE_API
case
C
V_C
AP_GIGANETIX
:
case
CAP_GIGANETIX
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_Giganetix
(
index
))
if
(
pref
)
break
;
// C
V_C
AP_GIGANETIX
if
(
pref
)
break
;
// CAP_GIGANETIX
#endif
#ifdef HAVE_ARAVIS_API
case
C
V_C
AP_ARAVIS
:
case
CAP_ARAVIS
:
TRY_OPEN
(
capture
,
cvCreateCameraCapture_Aravis
(
index
))
if
(
pref
)
break
;
#endif
...
...
@@ -297,12 +300,12 @@ CV_IMPL CvCapture * cvCreateFileCaptureWithPreference (const char * filename, in
if
(
apiPreference
)
break
;
#ifdef HAVE_FFMPEG
case
C
V_C
AP_FFMPEG
:
case
CAP_FFMPEG
:
TRY_OPEN
(
result
,
cvCreateFileCapture_FFMPEG_proxy
(
filename
))
if
(
apiPreference
)
break
;
#endif
case
C
V_C
AP_VFW
:
case
CAP_VFW
:
#ifdef HAVE_VFW
TRY_OPEN
(
result
,
cvCreateFileCapture_VFW
(
filename
))
#endif
...
...
@@ -312,7 +315,7 @@ CV_IMPL CvCapture * cvCreateFileCaptureWithPreference (const char * filename, in
#endif
if
(
apiPreference
)
break
;
case
C
V_C
AP_MSMF
:
case
CAP_MSMF
:
#ifdef HAVE_MSMF
TRY_OPEN
(
result
,
cvCreateFileCapture_MSMF
(
filename
))
#endif
...
...
@@ -323,36 +326,36 @@ CV_IMPL CvCapture * cvCreateFileCaptureWithPreference (const char * filename, in
if
(
apiPreference
)
break
;
#ifdef HAVE_GSTREAMER
case
C
V_C
AP_GSTREAMER
:
case
CAP_GSTREAMER
:
TRY_OPEN
(
result
,
cvCreateCapture_GStreamer
(
CV_CAP_GSTREAMER_FILE
,
filename
))
if
(
apiPreference
)
break
;
#endif
#if defined(HAVE_QUICKTIME) || defined(HAVE_QTKIT)
case
C
V_C
AP_QT
:
case
CAP_QT
:
TRY_OPEN
(
result
,
cvCreateFileCapture_QT
(
filename
))
if
(
apiPreference
)
break
;
#endif
#ifdef HAVE_AVFOUNDATION
case
C
V_C
AP_AVFOUNDATION
:
case
CAP_AVFOUNDATION
:
TRY_OPEN
(
result
,
cvCreateFileCapture_AVFoundation
(
filename
))
if
(
apiPreference
)
break
;
#endif
#ifdef HAVE_OPENNI
case
C
V_C
AP_OPENNI
:
case
CAP_OPENNI
:
TRY_OPEN
(
result
,
cvCreateFileCapture_OpenNI
(
filename
))
if
(
apiPreference
)
break
;
#endif
#ifdef HAVE_OPENNI2
case
C
V_C
AP_OPENNI2
:
case
CAP_OPENNI2
:
TRY_OPEN
(
result
,
cvCreateFileCapture_OpenNI2
(
filename
))
if
(
apiPreference
)
break
;
#endif
case
C
V_C
AP_IMAGES
:
case
CAP_IMAGES
:
TRY_OPEN
(
result
,
cvCreateFileCapture_Images
(
filename
))
}
...
...
@@ -361,7 +364,7 @@ CV_IMPL CvCapture * cvCreateFileCaptureWithPreference (const char * filename, in
CV_IMPL
CvCapture
*
cvCreateFileCapture
(
const
char
*
filename
)
{
return
cvCreateFileCaptureWithPreference
(
filename
,
C
V_C
AP_ANY
);
return
cvCreateFileCaptureWithPreference
(
filename
,
CAP_ANY
);
}
/**
...
...
@@ -383,40 +386,40 @@ static CvVideoWriter* cvCreateVideoWriterWithPreference(const char* filename, in
{
default
:
//exit if the specified API is unavaliable
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#ifdef HAVE_FFMPEG
case
C
V_C
AP_FFMPEG
:
case
CAP_FFMPEG
:
TRY_OPEN
(
result
,
cvCreateVideoWriter_FFMPEG_proxy
(
filename
,
fourcc
,
fps
,
frameSize
,
is_color
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#endif
#ifdef HAVE_VFW
case
C
V_C
AP_VFW
:
case
CAP_VFW
:
TRY_OPEN
(
result
,
cvCreateVideoWriter_VFW
(
filename
,
fourcc
,
fps
,
frameSize
,
is_color
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#endif
#ifdef HAVE_MSMF
case
C
V_C
AP_MSMF
:
case
CAP_MSMF
:
TRY_OPEN
(
result
,
cvCreateVideoWriter_MSMF
(
filename
,
fourcc
,
fps
,
frameSize
,
is_color
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#endif
#ifdef HAVE_AVFOUNDATION
case
C
V_C
AP_AVFOUNDATION
:
case
CAP_AVFOUNDATION
:
TRY_OPEN
(
result
,
cvCreateVideoWriter_AVFoundation
(
filename
,
fourcc
,
fps
,
frameSize
,
is_color
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#endif
#if defined(HAVE_QUICKTIME) || defined(HAVE_QTKIT)
case
(
C
V_C
AP_QT
):
case
(
CAP_QT
):
TRY_OPEN
(
result
,
cvCreateVideoWriter_QT
(
filename
,
fourcc
,
fps
,
frameSize
,
is_color
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#endif
#ifdef HAVE_GSTREAMER
case
C
V_C
AP_GSTREAMER
:
case
CAP_GSTREAMER
:
TRY_OPEN
(
result
,
cvCreateVideoWriter_GStreamer
(
filename
,
fourcc
,
fps
,
frameSize
,
is_color
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
#endif
case
C
V_C
AP_IMAGES
:
case
CAP_IMAGES
:
TRY_OPEN
(
result
,
cvCreateVideoWriter_Images
(
filename
))
if
(
apiPreference
!=
C
V_C
AP_ANY
)
break
;
if
(
apiPreference
!=
CAP_ANY
)
break
;
}
return
result
;
...
...
@@ -425,7 +428,7 @@ static CvVideoWriter* cvCreateVideoWriterWithPreference(const char* filename, in
CV_IMPL
CvVideoWriter
*
cvCreateVideoWriter
(
const
char
*
filename
,
int
fourcc
,
double
fps
,
CvSize
frameSize
,
int
is_color
)
{
return
cvCreateVideoWriterWithPreference
(
filename
,
C
V_C
AP_ANY
,
fourcc
,
fps
,
frameSize
,
is_color
);
return
cvCreateVideoWriterWithPreference
(
filename
,
CAP_ANY
,
fourcc
,
fps
,
frameSize
,
is_color
);
}
CV_IMPL
int
cvWriteFrame
(
CvVideoWriter
*
writer
,
const
IplImage
*
image
)
...
...
@@ -450,16 +453,16 @@ static Ptr<IVideoCapture> IVideoCapture_create(int index)
int
domains
[]
=
{
#ifdef HAVE_DSHOW
C
V_C
AP_DSHOW
,
CAP_DSHOW
,
#endif
#ifdef HAVE_INTELPERC
C
V_C
AP_INTELPERC
,
CAP_INTELPERC
,
#endif
#ifdef WINRT_VIDEO
CAP_WINRT
,
#endif
#ifdef HAVE_GPHOTO2
C
V_C
AP_GPHOTO2
,
CAP_GPHOTO2
,
#endif
-
1
,
-
1
};
...
...
@@ -486,14 +489,14 @@ static Ptr<IVideoCapture> IVideoCapture_create(int index)
switch
(
domains
[
i
])
{
#ifdef HAVE_DSHOW
case
C
V_C
AP_DSHOW
:
case
CAP_DSHOW
:
capture
=
makePtr
<
VideoCapture_DShow
>
(
index
);
break
;
// C
V_C
AP_DSHOW
break
;
// CAP_DSHOW
#endif
#ifdef HAVE_INTELPERC
case
C
V_C
AP_INTELPERC
:
case
CAP_INTELPERC
:
capture
=
makePtr
<
VideoCapture_IntelPerC
>
();
break
;
// C
V_C
AP_INTEL_PERC
break
;
// CAP_INTEL_PERC
#endif
#ifdef WINRT_VIDEO
case
CAP_WINRT
:
...
...
@@ -503,7 +506,7 @@ static Ptr<IVideoCapture> IVideoCapture_create(int index)
break
;
// CAP_WINRT
#endif
#ifdef HAVE_GPHOTO2
case
C
V_C
AP_GPHOTO2
:
case
CAP_GPHOTO2
:
capture
=
createGPhoto2Capture
(
index
);
break
;
#endif
...
...
@@ -522,9 +525,9 @@ static Ptr<IVideoCapture> IVideoCapture_create(const String& filename)
{
int
domains
[]
=
{
C
V_C
AP_ANY
,
CAP_ANY
,
#ifdef HAVE_GPHOTO2
C
V_C
AP_GPHOTO2
,
CAP_GPHOTO2
,
#endif
#ifdef HAVE_MFX
CAP_INTEL_MFX
,
...
...
@@ -539,11 +542,11 @@ static Ptr<IVideoCapture> IVideoCapture_create(const String& filename)
switch
(
domains
[
i
])
{
case
C
V_C
AP_ANY
:
case
CAP_ANY
:
capture
=
createMotionJpegCapture
(
filename
);
break
;
#ifdef HAVE_GPHOTO2
case
C
V_C
AP_GPHOTO2
:
case
CAP_GPHOTO2
:
capture
=
createGPhoto2Capture
(
filename
);
break
;
#endif
...
...
modules/videoio/src/cap_aravis.cpp
View file @
d7597a86
...
...
@@ -109,7 +109,7 @@ public:
virtual
IplImage
*
retrieveFrame
(
int
);
virtual
int
getCaptureDomain
()
{
return
CV_
CAP_ARAVIS
;
return
cv
::
CAP_ARAVIS
;
}
protected
:
...
...
modules/videoio/src/precomp.hpp
View file @
d7597a86
...
...
@@ -90,7 +90,7 @@ struct CvCapture
virtual
bool
setProperty
(
int
,
double
)
{
return
0
;
}
virtual
bool
grabFrame
()
{
return
true
;
}
virtual
IplImage
*
retrieveFrame
(
int
)
{
return
0
;
}
virtual
int
getCaptureDomain
()
{
return
CV_CAP_ANY
;
}
// Return the type of the capture object: CV_
CAP_VFW, etc...
virtual
int
getCaptureDomain
()
{
return
cv
::
CAP_ANY
;
}
// Return the type of the capture object:
CAP_VFW, etc...
};
/*************************** CvVideoWriter structure ****************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment