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
8513ed08
Commit
8513ed08
authored
Mar 27, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
probably fixed multi-threaded capturing from DShow cameras (ticket #1470)
parent
b2a6a257
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
cap_dshow.cpp
modules/highgui/src/cap_dshow.cpp
+14
-6
No files found.
modules/highgui/src/cap_dshow.cpp
View file @
8513ed08
...
...
@@ -384,7 +384,7 @@ typedef _AMMediaType AM_MEDIA_TYPE;
//keeps track of how many instances of VI are being used
//don't touch
static
int
comInitCount
=
0
;
//
static int comInitCount = 0;
//////////////////////////////////////// VIDEO DEVICE ///////////////////////////////////
...
...
@@ -1915,7 +1915,7 @@ videoInput::~videoInput(){
// ----------------------------------------------------------------------
bool
videoInput
::
comInit
(){
HRESULT
hr
=
NOERROR
;
/*
HRESULT hr = NOERROR;
//no need for us to start com more than once
if(comInitCount == 0 ){
...
...
@@ -1935,7 +1935,7 @@ bool videoInput::comInit(){
}
}
comInitCount
++
;
comInitCount++;
*/
return
true
;
}
...
...
@@ -1946,14 +1946,15 @@ bool videoInput::comInit(){
// ----------------------------------------------------------------------
bool
videoInput
::
comUnInit
(){
if
(
comInitCount
>
0
)
comInitCount
--
;
//decrease the count of instances using com
/*
if(comInitCount > 0)comInitCount--; //decrease the count of instances using com
if(comInitCount == 0){
CoUninitialize(); //if there are no instances left - uninitialize com
return true;
}
return
false
;
return false;*/
return
true
;
}
...
...
@@ -2912,7 +2913,7 @@ class CvCaptureCAM_DShow : public CvCapture
{
public
:
CvCaptureCAM_DShow
();
virtual
~
CvCaptureCAM_DShow
()
{
close
();
}
virtual
~
CvCaptureCAM_DShow
()
;
virtual
bool
open
(
int
index
);
virtual
void
close
();
...
...
@@ -2944,6 +2945,13 @@ CvCaptureCAM_DShow::CvCaptureCAM_DShow()
index
=
-
1
;
frame
=
0
;
width
=
height
=
-
1
;
CoInitialize
(
0
);
}
CvCaptureCAM_DShow
::~
CvCaptureCAM_DShow
()
{
close
();
CoUninitialize
();
}
void
CvCaptureCAM_DShow
::
close
()
...
...
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