Commit 6c1920c0 authored by Ghislain MARY's avatar Ghislain MARY

Do not init capture when creating reader.

parent 531aec55
...@@ -345,7 +345,7 @@ MSWinRTCap::MSWinRTCap() ...@@ -345,7 +345,7 @@ MSWinRTCap::MSWinRTCap()
: mIsInitialized(false), mIsActivated(false), mIsStarted(false), mFps(15), mStartTime(0), mDeviceOrientation(0) : mIsInitialized(false), mIsActivated(false), mIsStarted(false), mFps(15), mStartTime(0), mDeviceOrientation(0)
{ {
if (smInstantiated) { if (smInstantiated) {
ms_error("[MSWinRTCap] An video capture filter is already instantiated. A second one can not be created."); ms_error("[MSWinRTCap] A video capture filter is already instantiated. A second one can not be created.");
return; return;
} }
...@@ -370,7 +370,7 @@ void MSWinRTCap::initialize() ...@@ -370,7 +370,7 @@ void MSWinRTCap::initialize()
int MSWinRTCap::activate() int MSWinRTCap::activate()
{ {
if (!mIsInitialized) return -1; if (!mIsInitialized) initialize();
ms_average_fps_init(&mAvgFps, "[MSWinRTCap] fps=%f"); ms_average_fps_init(&mAvgFps, "[MSWinRTCap] fps=%f");
configure(); configure();
...@@ -387,6 +387,7 @@ int MSWinRTCap::deactivate() ...@@ -387,6 +387,7 @@ int MSWinRTCap::deactivate()
{ {
mHelper->StopPreview(); mHelper->StopPreview();
mIsActivated = false; mIsActivated = false;
mIsInitialized = false;
return 0; return 0;
} }
......
...@@ -191,7 +191,6 @@ static MSFilter *ms_winrtcap_create_reader(MSWebCam *cam) { ...@@ -191,7 +191,6 @@ static MSFilter *ms_winrtcap_create_reader(MSWebCam *cam) {
r->setDeviceId(ref new Platform::String(winrtcam->id)); r->setDeviceId(ref new Platform::String(winrtcam->id));
r->setFront(winrtcam->front == TRUE); r->setFront(winrtcam->front == TRUE);
r->setExternal(winrtcam->external == TRUE); r->setExternal(winrtcam->external == TRUE);
r->initialize();
return f; return f;
} }
......
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