blob: d428a84871c4c7d231fc34d3da2017998b875594 [file] [log] [blame]
Aline Gondim Santosfd302912022-08-18 12:07:46 -03001/**
2 * Copyright (C) 2020-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#include "VideoSubscriberTester.h"
22
23#include <pluglog.h>
24#include <stdio.h>
25
26const std::string TAG = "VideoHandlerTester";
27const char sep = separator();
28
29namespace jami {
30
31VideoSubscriberTester::~VideoSubscriberTester()
32{
33 std::ostringstream oss;
34 oss << "~VideoSubscriberTester" << std::endl;
35 Plog::log(Plog::LogPriority::INFO, TAG, oss.str());
36}
37
38void
39VideoSubscriberTester::attached(jami::Observable<AVFrame*>* observable)
40{
41 std::ostringstream oss;
42 oss << "::Attached ! " << std::endl;
43 Plog::log(Plog::LogPriority::INFO, TAG, oss.str());
44 observable_ = observable;
45}
46
47void
48VideoSubscriberTester::detached(jami::Observable<AVFrame*>*)
49{
50 observable_ = nullptr;
51 std::ostringstream oss;
52 oss << "::Detached()" << std::endl;
53 Plog::log(Plog::LogPriority::INFO, TAG, oss.str());
54}
55
56void
57VideoSubscriberTester::detach()
58{
59 if (observable_) {
60 std::ostringstream oss;
61 oss << "::Calling detach()" << std::endl;
62 Plog::log(Plog::LogPriority::INFO, TAG, oss.str());
63 observable_->detach(this);
64 }
65}
66} // namespace jami