blob: 2844b7b9cad30d1b10f57d131053f509c4d032c8 [file] [log] [blame]
agsantos4bb4bc52021-03-08 14:21:45 -05001/**
2 * Copyright (C) 2021 Savoir-faire Linux Inc.
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
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#pragma once
22
23#include "WatermarkVideoSubscriber.h"
24
25#include "plugin/jamiplugin.h"
26#include "plugin/mediahandler.h"
27
28using avSubjectPtr = std::weak_ptr<jami::Observable<AVFrame*>>;
29
30namespace jami {
agsantos3fcc6212021-08-18 17:11:29 -030031class PluginPreferenceHandler;
agsantos4bb4bc52021-03-08 14:21:45 -050032
33class WatermarkMediaHandler : public jami::CallMediaHandler
34{
35public:
agsantos3fcc6212021-08-18 17:11:29 -030036 WatermarkMediaHandler(std::string&& dataPath, PluginPreferenceHandler* prefHandler);
agsantos4bb4bc52021-03-08 14:21:45 -050037 ~WatermarkMediaHandler();
38
39 virtual void notifyAVFrameSubject(const StreamData& data, avSubjectPtr subject) override;
40 virtual std::map<std::string, std::string> getCallMediaHandlerDetails() override;
41
42 virtual void detach() override;
agsantos3fcc6212021-08-18 17:11:29 -030043 virtual void setPreferenceAttribute(const std::string& key, const std::string& value) {}
44 virtual bool preferenceMapHasKey(const std::string& key) { return false; }
agsantos4bb4bc52021-03-08 14:21:45 -050045
46 std::shared_ptr<WatermarkVideoSubscriber> mediaSubscriber_;
agsantos3fcc6212021-08-18 17:11:29 -030047 void setParameters(const std::string& accountId);
agsantos4bb4bc52021-03-08 14:21:45 -050048
49private:
agsantos3fcc6212021-08-18 17:11:29 -030050 std::string accountId_ {"default"};
agsantos4bb4bc52021-03-08 14:21:45 -050051 const std::string datapath_;
agsantos3fcc6212021-08-18 17:11:29 -030052 PluginPreferenceHandler* aph_;
agsantos4bb4bc52021-03-08 14:21:45 -050053 std::string attached_ {'0'};
54};
55} // namespace jami