blob: 2863dd10628d7ff202b4086c52332f3e6700df29 [file] [log] [blame]
agsantosd09cc6d2020-11-06 17:34:46 -05001/**
Sébastien Blincb783e32021-02-12 11:34:10 -05002 * Copyright (C) 2020-2021 Savoir-faire Linux Inc.
agsantosd09cc6d2020-11-06 17:34:46 -05003 *
4 * Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#pragma once
22
agsantosd09cc6d2020-11-06 17:34:46 -050023#include "CoinCircleVideoSubscriber.h"
agsantosd09cc6d2020-11-06 17:34:46 -050024#include "plugin/jamiplugin.h"
25#include "plugin/mediahandler.h"
26
27using avSubjectPtr = std::weak_ptr<jami::Observable<AVFrame*>>;
28
29namespace jami {
30
31class CoinCircleMediaHandler : public jami::CallMediaHandler
32{
33public:
agsantos82678f32020-12-09 15:03:24 -050034 CoinCircleMediaHandler(std::map<std::string, std::string>&& preferences, std::string&& dataPath);
agsantosd09cc6d2020-11-06 17:34:46 -050035 ~CoinCircleMediaHandler();
36
37 virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override;
38 virtual std::map<std::string, std::string> getCallMediaHandlerDetails() override;
39
40 virtual void detach() override;
41 virtual void setPreferenceAttribute(const std::string& key, const std::string& value) override;
42 virtual bool preferenceMapHasKey(const std::string& key) override;
43
44 std::shared_ptr<CoinCircleVideoSubscriber> mVS;
45
agsantosd09cc6d2020-11-06 17:34:46 -050046private:
47 const std::string datapath_;
agsantos82678f32020-12-09 15:03:24 -050048 std::map<std::string, std::string> preferences_;
agsantosc9181b42020-11-26 12:03:04 -050049 std::string attached_ {"0"};
agsantosd09cc6d2020-11-06 17:34:46 -050050};
51} // namespace jami