MillicastSDK 2.0.0
Loading...
Searching...
No Matches
encoded_frames.h
Go to the documentation of this file.
1#ifndef MILLICAST_API_FRAME_TRANSFORMER_H
2#define MILLICAST_API_FRAME_TRANSFORMER_H
3
6#include <functional>
7#include <optional>
8
9namespace millicast {
10
12 public:
17 [[nodiscard]] virtual Span<const uint8_t> data() const = 0;
18
26 virtual void set_metadata(Span<const uint8_t> metadata) = 0;
27
34 [[nodiscard]] virtual Span<const uint8_t> metadata() const = 0;
35
40 [[nodiscard]] virtual uint32_t timestamp() const = 0;
41
46 [[nodiscard]] virtual uint32_t ssrc() const = 0;
47};
48
50 public:
51 virtual ~EncodedVideoFrame() = default;
52
57 [[nodiscard]] virtual int width() const = 0;
58
63 [[nodiscard]] virtual int height() const = 0;
64
69 [[nodiscard]] virtual bool is_keyframe() const = 0;
70
75 [[nodiscard]] virtual int64_t frame_id() const = 0;
76
82 [[nodiscard]] virtual int temporal_index() const = 0;
83
89 [[nodiscard]] virtual int spatial_index() const = 0;
90};
91
93 public:
94 virtual ~EncodedAudioFrame() = default;
95
100 [[nodiscard]] virtual uint16_t sequence_number() const = 0;
101
110 [[nodiscard]] virtual uint64_t absolute_capture_time() const = 0;
111};
112
116using EncodedVideoFrameCallback = std::function<void(EncodedVideoFrame&)>;
117using EncodedAudioFrameCallback = std::function<void(EncodedAudioFrame&)>;
118}; // namespace millicast
119
120#endif /* MILLICAST_API_FRAME_TRANSFORMER_H */
Definition encoded_frames.h:92
virtual ~EncodedAudioFrame()=default
virtual uint16_t sequence_number() const =0
Gets the sequence number of of the audio frame.
virtual uint64_t absolute_capture_time() const =0
The NTP timestamp of when the audio frame was initially capture. This field is encoded as a 64-bit un...
Definition encoded_frames.h:11
virtual void set_metadata(Span< const uint8_t > metadata)=0
Set metadata to be appended on top of the original frame. This will be extracted and presented to the...
virtual uint32_t timestamp() const =0
Gets the RTP timestamp of the frame.
virtual Span< const uint8_t > data() const =0
Get the original encoded frame data.
virtual Span< const uint8_t > metadata() const =0
return the metadata associated with the frame. It will return an empty span if no metadata is set.
virtual uint32_t ssrc() const =0
Gets the SSRC of the frame.
Definition encoded_frames.h:49
virtual int width() const =0
Gets the width of the encoded video frame.
virtual int64_t frame_id() const =0
Gets the ID of the frame.
virtual ~EncodedVideoFrame()=default
virtual bool is_keyframe() const =0
Checks if the frame is a key frame.
virtual int height() const =0
Gets the height of the encoded video frame.
virtual int temporal_index() const =0
Gets the temporal index of the frame, this will be valid if the stream has temporal layers.
virtual int spatial_index() const =0
Gets the spatial index of the frame, this will be valid if the stream has spatial layers.
Definition span.h:28
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
std::function< void(EncodedAudioFrame &)> EncodedAudioFrameCallback
Definition encoded_frames.h:117
std::function< void(EncodedVideoFrame &)> EncodedVideoFrameCallback
Definition encoded_frames.h:116