MillicastSDK 2.0.0
Loading...
Searching...
No Matches
renderer.h
Go to the documentation of this file.
1#ifndef MILLICAST_API_RENDERER_H
2#define MILLICAST_API_RENDERER_H
3
11#include <cstddef> // size_t
12#include <cstdint> // uint32_t
13
16
17namespace millicast {
18
19// base ///////////////////////////////////////////////////////////////////////
20
26class Renderer {
27 public:
28 Renderer() = default;
29 virtual ~Renderer() = default;
30
35 virtual void init() = 0;
36};
37
38// Video //////////////////////////////////////////////////////////////////////
39
46class VideoRenderer : public Renderer {
47 public:
48 VideoRenderer() = default;
49 ~VideoRenderer() override = default;
50
57 virtual void on_frame(const VideoFrame& frame) = 0;
58};
59
60// Audio //////////////////////////////////////////////////////////////////////
61
71 public:
72 AudioRenderer() = default;
73 virtual ~AudioRenderer() = default;
74
80 virtual void on_frame(const AudioFrame& frame) = 0;
81};
82
83// decklink ///////////////////////////////////////////////////////////////////
84
93 public:
94 DeckLinkRenderer() = default;
95 ~DeckLinkRenderer() override = default;
96
102 MILLICAST_API virtual void set_source(VideoSource::Ptr device) = 0;
103 MILLICAST_API virtual void stop() = 0;
104
110 MILLICAST_API static std::vector<VideoSource::Ptr> get_decklink_devices();
111
118};
119
120// ndi ////////////////////////////////////////////////////////////////////////
121
129 public:
130 NdiRenderer() = default;
131 ~NdiRenderer() override = default;
132
140 MILLICAST_API virtual void set_name(const std::string&) = 0;
141
148};
149
150#if defined MILLICAST_SDK_TVOS || defined MILLICAST_SDK_IOS
151
152class MILLICAST_API IosVideoRenderer : public VideoRenderer {
153 public:
154 IosVideoRenderer() = default;
155 virtual ~IosVideoRenderer() = default;
156
157 virtual void* get_uiview() = 0;
158 virtual float width() = 0;
159 virtual float height() = 0;
160
161 static IosVideoRenderer* create();
162
163 std::function<void(float, float)> did_change_video_size;
164};
165
166#endif
167
168} // namespace millicast
169
170#endif /* MILLICAST_API_RENDERER_H */
The AudioRenderer class is responsible for rendering audio in a specific way in your application.
Definition renderer.h:70
virtual void on_frame(const AudioFrame &frame)=0
Called when a new audio frame becomes available.
virtual ~AudioRenderer()=default
The NdiRenderer class is used to render video as an ndi source.
Definition renderer.h:128
static MILLICAST_API NdiRenderer * create()
Create an Ndi renderer.
virtual MILLICAST_API void set_name(const std::string &)=0
Set the name of the ndi source. This is the name that will be displayed to other ndi application when...
~NdiRenderer() override=default
The Renderer base class. A renderer is used to render video on screen or render audio.
Definition renderer.h:26
virtual ~Renderer()=default
virtual void init()=0
init the renderer
The VideoFrame class used to described a VideoFrame.
Definition frames.h:15
The VideoRenderer class Inherits this class to receive video frames and render them in your applicati...
Definition renderer.h:46
virtual void on_frame(const VideoFrame &frame)=0
on_frame is called when a new video frame is available ( either captured or received from a peer )
~VideoRenderer() override=default
Source::SourcePtr< VideoSource > Ptr
Definition source.h:161
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
The AudioFrame struct used to described audio data.
Definition frames.h:105