Loading...
Searching...
No Matches
ScreenReceiver.h
Go to the documentation of this file.
1// Copyright (c) 2025 Dave R. Smith.
2// Malena Framework — Licensed under PolyForm Noncommercial 1.0.0; commercial use requires a paid license. See LICENSE.
3
4#pragma once
5#ifndef MALENA_SCREEN_RECEIVER_H
6#define MALENA_SCREEN_RECEIVER_H
7
11#include <memory>
12#include <string>
13
14namespace ml {
15
33class MALENA_API ScreenReceiverBase : public Graphic<sf::RectangleShape>
34{
35public:
40 ScreenReceiverBase(const char* name, const char* rtspUrl);
42
45
47 void start();
48
50 void stop();
51
53 bool isConnected() const;
54
55 const std::string& receiverName() const;
56 const std::string& url() const;
57
58 // sf::Drawable override — uploads the latest frame and renders it (or a
59 // black placeholder when no stream is active).
60 void draw(sf::RenderTarget& target, sf::RenderStates states) const override;
61
62private:
63 struct Impl;
64 std::unique_ptr<Impl> _impl;
65};
66
67// ---------------------------------------------------------------------------
68
80template<typename Manifest>
82{
83public:
87};
88
89} // namespace ml
90
91#endif // MALENA_SCREEN_RECEIVER_H
Base class for all Malena manifests.
Definition Manifest.h:51
void draw(sf::RenderTarget &target, sf::RenderStates states) const override
Draw this graphic to an SFML render target.
const std::string & receiverName() const
ScreenReceiverBase(const ScreenReceiverBase &)=delete
ScreenReceiverBase & operator=(const ScreenReceiverBase &)=delete
const std::string & url() const
ScreenReceiverBase(const char *name, const char *rtspUrl)
bool isConnected() const
~ScreenReceiverBase() override
#define MALENA_API
Definition Component.h:22