Sayonara Player
Loading...
Searching...
No Matches
Broadcasting.h
1/* Broadcaster.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef SAYONARA_ENGINE_BROADCASTER_H
22#define SAYONARA_ENGINE_BROADCASTER_H
23
24#include <gst/gst.h>
25#include <functional>
26#include <memory>
27
28class QByteArray;
29namespace PipelineExtensions
30{
32 {
33 public:
34 virtual ~RawDataReceiver();
35 virtual void setRawData(const QByteArray& data) = 0;
36 };
37
38 using RawDataReceiverPtr = std::shared_ptr<RawDataReceiver>;
39
41 {
42 public:
43 virtual ~Broadcastable();
44
45 virtual void setBroadcastingEnabled(bool b) = 0;
46 [[nodiscard]] virtual bool isBroadcastingEnabled() const = 0;
47 };
48
50 {
51 public:
52 virtual ~Broadcaster();
53
54 virtual bool setEnabled(bool b) = 0;
55 [[nodiscard]] virtual bool isEnabled() const = 0;
56 };
57
58 std::shared_ptr<Broadcaster> createBroadcaster(const RawDataReceiverPtr& broadcastDataReceiver,
59 GstElement* pipeline,
60 GstElement* tee);
61
62 std::shared_ptr<Broadcaster> createDummyBroadcaster();
63
64 RawDataReceiverPtr createRawDataReceiver(std::function<void(const QByteArray&)>&& callback);
65}
66
67#endif // SAYONARA_ENGINE_BROADCASTER_H
Definition Broadcasting.h:41
Definition Broadcasting.h:50
Definition Broadcasting.h:32