Select Git revision
avmodel.cpp

Aline Gondim Santos authored and
Sébastien Blin
committed
In order to allow file/screen sharing from a audio only call, we must use requestmediachange to add this new stream. deprecates setinputfile() and setDisplay(). Those functions should be replaced by requestmediachange(). GitLab: client-qt#499 Change-Id: I504789696fe050e360c775692c08ca86b47dd06a
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
avmodel.cpp 25.43 KiB
/****************************************************************************
* Copyright (C) 2018-2021 Savoir-faire Linux Inc. *
* Author: Hugo Lefeuvre <hugo.lefeuvre@savoirfairelinux.com> *
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com> *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "api/avmodel.h"
// Std
#include <algorithm> // std::sort
#include <chrono>
#include <csignal>
#include <iomanip> // for std::put_time
#include <fstream>
#include <mutex>
#include <thread>
#include <string>
#include <sstream>
// Qt
#include <QtCore/QStandardPaths>
#include <QtCore/QDir>
#include <QUrl>
// Ring daemon
#include <media_const.h>
// LRC
#include "api/call.h"
#include "callbackshandler.h"
#include "dbus/callmanager.h"
#include "dbus/configurationmanager.h"
#include "dbus/videomanager.h"
#include "authority/storagehelper.h"
namespace lrc {
using namespace api;
class AVModelPimpl : public QObject
{
Q_OBJECT
public:
AVModelPimpl(AVModel& linked, const CallbacksHandler& callbacksHandler);
const CallbacksHandler& callbacksHandler;
QString getRecordingPath() const;
static const QString recorderSavesSubdir;
AVModel& linked_;
std::mutex renderers_mtx_;
std::map<QString, std::unique_ptr<video::Renderer>> renderers_;
bool useAVFrame_ = false;
QString currentVideoCaptureDevice_ {};
#ifndef ENABLE_LIBWRAP
// TODO: Init Video Renderers from daemon (see:
// https://git.jami.net/savoirfairelinux/ring-daemon/issues/59)