mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
Merge pull request #1104 from nikman-ru:cap_reuse
This commit is contained in:
commit
75b86c9706
@ -490,14 +490,14 @@ VideoCapture::~VideoCapture()
|
|||||||
|
|
||||||
bool VideoCapture::open(const String& filename)
|
bool VideoCapture::open(const String& filename)
|
||||||
{
|
{
|
||||||
if (!isOpened())
|
if (isOpened()) release();
|
||||||
cap = cvCreateFileCapture(filename.c_str());
|
cap = cvCreateFileCapture(filename.c_str());
|
||||||
return isOpened();
|
return isOpened();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoCapture::open(int device)
|
bool VideoCapture::open(int device)
|
||||||
{
|
{
|
||||||
if (!isOpened())
|
if (isOpened()) release();
|
||||||
cap = cvCreateCameraCapture(device);
|
cap = cvCreateCameraCapture(device);
|
||||||
return isOpened();
|
return isOpened();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user