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
e04cd1b0
Commit
e04cd1b0
authored
Apr 04, 2012
by
Alexander Shishkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #227, added support I420 format
parent
5c0c8107
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
cap_dshow.cpp
modules/highgui/src/cap_dshow.cpp
+18
-9
No files found.
modules/highgui/src/cap_dshow.cpp
View file @
e04cd1b0
...
@@ -207,6 +207,7 @@ DEFINE_GUID(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf
...
@@ -207,6 +207,7 @@ DEFINE_GUID(MEDIASUBTYPE_RGB24,0xe436eb7d,0x524f,0x11ce,0x9f,0x53,0x00,0x20,0xaf
DEFINE_GUID
(
MEDIASUBTYPE_RGB32
,
0xe436eb7e
,
0x524f
,
0x11ce
,
0x9f
,
0x53
,
0x00
,
0x20
,
0xaf
,
0x0b
,
0xa7
,
0x70
);
DEFINE_GUID
(
MEDIASUBTYPE_RGB32
,
0xe436eb7e
,
0x524f
,
0x11ce
,
0x9f
,
0x53
,
0x00
,
0x20
,
0xaf
,
0x0b
,
0xa7
,
0x70
);
DEFINE_GUID
(
MEDIASUBTYPE_RGB555
,
0xe436eb7c
,
0x524f
,
0x11ce
,
0x9f
,
0x53
,
0x00
,
0x20
,
0xaf
,
0x0b
,
0xa7
,
0x70
);
DEFINE_GUID
(
MEDIASUBTYPE_RGB555
,
0xe436eb7c
,
0x524f
,
0x11ce
,
0x9f
,
0x53
,
0x00
,
0x20
,
0xaf
,
0x0b
,
0xa7
,
0x70
);
DEFINE_GUID
(
MEDIASUBTYPE_RGB565
,
0xe436eb7b
,
0x524f
,
0x11ce
,
0x9f
,
0x53
,
0x00
,
0x20
,
0xaf
,
0x0b
,
0xa7
,
0x70
);
DEFINE_GUID
(
MEDIASUBTYPE_RGB565
,
0xe436eb7b
,
0x524f
,
0x11ce
,
0x9f
,
0x53
,
0x00
,
0x20
,
0xaf
,
0x0b
,
0xa7
,
0x70
);
DEFINE_GUID
(
MEDIASUBTYPE_I420
,
0x49343230
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
DEFINE_GUID
(
MEDIASUBTYPE_UYVY
,
0x59565955
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
DEFINE_GUID
(
MEDIASUBTYPE_UYVY
,
0x59565955
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
DEFINE_GUID
(
MEDIASUBTYPE_Y211
,
0x31313259
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
DEFINE_GUID
(
MEDIASUBTYPE_Y211
,
0x31313259
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
DEFINE_GUID
(
MEDIASUBTYPE_Y411
,
0x31313459
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
DEFINE_GUID
(
MEDIASUBTYPE_Y411
,
0x31313459
,
0x0000
,
0x0010
,
0x80
,
0x00
,
0x00
,
0xaa
,
0x00
,
0x38
,
0x9b
,
0x71
);
...
@@ -339,7 +340,7 @@ static bool verbose = true;
...
@@ -339,7 +340,7 @@ static bool verbose = true;
//videoInput defines
//videoInput defines
#define VI_VERSION 0.1995
#define VI_VERSION 0.1995
#define VI_MAX_CAMERAS 20
#define VI_MAX_CAMERAS 20
#define VI_NUM_TYPES
19
//MGB
#define VI_NUM_TYPES
20
//MGB
#define VI_NUM_FORMATS 18 //DON'T TOUCH
#define VI_NUM_FORMATS 18 //DON'T TOUCH
//defines for setPhyCon - tuner is not as well supported as composite and s-video
//defines for setPhyCon - tuner is not as well supported as composite and s-video
...
@@ -1066,6 +1067,7 @@ videoInput::videoInput(){
...
@@ -1066,6 +1067,7 @@ videoInput::videoInput(){
mediaSubtypes
[
16
]
=
MEDIASUBTYPE_Y800
;
mediaSubtypes
[
16
]
=
MEDIASUBTYPE_Y800
;
mediaSubtypes
[
17
]
=
MEDIASUBTYPE_Y8
;
mediaSubtypes
[
17
]
=
MEDIASUBTYPE_Y8
;
mediaSubtypes
[
18
]
=
MEDIASUBTYPE_GREY
;
mediaSubtypes
[
18
]
=
MEDIASUBTYPE_GREY
;
mediaSubtypes
[
19
]
=
MEDIASUBTYPE_I420
;
//The video formats we support
//The video formats we support
formatTypes
[
VI_NTSC_M
]
=
AnalogVideo_NTSC_M
;
formatTypes
[
VI_NTSC_M
]
=
AnalogVideo_NTSC_M
;
...
@@ -2171,6 +2173,7 @@ void videoInput::getMediaSubtypeAsString(GUID type, char * typeAsString){
...
@@ -2171,6 +2173,7 @@ void videoInput::getMediaSubtypeAsString(GUID type, char * typeAsString){
else
if
(
type
==
MEDIASUBTYPE_Y800
)
sprintf
(
tmpStr
,
"Y800"
);
else
if
(
type
==
MEDIASUBTYPE_Y800
)
sprintf
(
tmpStr
,
"Y800"
);
else
if
(
type
==
MEDIASUBTYPE_Y8
)
sprintf
(
tmpStr
,
"Y8"
);
else
if
(
type
==
MEDIASUBTYPE_Y8
)
sprintf
(
tmpStr
,
"Y8"
);
else
if
(
type
==
MEDIASUBTYPE_GREY
)
sprintf
(
tmpStr
,
"GREY"
);
else
if
(
type
==
MEDIASUBTYPE_GREY
)
sprintf
(
tmpStr
,
"GREY"
);
else
if
(
type
==
MEDIASUBTYPE_I420
)
sprintf
(
tmpStr
,
"I420"
);
else
sprintf
(
tmpStr
,
"OTHER"
);
else
sprintf
(
tmpStr
,
"OTHER"
);
memcpy
(
typeAsString
,
tmpStr
,
sizeof
(
char
)
*
8
);
memcpy
(
typeAsString
,
tmpStr
,
sizeof
(
char
)
*
8
);
...
@@ -3279,8 +3282,7 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
...
@@ -3279,8 +3282,7 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
{
{
// image capture properties
// image capture properties
bool
handled
=
false
;
bool
handled
=
false
;
switch
(
property_id
)
switch
(
property_id
)
{
{
case
CV_CAP_PROP_FRAME_WIDTH
:
case
CV_CAP_PROP_FRAME_WIDTH
:
width
=
cvRound
(
value
);
width
=
cvRound
(
value
);
...
@@ -3302,8 +3304,13 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
...
@@ -3302,8 +3304,13 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
break
;
break
;
case
CV_CAP_PROP_FPS
:
case
CV_CAP_PROP_FPS
:
VI
.
setIdealFramerate
(
index
,
cvRound
(
value
));
int
fps
=
cvRound
(
value
);
handled
=
true
;
if
(
fps
!=
VI
.
getFPS
(
0
))
{
VI
.
stopDevice
(
index
);
VI
.
setIdealFramerate
(
index
,
fps
);
VI
.
setupDevice
(
index
);
}
break
;
break
;
}
}
...
@@ -3311,16 +3318,18 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
...
@@ -3311,16 +3318,18 @@ bool CvCaptureCAM_DShow::setProperty( int property_id, double value )
if
(
handled
)
{
if
(
handled
)
{
// a stream setting
// a stream setting
if
(
width
>
0
&&
height
>
0
)
if
(
width
>
0
&&
height
>
0
)
{
if
(
width
!=
VI
.
getWidth
(
index
)
||
height
!=
VI
.
getHeight
(
index
)
)
//|| fourcc != VI.getFourcc(index) )
{
{
if
(
width
!=
VI
.
getWidth
(
index
)
||
height
!=
VI
.
getHeight
(
index
)
)
//|| fourcc != VI.getFourcc(index) )
int
fps
=
VI
.
getFPS
(
index
);
{
VI
.
stopDevice
(
index
);
VI
.
stopDevice
(
index
);
VI
.
setupDeviceFourcc
(
index
,
width
,
height
,
fourcc
);
VI
.
setIdealFramerate
(
index
,
fps
);
VI
.
setupDeviceFourcc
(
index
,
width
,
height
,
fourcc
);
}
}
width
=
height
=
fourcc
=
-
1
;
width
=
height
=
fourcc
=
-
1
;
return
VI
.
isDeviceSetup
(
index
);
return
VI
.
isDeviceSetup
(
index
);
}
}
return
true
;
return
true
;
}
}
// show video/camera filter dialog
// show video/camera filter dialog
...
...
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