Skip to content

Commit

Permalink
Don't show cmd when adding a virtual camera. Added QMLSCENE_DEVICE=so…
Browse files Browse the repository at this point in the history
…ftwarecontext option to webcamoid.bat.
  • Loading branch information
hipersayanX committed Jun 29, 2016
1 parent 6a5854d commit 8041828
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions libAvKys/Plugins/VirtualCamera/src/dshow/cameraout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ QString CameraOut::createWebcam(const QString &description,
.arg(reg)
.arg(desc);

if (!this->sudo("cmd", params))
if (!this->sudo("cmd", params, "", true))
return QString();

QStringList curWebcams = this->webcams();
Expand Down Expand Up @@ -357,7 +357,10 @@ QString CameraOut::iidToString(const IID &iid) const
return str;
}

bool CameraOut::sudo(const QString &command, const QString &params, const QString &dir) const
bool CameraOut::sudo(const QString &command,
const QString &params,
const QString &dir,
bool hide) const
{
const static int maxStrLen = 1024;

Expand All @@ -383,7 +386,7 @@ bool CameraOut::sudo(const QString &command, const QString &params, const QStrin
execInfo.lpFile = wcommand;
execInfo.lpParameters = wparams;
execInfo.lpDirectory = wdir;
execInfo.nShow = SW_SHOWNORMAL;
execInfo.nShow = hide? SW_HIDE: SW_SHOWNORMAL;
execInfo.hInstApp = NULL;
ShellExecuteEx(&execInfo);

Expand Down
3 changes: 2 additions & 1 deletion libAvKys/Plugins/VirtualCamera/src/dshow/cameraout.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class CameraOut: public QObject
QString iidToString(const IID &iid) const;
bool sudo(const QString &command,
const QString &params,
const QString &dir=QString()) const;
const QString &dir=QString(),
bool hide=false) const;

signals:
void driverPathChanged(const QString &driverPath);
Expand Down
1 change: 1 addition & 0 deletions webcamoid.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@echo off
REM SET QMLSCENE_DEVICE=softwarecontext
start /b bin\webcamoid -q "%cd%\lib\qt\qml" -p "%cd%\lib\avkys" -c "%cd%\share\config"

0 comments on commit 8041828

Please sign in to comment.