agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 1 | /** |
Sébastien Blin | cb783e3 | 2021-02-12 11:34:10 -0500 | [diff] [blame] | 2 | * Copyright (C) 2020-2021 Savoir-faire Linux Inc. |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 3 | * |
| 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 |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 19 | * USA. |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 20 | */ |
| 21 | |
| 22 | #pragma once |
| 23 | |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 24 | #include "videoSubscriber.h" |
| 25 | |
agsantos | dd6a62a | 2021-03-29 17:13:27 -0400 | [diff] [blame] | 26 | #include <plugin/jamiplugin.h> |
| 27 | #include <plugin/mediahandler.h> |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 28 | |
| 29 | using avSubjectPtr = std::weak_ptr<jami::Observable<AVFrame*>>; |
| 30 | |
| 31 | namespace jami { |
| 32 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 33 | class PluginMediaHandler : public jami::CallMediaHandler |
| 34 | { |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 35 | public: |
agsantos | 82678f3 | 2020-12-09 15:03:24 -0500 | [diff] [blame] | 36 | PluginMediaHandler(std::map<std::string, std::string>&& preferences, std::string&& dataPath); |
agsantos | c9181b4 | 2020-11-26 12:03:04 -0500 | [diff] [blame] | 37 | ~PluginMediaHandler(); |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 38 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 39 | virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override; |
| 40 | virtual std::map<std::string, std::string> getCallMediaHandlerDetails() override; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 41 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 42 | virtual void detach() override; |
| 43 | virtual void setPreferenceAttribute(const std::string& key, const std::string& value) override; |
| 44 | virtual bool preferenceMapHasKey(const std::string& key) override; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 45 | |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 46 | std::shared_ptr<VideoSubscriber> mVS; |
agsantos | 364bbae | 2020-08-17 11:29:56 -0400 | [diff] [blame] | 47 | |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 48 | private: |
agsantos | dd6a62a | 2021-03-29 17:13:27 -0400 | [diff] [blame] | 49 | const std::string dataPath_; |
agsantos | 82678f3 | 2020-12-09 15:03:24 -0500 | [diff] [blame] | 50 | std::map<std::string, std::string> preferences_; |
agsantos | c9181b4 | 2020-11-26 12:03:04 -0500 | [diff] [blame] | 51 | std::string attached_ {'0'}; |
agsantos | 5aa3965 | 2020-08-11 18:18:04 -0400 | [diff] [blame] | 52 | }; |
agsantos | ac1940d | 2020-09-17 10:18:40 -0400 | [diff] [blame] | 53 | } // namespace jami |