Skip to content
Snippets Groups Projects
Commit 2009afcd authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Sébastien Blin
Browse files

videpInput: fit to new api

Change-Id: I7f2bf6038d1b9313bd86f9b0a39b2573b97038a1
parent 3b0dab58
Branches
No related tags found
No related merge requests found
......@@ -194,7 +194,7 @@ public:
* Start a local recorder and return it path.
* @param audioOnly
*/
Q_INVOKABLE QString startLocalRecorder(const bool& audioOnly) const;
Q_INVOKABLE QString startLocalMediaRecorder(const QString& videoInputId) const;
/**
* Get the current recording path
* @return recording path
......@@ -237,12 +237,15 @@ public:
Q_INVOKABLE void setRecordQuality(const int& quality) const;
/**
* Start preview renderer. This will start the camera
* @param resource
* @return sinkId
*/
Q_INVOKABLE void startPreview();
Q_INVOKABLE QString startPreview(const QString& resource);
/**
* Stop preview renderer and the camera.
* @param resource
*/
Q_INVOKABLE void stopPreview();
Q_INVOKABLE void stopPreview(const QString& resource);
/**
* Get a renderer from a call
* @param id the callid or "local"
......
......@@ -292,8 +292,8 @@ AVModel::setDeviceSettings(video::Settings& settings)
if (pimpl_->renderers_[video::PREVIEW_RENDERER_ID]) {
if (pimpl_->renderers_[video::PREVIEW_RENDERER_ID]->isRendering()
&& pimpl_->renderers_.size() == 1) {
stopPreview();
startPreview();
stopPreview(video::PREVIEW_RENDERER_ID);
startPreview(video::PREVIEW_RENDERER_ID);
}
}
}
......@@ -452,10 +452,10 @@ AVModel::stopLocalRecorder(const QString& path) const
}
QString
AVModel::startLocalRecorder(const bool& audioOnly) const
AVModel::startLocalMediaRecorder(const QString& videoInputId) const
{
const QString path = pimpl_->getRecordingPath();
const QString finalPath = VideoManager::instance().startLocalRecorder(audioOnly, path);
const QString finalPath = VideoManager::instance().startLocalMediaRecorder(videoInputId, path);
return finalPath;
}
......@@ -516,16 +516,16 @@ AVModel::useAVFrame(bool useAVFrame)
}
}
void
AVModel::startPreview()
QString
AVModel::startPreview(const QString& resource)
{
VideoManager::instance().startCamera();
return QString(VideoManager::instance().openVideoInput(resource.toStdString()).c_str());
}
void
AVModel::stopPreview()
AVModel::stopPreview(const QString& resource)
{
VideoManager::instance().stopCamera();
VideoManager::instance().closeVideoInput(resource.toStdString());
}
const video::Renderer&
......@@ -549,7 +549,7 @@ AVModel::setInputFile(const QString& uri, const QString& callId)
.arg(QUrl(uri).toLocalFile())
: DRing::Media::VideoProtocolPrefix::NONE;
if (callId.isEmpty()) {
VideoManager::instance().switchInput(resource);
VideoManager::instance().openVideoInput(resource.toStdString());
} else {
CallManager::instance().switchInput(callId, resource);
}
......@@ -593,7 +593,7 @@ AVModel::switchInputTo(const QString& id, const QString& callId)
resource = QString(DRing::Media::VideoProtocolPrefix::NONE);
}
if (callId.isEmpty()) {
VideoManager::instance().switchInput(resource);
VideoManager::instance().openVideoInput(resource.toStdString());
} else {
CallManager::instance().switchInput(callId, resource);
}
......
......@@ -162,17 +162,17 @@ public Q_SLOTS: // METHODS
#endif
}
void startCamera()
std::string openVideoInput(const std::string& resource)
{
#ifdef ENABLE_VIDEO
DRing::startCamera();
return DRing::openVideoInput(resource);
#endif
}
void stopCamera()
void closeVideoInput(const std::string& resource)
{
#ifdef ENABLE_VIDEO
DRing::stopCamera();
DRing::closeVideoInput(resource);
#endif
}
......@@ -180,16 +180,6 @@ public Q_SLOTS: // METHODS
void stopAudioDevice() { DRing::stopAudioDevice(); }
bool switchInput(const QString& resource)
{
#ifdef ENABLE_VIDEO
return DRing::switchInput(resource.toStdString());
#else
Q_UNUSED(resource)
return false;
#endif
}
void registerSinkTarget(const QString& sinkID, const DRing::SinkTarget& target)
{
#ifdef ENABLE_VIDEO
......@@ -219,9 +209,10 @@ public Q_SLOTS: // METHODS
void stopLocalRecorder(const QString& path) { DRing::stopLocalRecorder(path.toStdString()); }
QString startLocalRecorder(bool audioOnly, const QString& path)
QString startLocalMediaRecorder(const QString& videoInputId, const QString& path)
{
return QString::fromStdString(DRing::startLocalRecorder(audioOnly, path.toStdString()));
return QString::fromStdString(
DRing::startLocalMediaRecorder(videoInputId.toStdString(), path.toStdString()));
}
MapStringString getRenderer(const QString& id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment