4.2.5. Proximie::PxMedia reference
-
namespace PxMedia
The PxMedia namespace implements the core media streaming functionality provided the SDK. This includes audio and video feeds being between the host applications and other participants in a media session.
Typedefs
-
using PxMediaError = PxUtility::ErrorCodeException<PxMediaErrorCategory>
Exception class for PxMediaError errors
-
using StreamIndexHint = uint16_t
A preferred stream index for presentation in applications.
The index hint is intended to allow a sending application to suggest placement or priority of a given stream. For example, in Proximie’s webapp, the four panes for videos are assigned an index and clients can suggest which pane to use. This is a hint only, since different participants may try to suggest the same index without being aware of each other.
Enums
-
enum class AVContainer
The container format for the output file.
Values:
-
enumerator MP4
-
enumerator MKV
-
enumerator AVI
-
enumerator FLV
-
enumerator MP4
-
enum class ConnectionState
Enumeration for a connection state.
Values:
-
enumerator READY
-
enumerator CONNECTING
No connection, ready to connect
-
enumerator CONNECTED
In the process of connecting
-
enumerator DISCONNECTING
Connected and active
-
enumerator READY
-
enum class AudioCodec : uint16_t
The audio codec to use for the output file.
Values:
-
enumerator AAC
-
enumerator MP3
-
enumerator OPUS
-
enumerator VORBIS
-
enumerator AAC
-
enum class VideoCodec : uint16_t
The video codec to use for the output file.
Values:
-
enumerator H264
-
enumerator H265
-
enumerator VP8
-
enumerator VP9
-
enumerator AV1
-
enumerator H264
-
enum class PxMediaErrorCode
Custom error codes for PxMedia operations, namely Media Server functions.
Values:
-
enumerator Successful
Success (not an error)
-
enumerator FeedIdNotFound
The feed ID supplied was not known/found.
-
enumerator InvalidFeedId
The feed ID supplied is not valid.
-
enumerator FeedRequestUnhandled
The feed request was not handled, i.e. ignored.
-
enumerator SessionNotConnected
The session/media server has not connected yet.
-
enumerator SessionActive
The session is already active.
-
enumerator InvalidSession
The session requested is invalid.
-
enumerator SessionNotActive
The session requested is valid, but not active.
-
enumerator SessionCreateFailed
Session creation failed.
-
enumerator SessionFeedNotFound
The feed did not belong to the session.
-
enumerator SessionFeedExists
The feed already exists in the session.
-
enumerator SessionDisconnected
The session was unexpectedly disconnected.
-
enumerator NotConnected
- Deprecated:
Use PxMediaErrorCode::SessionNotConnected instead
-
enumerator PluginAttachFailed
Media server could not connect to the plugin.
-
enumerator PluginConnectionActive
Connection is already active.
-
enumerator PluginConnectionClosed
Connection is closed.
-
enumerator CreateMediaRoomFailed
The media room could not be created.
-
enumerator JoinMediaRoomFailed
The media room could not be joined.
-
enumerator WebRtcAnswerFailed
WebRTC answer failed.
-
enumerator WebRtcOfferFailed
WebRTC offer failed.
-
enumerator MediaRoomStartFailed
Stream failed to start in the media room.
-
enumerator MediaRoomConfigureFailed
Stream failed configuring for the media room.
-
enumerator MediaRoomConfigureError
Configure returned generic error.
-
enumerator MediaRoomConfigurePubFullError
Configure returned Max Publishers Reached (432) error.
-
enumerator WebRtcCandidateFailed
WebRTC trickle candidate failed.
-
enumerator MediaDeviceMetadataInvalid
Media stream metadata was invalid.
-
enumerator WebSocketError
WebSocket error.
-
enumerator MediaServerHangup
Received a media server hangup event.
-
enumerator MediaServerHangupClosePC
Received a close peer connection hangup.
-
enumerator NoPipeline
Pipeline elements have not be built/set.
-
enumerator PipelineExists
The pipeline already exists.
-
enumerator PipelineIsStopped
Pipeline is stopped (error, manually, …)
-
enumerator PipelineStreamError
Pipeline stream error.
-
enumerator PipelineParseError
Pipeline parse error.
-
enumerator PipelineElementNotFound
The pipeline element was not found.
-
enumerator PipelineNoElementName
Element name was not set as expected.
-
enumerator PipelineElementBadProps
A pipeline element’s (combination of) properties is invalid.
-
enumerator PipelineBindingInvalid
A pipeline segment binding was invalid.
-
enumerator PipelineInputAlreadyAdded
Input UUID already exists in the feed’s pipeline.
-
enumerator PipelineInvalidUUID
Invalid UUID.
-
enumerator PipelineElementOperationFailed
A GStreamer element/pad/bin operation failed.
-
enumerator KeepaliveTimeout
No keepalive answer within expected timeout.
-
enumerator ExpectedAck
Expected ack, but received another type.
-
enumerator InvalidResponseContent
The response JSON’s content was incorrect.
-
enumerator InvalidPeerChannel
The requested channel is invalid.
-
enumerator InvalidEncryptionKey
The encryption key is invalid.
-
enumerator InvalidAdaptiveRule
The adaptive rule is invalid.
-
enumerator InvalidMediaType
The media type is not valid.
-
enumerator InvalidMediaFormat
The media format is not valid.
-
enumerator MediaServiceNotConnected
The media service is not connected.
-
enumerator MediaServiceStarted
The media service has already been started.
-
enumerator MediaServiceConnectFailed
The media service connection failed.
-
enumerator MediaServiceDisconnected
The media service got disconnected.
-
enumerator MediaServiceReconnecting
The media service is trying to reconnect.
-
enumerator MediaServiceErrorStatus
The media service returned an error status.
-
enumerator MediaServiceEventInvalid
A media service event was invalid.
-
enumerator Successful
Functions
-
const PxUtility::EnumMapper<AudioCodec> &audioCodecMapper()
Mapper to convert between audio codec enum and string.
-
const PxUtility::EnumMapper<VideoCodec> &videoCodecMapper()
Mapper to convert between video codec enum and string.
-
inline error_code make_error_code(const PxMediaErrorCode code)
Provides support to make an
error_codefor the PxMediaErrorCode type.
-
inline error_condition make_error_condition(const PxMediaErrorCode code)
Provides support to make an
error_conditionfor the PxMediaErrorCode type.
-
template<typename T>
class AdaptiveBandsRule : public Proximie::PxMedia::AdaptiveRule<T> - #include <PxMedia/AdaptiveBandsRule.h>
An adaptive rule that takes a number of bands matching a quality range to a target value of the templated type.
Public Types
-
using Bands = std::vector<Band>
A vector of bands to choose between.
The bands are ordered, where the first band is the value to apply as the lowest quality band, and the band size is indicated by the weight. The bands are normalised so the bands will always encapsulate the full 0..1 quality range to apply.
Public Functions
-
AdaptiveBandsRule() = default
Construct an empty adaptive bands rule.
-
inline virtual boost::optional<T> valueForQuality(AdaptiveQuality quality) const override
Given a quality, set the target value to the outcome.
The return value is optional, allowing the rule to return nothing to indicate no change.
Public Static Functions
-
static inline std::shared_ptr<AdaptiveBandsRule<T>> create()
Factory function to create an empty adaptive bands rule.
-
static inline SharedOutcome<AdaptiveBandsRule<T>> create(const Bands &bands)
Factory function to create an instance of the rule as a shared pointer. The caller provides a defined number of bands to interpolate between.
The function validates the bands are valid, and thus returns an error outcome if they are not.
-
struct Band
- #include <PxMedia/AdaptiveBandsRule.h>
The definition of a band in the adaptive rule.
A band is a (non-negative) weight and a value. For convenience, the caller can use any scale of weight values, and these are normalized for choosing a band for a 0..1 quality.
-
using Bands = std::vector<Band>
-
template<typename T>
class AdaptiveMinMaxRule : public Proximie::PxMedia::AdaptiveRule<T> - #include <PxMedia/AdaptiveMinMaxRule.h>
General adaptive rule which interpolates between a minimum and maximum value of the templated type.
The type must have a lerp function defined for it.
Public Functions
-
inline AdaptiveMinMaxRule(T min, T max)
Construct a min/max rule, providing a defined minimum and maximum value to lerp with.
-
inline AdaptiveMinMaxRule &minimum(T min)
Set the minimum value
-
inline AdaptiveMinMaxRule &maximum(T max)
Set the maximum value
-
inline virtual boost::optional<T> valueForQuality(AdaptiveQuality quality) const override
Given a quality, set the target value to the outcome.
The return value is optional, allowing the rule to return nothing to indicate no change.
Public Static Functions
-
static inline std::shared_ptr<AdaptiveMinMaxRule<T>> create(const T &minValue, const T &maxValue)
Factory function to create an instance of the rule as a shared pointer. The caller provides a defined minimum and maximum value to lerp with.
-
inline AdaptiveMinMaxRule(T min, T max)
-
class AdaptiveQuality
- #include <PxMedia/AdaptiveQuality.h>
Adaptive feed quality is a floating point value in the range 0..1
Public Types
-
using QualityValueType = double
The underlying floating point value type for quality
Public Functions
-
AdaptiveQuality() = default
Feed quality constructor sets the quality to 1
-
inline AdaptiveQuality(QualityValueType quality)
Feed qualities can be inferred from a floating point value
-
inline bool isMaxQuality() const
Test if at maximum quality
-
inline QualityValueType value(QualityValueType set)
Set a feed quality.
The value is truncated to the range 0..1
-
inline QualityValueType value() const
Obtain the feed quality level
Friends
-
inline friend bool operator==(const AdaptiveQuality &lhs, const AdaptiveQuality &rhs)
Equality comparison
-
inline friend bool operator!=(const AdaptiveQuality &lhs, const AdaptiveQuality &rhs)
Inequality comparison
-
using QualityValueType = double
-
template<typename T>
class AdaptiveRule - #include <PxMedia/AdaptiveRule.h>
Definition for a rule which takes an adaptive quality value and gives back an outcome value.
Subclassed by Proximie::PxMedia::AdaptiveBandsRule< T >, Proximie::PxMedia::AdaptiveMinMaxRule< T >
Public Functions
-
virtual boost::optional<T> valueForQuality(AdaptiveQuality quality) const = 0
Given a quality, set the target value to the outcome.
The return value is optional, allowing the rule to return nothing to indicate no change.
-
virtual ~AdaptiveRule() = default
Virtual destructor, always subclassed.
-
virtual boost::optional<T> valueForQuality(AdaptiveQuality quality) const = 0
-
class AudioFeedStageComponent : public Proximie::PxMedia::FeedComponent<AudioFeedStageComponentProvider>
- #include <PxMedia/AudioFeedStage.h>
Base class for audio feed stage components.
Subclassed by Proximie::PxMedia::AudioStageVolume, Proximie::PxMedia::AudioStageWebRtcDsp
-
class AudioFeedStageSequence
- #include <PxMedia/AudioFeedStage.h>
A sequence of audio feed stage components.
Public Types
-
using ComponentSequence = std::vector<std::reference_wrapper<const AudioFeedStageComponent>>
A sequence of feed stage component references to set a sequence.
Public Functions
-
inline void sequence(const ComponentSequence &components)
Set the sequence of feed stages with a sequence of components.
-
using ComponentSequence = std::vector<std::reference_wrapper<const AudioFeedStageComponent>>
-
class AudioInputComponentSilence : public Proximie::PxMedia::AudioInputFeedComponent
- #include <PxMedia/AudioInputComponentSilence.h>
An audio input feed component that simply sends silence.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioInputFeedAuto : public Proximie::PxMedia::AudioInputFeedComponent
- #include <PxMedia/AudioInputFeedAuto.h>
An audio input component that chooses an appropriate audio source to use.
This feed component can be used to simply add an audio input without the application needing to provide device details itself.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioInputFeedComponent : public Proximie::PxMedia::FeedComponent<AudioInputFeedComponentProvider>
- #include <PxMedia/feed-components-audio.h>
Base class for audio input feed components.
Subclassed by Proximie::PxMedia::AudioInputComponentSilence, Proximie::PxMedia::AudioInputFeedAuto, Proximie::PxMedia::AudioInputFeedInter, Proximie::PxMedia::AudioInputFeedTestSignal
Public Functions
-
inline AudioFeedStageSequence &audioStages()
Obtain the audio feed stage sequence object, which can be used to set additional audio processing stages for the component.
-
inline const AudioFeedStageSequence &audioStages() const
Read-only access to the audio feed stage sequence.
-
inline AudioFeedStageSequence &audioStages()
-
class AudioInputFeedInter : public Proximie::PxMedia::AudioInputFeedComponent
- #include <PxMedia/AudioInputFeedInter.h>
An audio input component that accepts audio from a named inter channel.
Instances must be obtained via AudioOutputFeedInter::makeInput(), which ensures each consumer receives its own isolated sub-channel so that multiple consumers never share a GStreamer inter ring-buffer read pointer.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
~AudioInputFeedInter() override = default
Destructor.
-
AudioInputFeedInter(AudioInputFeedInter&&) = default
Move constructor — transfers ownership of the sub-channel.
-
AudioInputFeedInter &operator=(AudioInputFeedInter&&) = default
Move assignment — transfers ownership of the sub-channel.
-
inline bool isConsumed() const
Returns true if this input has already been consumed by a feed.
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioInputFeedTestSignal : public Proximie::PxMedia::AudioInputFeedComponent
- #include <PxMedia/AudioInputFeedTestSignal.h>
An audio input feed component that simply sends a regular beat as an audio signal. The wave type is configurable. If not specified it defaults to ticks.
This component can be used to use test audio without a physical device. This can be useful when testing to avoid acoustic feedback loops when testing.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline AudioInputFeedTestSignal &wave(Wave set)
Set the audio wave type; see AudioInputFeedTestSignal::Wave
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Types
-
enum class Wave
Wave type for audiotestsrc.
Values:
-
enumerator Sine
Sine wave.
-
enumerator Square
Square wave.
-
enumerator Saw
Saw wave.
-
enumerator Triangle
Triangle wave.
-
enumerator WhiteNoise
White noise.
-
enumerator PinkNoise
Pink noise.
-
enumerator Ticks
Periodic ticks.
-
enumerator GaussianNoise
White Gaussian noise.
-
enumerator RedNoise
Red (brownian) noise.
-
enumerator BlueNoise
Blue noise.
-
enumerator VioletNoise
Violet noise.
-
enumerator Sine
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
Public Static Functions
-
static const PxUtility::EnumMapper<Wave> &patternMapper()
Map between Pattern and string.
-
struct Properties
- #include <PxMedia/AudioInputFeedTestSignal.h>
The properties required to specify the audio input device and its settings.
-
inline AudioInputFeedTestSignal &wave(Wave set)
-
class AudioOutputComponentNull : public Proximie::PxMedia::AudioOutputFeedComponent
- #include <PxMedia/AudioOutputComponentNull.h>
An audio output feed component that “swallows” audio output without producing any output.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioOutputFeedAuto : public Proximie::PxMedia::AudioOutputFeedComponent
- #include <PxMedia/AudioOutputFeedAuto.h>
An audio input component that chooses an appropriate audio output to use.
This feed component can be used to simply add a suitable audio output without the application needing to provide device details itself.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioOutputFeedComponent : public Proximie::PxMedia::FeedComponent<AudioOutputFeedComponentProvider>
- #include <PxMedia/feed-components-audio.h>
Base class for audio output feed components.
Subclassed by Proximie::PxMedia::AudioOutputComponentNull, Proximie::PxMedia::AudioOutputFeedAuto, Proximie::PxMedia::AudioOutputFeedInter, Proximie::PxMedia::AudioOutputFeedWavescope
Public Functions
-
inline AudioFeedStageSequence &audioStages()
Obtain the audio feed stage sequence object, which can be used to set additional audio processing stages for the component.
-
inline const AudioFeedStageSequence &audioStages() const
Read-only access to the audio feed stage sequence.
-
inline AudioFeedStageSequence &audioStages()
-
class AudioOutputFeedInter : public Proximie::PxMedia::AudioOutputFeedComponent
- #include <PxMedia/AudioOutputFeedInter.h>
An audio output component that sends audio to a named inter channel.
This feed component can be used to send an audio stream to another pipeline. It is most commonly used in conjunction with the AudioInputFeedInter component, which accepts audio from a named inter channel.
Accessors
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Note
The channel name is auto-generated at construction time.
-
inline const std::vector<std::string> &outputChannels() const
Returns the list of sub-channel names registered via makeInput()
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
AudioOutputFeedInter()
Default constructor — generates a unique internal channel identifier.
-
explicit AudioOutputFeedInter(string_view label)
Constructor with optional debug label.
The internal channel name will be “<label>-<uuid>”, which appears in GStreamer debug output for easier identification.
- Parameters:
label – A short human-readable prefix for the generated channel name.
-
AudioInputFeedInter makeInput()
Create an input feed that consumes exclusively from this output.
Each call registers a new uniquely-named sub-channel so that multiple consumers never share a ring-buffer read pointer. When more than one input has been registered the output segment automatically inserts a GStreamer
teeelement with oneinteraudiosinkbranch per consumer.All calls to makeInput() must be made before the owning pipeline is built (i.e. before the feed
create()call that receives this output).
-
inline const Properties &properties() const
-
class AudioOutputFeedWavescope : public Proximie::PxMedia::AudioOutputFeedComponent
- #include <PxMedia/AudioOutputFeedWavescope.h>
An audio output feed component that displays the audio input as a simple waveform in a window. Note that there is a known issue with this component on Ubuntu 24.04 with GStreamer 1.24.2; see full documentation for details.
This component can be used to use test audio without a physical output device such as a speaker. This can be useful when testing to avoid acoustic feedback loops when testing.
This component automatically opens a window to output the waveform. The ability to specify an output target/window will be added in a subsequent SDK release.
Known issue on Ubuntu 24.04 with GStreamer 1.24.2
There is a known issue in GStreamer
1.24.2, the version of GStreamer available on Ubuntu24.04, which causes audio visualization plugins to accumulate waveform data indefinitely, making visualizations incorrect and causing high CPU usage. This was addressed in GStreamer1.24.4(see merge request). This affectsAudioOutputFeedWavescopeoutputs on Ubuntu24.04.Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioPeerRtpDecodeFeedComponent : public Proximie::PxMedia::FeedComponent<AudioPeerRtpDecodeFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Base class for audio peer decoder feed components.
Subclassed by Proximie::PxMedia::AudioPeerRtpDecodeFeedOpus
-
class AudioPeerRtpDecodeFeedOpus : public Proximie::PxMedia::AudioPeerRtpDecodeFeedComponent
- #include <PxMedia/AudioPeerRtpDecodeFeedOpus.h>
A audio feed component for specifying Opus decoding for SRTP.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
struct Properties
- #include <PxMedia/AudioPeerRtpDecodeFeedOpus.h>
The properties required to decode the audio feed for SRTP using Opus. No properties are currently supported.
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioPeerRtpEncodeFeedComponent : public Proximie::PxMedia::FeedComponent<AudioPeerRtpEncodeFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Base class for audio peer encoder feed components.
Subclassed by Proximie::PxMedia::AudioPeerRtpEncodeFeedOpus
-
class AudioPeerRtpEncodeFeedOpus : public Proximie::PxMedia::AudioPeerRtpEncodeFeedComponent
- #include <PxMedia/AudioPeerRtpEncodeFeedOpus.h>
A audio feed component for specifying Opus encoding for SRTP.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
struct Properties
- #include <PxMedia/AudioPeerRtpEncodeFeedOpus.h>
The properties required to encode the audio feed for SRTP using Opus.
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AudioStageVolume : public Proximie::PxMedia::AudioFeedStageComponent
- #include <PxMedia/AudioStageVolume.h>
Audio feed stage for adjusting audio volume using GStreamer volume element.
Public Functions
-
explicit AudioStageVolume(float volume = 1.0F)
Construct with initial volume (default 1.0 = unchanged)
-
void volume(float volume)
Set the audio volume (0.0 = mute, 1.0 = unchanged, >1.0 = amplify)
-
float volume() const
Get the current audio volume.
-
virtual shared_not_null<AudioFeedStageComponentProvider> makeProvider() const override
Required override to create a provider for the component
-
explicit AudioStageVolume(float volume = 1.0F)
-
class AudioStageWebRtcDsp : public Proximie::PxMedia::AudioFeedStageComponent
- #include <PxMedia/AudioStageWebRtcDsp.h>
Audio feed stage for applying WebRTC DSP effects.
This stage encapsulated a voice enhancement filter based on WebRTC Audio Processing library. The currently enabled enhancements are High Pass Filter, Noise Suppression, and Automatic Gain Control. All three are enabled by default.
AudioStageWebRtcDsp is unavailable on Ubuntu 24.04
The
AudioStageWebRtcDspstage requires that thewebrtcdspgstreamer plugin is installed on the system. Seemingly due to an oversight, this plugin is not available by default on Ubuntu 24.04. See webrtcdsp Gstreamer plugin for details.Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline AudioStageWebRtcDsp &compressionGainDb(int set)
Set the maximum gain in dB that the compression stage of the filter can apply. Defaults to 9.
-
inline AudioStageWebRtcDsp &gainControl(bool set)
Enable automatic gain control. Defaults to enabled.
-
inline AudioStageWebRtcDsp &gainControlMode(GainControlMode set)
Set gain control mode applied (if enabled). Defaults to Adaptive Digital.
-
inline AudioStageWebRtcDsp &highPassFilter(bool set)
Enable high-pass filter. Defaults to enabled.
-
inline AudioStageWebRtcDsp &limiter(bool set)
Enable limiter. When enabled, the compression stage will hard limit the signal to the target level. Otherwise, the signal will be compressed but not limited above the target level. Defaults to enabled.
-
inline AudioStageWebRtcDsp &noiseSuppression(bool set)
Enable noise suppression. Defaults to enabled.
-
inline AudioStageWebRtcDsp &noiseSuppressionLevel(NoiseSuppressionLevel set)
Set noise suppression level. Defaults to Moderate.
-
inline AudioStageWebRtcDsp &targetLevelDbfs(int set)
Set target peak level in dBFS (decibels from digital full-scale). Defaults to 3.
Public Types
Public Functions
-
explicit AudioStageWebRtcDsp() = default
Construct with default properties.
-
inline explicit AudioStageWebRtcDsp(Properties properties)
Construct with specified properties.
- Parameters:
properties – The properties to use for the WebRTC DSP stage.
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
-
virtual shared_not_null<AudioFeedStageComponentProvider> makeProvider() const override
Required override to create a provider for the component
Public Static Functions
-
static const PxUtility::EnumMapper<NoiseSuppressionLevel> &noiseSuppressionLevelMapper()
Map between NoiseSuppressionLevel and string.
-
static const PxUtility::EnumMapper<GainControlMode> &gainControlModeMapper()
Map between GainControlMode and string.
-
struct Properties
- #include <PxMedia/AudioStageWebRtcDsp.h>
Properties for the WebRTC audio DSP stage.
Public Members
-
boost::optional<int> compressionGainDb
The maximum gain in dB that the compression stage of the filter can apply; defaults to 9
-
boost::optional<bool> gainControl
Enable automatic gain control; defaults to enabled.
-
boost::optional<GainControlMode> gainControlMode
Gain control mode; defaults to AdaptiveDigital.
-
boost::optional<bool> highPassFilter
Enable high-pass filter; defaults to enabled.
-
boost::optional<bool> limiter
When enabled, the compression stage will hard limit the signal to the target level. Otherwise, the signal will be compressed but not limited above the target level. Defaults to true.
-
boost::optional<bool> noiseSuppression
Enable noise suppression; defaults to enabled.
-
boost::optional<NoiseSuppressionLevel> noiseSuppressionLevel
Noise suppression level.
-
boost::optional<int> targetLevelDbfs
The target peak |level| (or envelope) of the gain control in dBFS (decibels from digital full-scale). Defaults to 3.
-
boost::optional<int> compressionGainDb
-
inline AudioStageWebRtcDsp &compressionGainDb(int set)
-
class AudioWebRtcEncodeFeedComponent : public Proximie::PxMedia::FeedComponent<AudioWebRtcEncodeFeedComponentProvider>
- #include <PxMedia/feed-components-audio.h>
Base class for audio WebRTC encoder feed components.
Subclassed by Proximie::PxMedia::AudioWebRtcEncodeFeedOpus
-
class AudioWebRtcEncodeFeedOpus : public Proximie::PxMedia::AudioWebRtcEncodeFeedComponent
- #include <PxMedia/AudioWebRtcEncodeFeedOpus.h>
An audio feed component for specifying audio encoding using Opus.
The Opus encoder component uses fixed settings at this stage. In a later SDK update the component will expose settings that the application can set itself.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class AVOutputFeedFile : public Proximie::PxMedia::FeedBase
- #include <PxMedia/AVOutputFeedFile.h>
An output feed component that writes video (and optionally audio) to given local file(s).
This feed component provides properties to specify how the feed is encoded and saved to a file.
Additional features that this type of feed supports
Notify that a feed file has finished and can be read/used.
-
void fileOutputLocationHandler(const OnFormatLocationHandler &handler)
Override default file naming behaviour Important note: This function is called during the file recording and streaming process. The provided handler should return a value promptly and not block processing unduly.
NOTE: If a custom handler is set and returns a non-empty filename, it overrides all built-in filename generation including timestamp embedding (enableTimestampInFilename). If the handler returns an empty string, the built-in naming (including timestamp embedding when enabled) will be used. If you need both custom naming AND timestamps, implement the timestamp logic within your custom handler.
Public Types
-
using FeedProperties = FeedBase::FeedBaseProperties
Properties that apply to the whole feed.
-
using OnFormatLocationHandler = std::function<std::string(guint seq)>
Callback for overriding file output location.
Public Static Functions
Factory method to create a recording feed that takes a video input, zero or more audio inputs, and writes it to disk with default X264 encoder.
- Parameters:
context – The Proximie context to use for the feed
props – Feed properties (label, etc.)
settings – File output settings (directory, filename pattern, size/duration limits)
input – Video input feed component
audioInputs – Optional vector of audio input feed components
- Returns:
NotNullOutcome containing the created AVOutputFeedFile or an error
Factory method to create a recording feed that takes a video input, specific H264 encoder (X264, VAAPI), zero or more audio inputs, and writes it to disk.
- Parameters:
context – The Proximie context to use for the feed
props – Feed properties (label, etc.)
settings – File output settings (directory, filename pattern, size/duration limits)
input – Video input feed component
encoder – H264 encoder component (X264, VAAPI, etc.)
audioInputs – Optional vector of audio input feed components
- Returns:
NotNullOutcome containing the created AVOutputFeedFile or an error
-
static X264EncoderFeedComponent defaultRecordingEncoder()
Return an encoder with default settings for recording.
Callers can take this encoder with basic settings, and tune them as required
-
class AVOutputFeedFileSettings
- #include <PxMedia/AVOutputFeedFile.h>
Settings for the AVOutputFeedFile.
Setters with validation
These setter functions return std::error_code to indicate validation failures.
-
std::error_code destinationDirectory(const std::string &dir)
Set the directory to save output files to.
When empty, destinationFilenamePattern is used as-is (relative to working directory). Default: “” (empty, pattern used as-is)
- Parameters:
dir – The destination directory path (empty = use pattern as-is)
- Returns:
std::error_code indicating success or failure
-
std::error_code destinationFilenamePattern(const std::string &pattern)
Set the filename pattern for output files.
Pattern must be relative; absolute paths and parent directory (..) references are always rejected to prevent escaping destinationDirectory. Supported specifiers: d, i, u with optional width (e.g., %02d, %05d, up to %99d). Default: “video%02d.mp4” (printf-style pattern with sequence number)
- Parameters:
pattern – Printf-compatible pattern (e.g., “video%02d.mp4”)
- Returns:
std::error_code indicating success or validation failure
-
std::error_code enableTimestampInFilename(bool enable)
Enable UTC timestamp embedding in filenames.
When enabled, generates filenames like “video_1708185600000_00.mp4” (UTC ms) for multi-stream synchronization. Default: false (backwards compatible, no timestamp embedding)
- Parameters:
enable – True to enable timestamp embedding
- Returns:
std::error_code indicating success or failure
-
std::error_code videoCodec(VideoCodec codec)
Set the video codec.
Currently only VideoCodec::H264 is supported. Default: VideoCodec::H264
- Parameters:
codec – The video codec to use
- Returns:
std::error_code indicating success or failure
-
std::error_code audioCodec(AudioCodec codec)
Set the audio codec.
Currently only AudioCodec::AAC is supported. Default: AudioCodec::AAC
- Parameters:
codec – The audio codec to use
- Returns:
std::error_code indicating success or failure
-
std::error_code avContainer(AVContainer container)
Set the container format.
Currently only AVContainer::MP4 is supported. Default: AVContainer::MP4
- Parameters:
container – The container format to use
- Returns:
std::error_code indicating success or failure
-
std::error_code maxFiles(uint32_t maxFiles)
Set the maximum number of files to create.
Default: 0 (unlimited)
Note
Incompatible with timestamp embedding (has no effect when enabled).
- Parameters:
maxFiles – Maximum file count (0 = unlimited)
- Returns:
std::error_code indicating success or failure
-
std::error_code maxFileSizeMB(uint64_t maxSizeMB)
Set the maximum size of a file in MB.
Default: 0 (unlimited - no file size limit)
Note
Validates that maxSizeMB * 1048576 won’t overflow uint64_t. Returns std::errc::value_too_large if validation fails.
- Parameters:
maxSizeMB – Maximum file size in megabytes (0 = unlimited)
- Returns:
std::error_code indicating success or failure
-
std::error_code maxFileDurationS(uint64_t maxDurationS)
Set the maximum duration of a file in seconds.
Default: 0 (unlimited - no file duration limit)
Note
Validates that maxDurationS * 1000000000 won’t overflow uint64_t. Returns std::errc::value_too_large if validation fails.
- Parameters:
maxDurationS – Maximum file duration in seconds (0 = unlimited)
- Returns:
std::error_code indicating success or failure
Getters
-
inline const std::string &destinationDirectory() const
Get the destination directory.
-
inline const std::string &destinationFilenamePattern() const
Get the filename pattern.
-
inline bool enableTimestampInFilename() const
Get timestamp embedding flag.
-
inline VideoCodec videoCodec() const
Get video codec.
-
inline AudioCodec audioCodec() const
Get audio codec.
-
inline AVContainer avContainer() const
Get container format.
-
inline uint32_t maxFiles() const
Get maximum file count.
-
inline uint64_t maxFileSizeMB() const
Get maximum file size in MB.
-
inline uint64_t maxFileDurationS() const
Get maximum file duration in seconds.
-
std::error_code destinationDirectory(const std::string &dir)
-
class BitRate
- #include <PxMedia/BitRate.h>
Encapsulates a bit rate value with varying units of bits (bits, kbits, etc.) per second.
BitRate defines some convenient literals for creating bit rate values.
Enable the literals by including the following:
using namespace Proximie::PxMedia::Literals;
Then, you can create bit rate values using the following:
constexpr auto H264_BITRATE = 2000_kbps;
The following literals are supported:
bps,kbps,mbps,gbps.Get bit rate values
-
ValueType bitRateWithUnits(UnitType unit, ScaleMethod rounding, RemainderType *remainder = nullptr) const
Scales the bit rate to the specified unit.
When scaling a bit rate to a larger unit without floating point, there is the possibility of rounding being needed. This function allows the caller to specify how rounding should be performed, including how to handle non-zero bit rates that would otherwise be rounded to a zero value.
- Parameters:
unit – [in] The units to convert the bitrate value to
rounding – [in] How to round the value when converting
remainder – [out] Optionally output the remainder in bits
- Returns:
The bit rate converted to the requested units
Creation
Also see the main BitRate description for details on how to use bit rate literals.
-
constexpr BitRate() = default
Default construction is a zero bit rate
Comparison & testing of the bit rate value
-
inline bool isZero() const
Test if the bitrate value is zero
Public Types
-
enum class UnitType
Units of bits per second
Values:
-
enumerator Bits
-
enumerator KBits
-
enumerator MBits
-
enumerator GBits
-
enumerator Bits
-
enum class ScaleMethod
How to round when scaling to a specified unit
Values:
-
enumerator Nearest
Round to the nearest unit.
-
enumerator Down
Round down to the nearest unit.
-
enumerator Up
Round up to the nearest unit.
-
enumerator DownNotZero
Round down, but only to when already zero.
-
enumerator NearestNotZero
Round nearest, but only to when already zero.
-
enumerator Nearest
-
using ValueType = std::uint64_t
A number of bits
-
ValueType bitRateWithUnits(UnitType unit, ScaleMethod rounding, RemainderType *remainder = nullptr) const
-
class Configuration
- #include <PxMedia/Configuration.h>
Singleton for configuring PxMedia module settings.
Use the Configuration::get() method to access the singleton instance, and then chain setter methods to configure the settings.
Configuration settings
Accessors to get & set configuration settings. Note that setter methods typically return the configuration instance to allow chaining. However, where setters have error return, these are not chainable.
-
Configuration &gstreamerDebugLevel(GstDebugLevel level)
Set the GStreamer debugging level.
Note that the debug level is the GStreamer library debug level type GstDebugLevel, not the Proximie SDK logging severity level.
The SDK does not set/override any GStreamer debugging level itself, only when the application itself calls this function.
-
GstDebugLevel gstreamerDebugLevel() const
Returns the current GStreamer debug level
-
Configuration &gstreamerLogTarget(GStreamerLogger target)
Set the target for GStreamer log output.
When using the Proximie SDK logger target, GStreamer debug levels are translated to the corresponding SDK logger severity levels.
-
inline GStreamerLogger gstreamerLogTarget() const
Returns the current GStreamer target
Public Types
-
enum class GStreamerLogger
Enumeration to specify where GStreamer output is targeted
Values:
-
enumerator CONSOLE
Output to console (default)
-
enumerator PXLOGGER
Direct output to the Proximie SDK logger.
-
enumerator CONSOLE
-
using fspath = boost::filesystem::path
Alias for the filesystem path type.
Public Functions
-
outcome::result<void> diagnosticsFolder(const fspath &folder)
Set the diagnostics folder for PxMedia.
Returns an error if the path is not an existing directory
-
Configuration &diagnosticsFolderOrThrow(const fspath &folder)
Set the diagnostics folder for PxMedia.
Throws an error if the path is not an existing directory
Public Static Functions
-
static Configuration &get()
Access the configuration singleton
-
Configuration &gstreamerDebugLevel(GstDebugLevel level)
-
class FeedBase : public std::enable_shared_from_this<FeedBase>
- #include <PxMedia/FeedBase.h>
Base feed object that all feed objects inherit from.
Subclassed by Proximie::PxMedia::AVOutputFeedFile, Proximie::PxMedia::MediaServerFeed, Proximie::PxMedia::PeerFeed, Proximie::PxMedia::UtilityAudioLocalFeed, Proximie::PxMedia::UtilityVideoLocalFeed
Feed object interface
-
template<typename T>
inline bool is() const Helper to test if a feed is a given derived type.
Helper to cast a feed to a given derived type Returns nullptr if the feed is not of the given type
Public Functions
-
inline std::string id() const
The unique ID for the feed
-
inline std::string label() const
The human-readable label for the feed
-
inline bool isPlaying() const
Whether the feed is currently playing
-
inline outcome::result<void> startFeed()
Start the feed playing.
No effect if the feed is already playing
-
inline outcome::result<void> stopFeed()
Stop the feed playing.
No effect if the feed is not already playing
Notify that a feed has successfully started
Notify that a feed has stopped, which may be intentionally or in error
-
template<typename T, typename = std::enable_if_t<std::is_base_of<FeedRequest, T>::value>>
inline outcome::result<void> feedRequest(T request) Send a request to the feed.
- Returns:
An outcome indicating if the request was handled (
true) or not (false). If there is an error processing the feed, this will be reflected an an outcome error.
-
inline outcome::result<std::string> getPipelineGraph() const
Obtain GStreaming pipeline graph for the feed with all details.
- Returns:
The graph is returned as a string in the .dot format as an outcome
-
inline outcome::result<boost::filesystem::path> writePipelineGraphToFile(string_view filename) const
Write a pipeline .dot graph to a file with all details.
The file name may be absolute or relative, if relative it will use the diagnostics folder from the
PxMedia::Configuration- Returns:
The path to the file written
-
inline outcome::result<std::string> getPipelineGraphWithDetails(GstDebugGraphDetails details) const
Obtain GStreaming pipeline graph for the feed at a given detail level.
- Returns:
The graph is returned as a string in the .dot format as an outcome
-
inline outcome::result<boost::filesystem::path> writePipelineGraphWithDetailsToFile(string_view filename, GstDebugGraphDetails details) const
Write a pipeline .dot graph to a file at a given detail level.
The file name may be absolute or relative, if relative it will use the diagnostics folder from the
PxMedia::Configuration- Returns:
The path to the file written
-
struct FeedBaseProperties
- #include <PxMedia/FeedBase.h>
Properties that apply to the whole feed.
Subclassed by Proximie::PxMedia::MediaServerIncomingVideoFeed::FeedProperties, Proximie::PxMedia::MediaServerOutgoingVideoFeed::FeedProperties, Proximie::PxMedia::PeerFeed::FeedProperties
Public Functions
-
inline explicit FeedBaseProperties(string_view label = {})
Constructor allowing the label to be set.
Public Members
-
std::string label
Readable label for the feed.
-
inline explicit FeedBaseProperties(string_view label = {})
-
template<typename T>
-
template<class PROVIDER>
class FeedComponent - #include <PxMedia/FeedComponent.h>
The basic building block and abstract interface of all feed components.
- Template Parameters:
PROVIDER – Opaque “provider” class that is used to create/implement a feed instance’s behaviour
-
class FeedPacketLossAssessor : public Proximie::PxMedia::FeedPerformanceAssessor
- #include <PxMedia/FeedPacketLossAssessor.h>
A feed performance assessment helper that looks at packet loss.
Public Functions
-
FeedPacketLossAssessor() = default
Create the assessor with default settings
-
inline explicit FeedPacketLossAssessor(const Settings &settings)
Create the assessor with custom settings
-
virtual double assessPerformance(const FeedPerformanceStats &details) const override
Given the current stats of a feed, return the delta to apply to the current quality level.
-
struct Settings
- #include <PxMedia/FeedPacketLossAssessor.h>
Settings for the packet loss assessment instances
Public Functions
-
Settings()
Construct settings with reasonable default values
Public Members
-
double lowPacketLossRatioThreshold
The low threshold indicates the point where quality should be reduced to improve the packet loss to an acceptable level. Below this threshold, the quality may be improved.
-
double severePacketLossRatioThreshold
The severe threshold indicates the point where quality should be reduced more aggressively.
-
double qualityImproveDelta
When the packet loss ratio is below the low threshold, the quality will be improved by this delta.
-
double qualityReduceGentleDelta
When the packet loss ratio is moderate, the quality will be reduced by this “gentle” delta.
-
double qualityReduceSevereDelta
When the packet loss ratio is severe, the quality will be reduced by this “severe” delta.
-
Settings()
-
FeedPacketLossAssessor() = default
-
class FeedPerformanceAssessor
- #include <PxMedia/FeedPerformanceAssessor.h>
A rule for assessing performance and quality
Subclassed by Proximie::PxMedia::FeedPacketLossAssessor
Public Functions
-
virtual ~FeedPerformanceAssessor() = default
Virtual destructor as this class is overrideable
-
virtual double assessPerformance(const FeedPerformanceStats &details) const = 0
Given the current stats of a feed, return the delta to apply to the current quality level.
-
struct FeedPerformanceStats
- #include <PxMedia/FeedPerformanceAssessor.h>
Information shared with the monitor for each feed being monitored
Public Functions
Create a stats struct with a non-null feed reference
Public Members
-
shared_not_null<MediaServerOutgoingVideoFeed> feed
The feed being assessed
-
AdaptiveQuality currentQuality
The current quality setting that was set for the feed
-
WebRtcStats webRtcStats
WebRTC statistics collected from the feed
-
double packetLossRatio = 0
Packet loss ratio from the current statistics
-
boost::optional<double> packetLossRatioAverage
When available, the (moving) average packet loss calculated from recent assessments
-
virtual ~FeedPerformanceAssessor() = default
-
class FeedQualityMonitor
- #include <PxMedia/FeedQualityMonitor.h>
A class that checks the performance of a set of adaptive feeds, and applies quality requests to adapt their performance accordingly.
Public Functions
-
explicit FeedQualityMonitor(std::unique_ptr<FeedPerformanceAssessor> assessor)
Construct a new FeedQualityMonitor object, providing a performance assessment handler.
After creation, the caller can add feeds and start the monitor.
-
bool isRunning() const
Returns whether the monitor is currently running.
-
void start(std::chrono::milliseconds interval)
Start the feed quality monitor with the given interval.
If the monitor is already running, it will reset with the given new timing internal.
-
void stop()
Stop the feed quality monitor. If the monitor is not running, this is a no-op.
Check if a feed is being monitored already.
Register a feed to be monitored. Ignored if the feed is already registered.
Unregister a feed from being monitored. Ignored if the feed is not registered.
-
void unregisterAllFeeds()
Unregister all currently registered feeds.
-
explicit FeedQualityMonitor(std::unique_ptr<FeedPerformanceAssessor> assessor)
-
class FeedRequest
- #include <PxMedia/FeedRequest.h>
A common base class for feed events and requests.
Feed requests are used to make a request to a feed object to change behaviour or settings. Since a feed may be made up of various feed components decided at runtime, requests have a general base class and are handled or ignored by the feed depending on its makeup.
Subclassed by Proximie::PxMedia::SrtFeedStatsRequest, Proximie::PxMedia::VideoStagePrivacy::RequestPrivacy, Proximie::PxMedia::VideoStageTextOverlay::RequestSetText, Proximie::PxMedia::WebRtcStatsRequest, Proximie::PxMedia::experimental::FeedDiagnosticsRequest
Public Functions
-
virtual ~FeedRequest() = default
Virtual destructor as this is always subclassed.
-
template<typename T>
inline bool is() const Helper to test if a feed request is a given derived type.
-
template<typename T>
inline T *as() Convert to a given derived type; returns nullptr if the request is not of the given type.
-
template<typename T>
inline const T *as() const Convert to a given derived type; returns nullptr if the request is not of the given type.
-
inline error_code unhandledError() const
Requests that are not handled by a feed should use this status/error.
-
virtual ~FeedRequest() = default
-
class FrameRate
- #include <PxMedia/FrameRate.h>
Encapsulates a formal frame rate value.
Creation
-
inline FrameRate()
Default construction is a zero frame rate
-
inline FrameRate(FractionInt frameRate)
Construct a frame rate object with a simple frame rate integer (i.e. the denominator defaults to 1).
-
inline FrameRate(FractionInt numerator, FractionInt denominator)
Construct a frame rate object with numerator/denominator values.
Public Types
-
using FractionInt = gint
Frame rate fraction numerator/denominator integer type
Public Functions
-
inline void set(FractionInt frameRate)
Set a frame rate value with a simple frame rate integer (i.e. the denominator defaults to 1).
-
inline void set(FractionInt numerator, FractionInt denominator)
Set a frame rate value with numerator/denominator values.
-
inline FractionInt numerator() const
Obtain the frame rate ratio numerator value
-
inline FractionInt denominator() const
Obtain the frame rate ratio denominator value
-
inline bool isZero() const
Test if zero numerator (i.e. no frame rate)
-
inline std::string toFrameRateString() const
Obtain a string/printable version of the frame rate value
-
inline double toDouble() const
Convert to a double value
-
inline void fromDouble(double value)
Convert from a double value
-
inline FrameRate()
-
class H264VaapiEncoderComponent : public Proximie::PxMedia::H264VideoEncoderComponent
- #include <PxMedia/H264VaapiEncoderComponent.h>
Encapsulates a VA-API hardware-accelerated H.264 encoder element (vaapih264enc) for use in feeds.
This encoder provides hardware-accelerated H.264 encoding on Intel and AMD GPUs using the Video Acceleration API (VAAPI).
These defaults match the X.264 software encoder for consistency, allowing you to switch between encoders without reconfiguration. Customize all properties as needed for your specific use case (e.g., higher bitrate and VBR for file recording).
See also
VideoWebRtcEncodeFeedH264 for WebRTC streaming usage
See also
AVOutputFeedFile for file recording usage
Note
Default Configuration: Optimized for WebRTC real-time communication with settings that prioritize low latency and predictable bandwidth usage:
Rate Control: CBR (Constant Bitrate) for stable network streaming
Bitrate: 2000 kbps (matching X.264 software encoder defaults)
Keyframe Period: 30 frames (~1 second at 30fps)
B-Frames: 0 (P-frames only) for minimal encoding latency
QoS: Disabled to prevent adaptive frame dropping
Note
Requirements:
Your runtime environment must support VA-API
The vaapih264enc GStreamer element must be available (install gstreamer1.0-vaapi)
CBR rate control requires the non-free Intel media driver (intel-media-va-driver-non-free)
Docker environments need
--device /dev/driand possibly--privileged
Getters
These getter functions provide read-only access to component properties. They return boost::optional<T>: if the optional contains a value, that value will be applied to the GStreamer element. If the optional is empty (boost::none), the property will not be set, allowing GStreamer to use its default value.
-
inline boost::optional<bool> aud() const
Get AU delimiter setting
-
inline boost::optional<bool> cabac() const
Get CABAC entropy coding setting
-
inline boost::optional<ComplianceMode> complianceMode() const
Get compliance mode
-
inline boost::optional<uint32_t> cpbLength() const
Get CPB length
-
inline boost::optional<bool> dct8x8() const
Get DCT 8x8 transforms setting
-
inline boost::optional<int32_t> roiDeltaQp() const
Get ROI delta QP
-
inline boost::optional<uint32_t> initQp() const
Get initial QP
-
inline boost::optional<uint32_t> keyframePeriod() const
Get keyframe period
-
inline boost::optional<uint32_t> maxBframes() const
Get maximum B frames
-
inline boost::optional<uint32_t> maxQp() const
Get maximum QP
-
inline boost::optional<uint64_t> minForceKeyUnitInterval() const
Get minimum force key unit interval
-
inline boost::optional<uint32_t> minQp() const
Get minimum QP
-
inline boost::optional<uint32_t> numSlices() const
Get number of slices
-
inline boost::optional<uint32_t> numViews() const
Get number of views
-
inline boost::optional<PredictionType> predictionType() const
Get prediction type
-
inline boost::optional<bool> qos() const
Get QoS setting
-
inline boost::optional<int32_t> qpIb() const
Get QP difference between I and B frames
-
inline boost::optional<int32_t> qpIp() const
Get QP difference between I and P frames
-
inline boost::optional<uint32_t> qualityFactor() const
Get quality factor
-
inline boost::optional<uint32_t> qualityLevel() const
Get quality level
-
inline boost::optional<RateControlMode> rateControl() const
Get rate control mode
-
inline boost::optional<uint32_t> refs() const
Get number of reference frames
-
inline boost::optional<uint32_t> targetPercentage() const
Get target percentage
-
inline boost::optional<uint32_t> temporalLevels() const
Get temporal levels
-
inline boost::optional<bool> trellis() const
Get trellis quantization setting
-
inline boost::optional<std::string> viewIds() const
Get view IDs
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline H264VaapiEncoderComponent &aud(bool set)
Set AU delimiter
-
inline H264VaapiEncoderComponent &defaultAud()
Reset AU delimiter to GStreamer default
-
inline H264VaapiEncoderComponent &bitrate(BitRate set)
Set target bitrate
-
inline H264VaapiEncoderComponent &defaultBitrate()
Reset bitrate to GStreamer default
-
inline H264VaapiEncoderComponent &cabac(bool set)
Set CABAC entropy coding
-
inline H264VaapiEncoderComponent &defaultCabac()
Reset CABAC to GStreamer default
-
inline H264VaapiEncoderComponent &complianceMode(ComplianceMode set)
Set compliance mode
-
inline H264VaapiEncoderComponent &defaultComplianceMode()
Reset compliance mode to GStreamer default
-
inline H264VaapiEncoderComponent &cpbLength(uint32_t set)
Set CPB length
-
inline H264VaapiEncoderComponent &defaultCpbLength()
Reset CPB length to GStreamer default
-
inline H264VaapiEncoderComponent &dct8x8(bool set)
Set DCT 8x8 transforms
-
inline H264VaapiEncoderComponent &defaultDct8x8()
Reset DCT 8x8 to GStreamer default
-
inline H264VaapiEncoderComponent &roiDeltaQp(int32_t set)
Set ROI delta QP
Note
The underlying GStreamer property is named “default-roi-delta-qp”, but we use roiDeltaQp() for the setter to avoid confusion with the reset method pattern.
-
inline H264VaapiEncoderComponent &defaultRoiDeltaQp()
Reset ROI delta QP to GStreamer default
-
inline H264VaapiEncoderComponent &initQp(uint32_t set)
Set initial QP
-
inline H264VaapiEncoderComponent &defaultInitQp()
Reset initial QP to GStreamer default
-
inline H264VaapiEncoderComponent &keyframePeriod(uint32_t set)
Set keyframe period
-
inline H264VaapiEncoderComponent &defaultKeyframePeriod()
Reset keyframe period to GStreamer default
-
inline H264VaapiEncoderComponent &maxBframes(uint32_t set)
Set maximum B frames
-
inline H264VaapiEncoderComponent &defaultMaxBframes()
Reset maximum B frames to GStreamer default
-
inline H264VaapiEncoderComponent &maxQp(uint32_t set)
Set maximum QP
-
inline H264VaapiEncoderComponent &defaultMaxQp()
Reset maximum QP to GStreamer default
-
inline H264VaapiEncoderComponent &mbbrc(Mbbrc set)
Set macroblock bitrate control
-
inline H264VaapiEncoderComponent &defaultMbbrc()
Reset macroblock bitrate control to GStreamer default
-
inline H264VaapiEncoderComponent &minForceKeyUnitInterval(uint64_t set)
Set minimum force key unit interval
-
inline H264VaapiEncoderComponent &defaultMinForceKeyUnitInterval()
Reset minimum force key unit interval to GStreamer default
-
inline H264VaapiEncoderComponent &minQp(uint32_t set)
Set minimum QP
-
inline H264VaapiEncoderComponent &defaultMinQp()
Reset minimum QP to GStreamer default
-
inline H264VaapiEncoderComponent &numSlices(uint32_t set)
Set number of slices
-
inline H264VaapiEncoderComponent &defaultNumSlices()
Reset number of slices to GStreamer default
-
inline H264VaapiEncoderComponent &numViews(uint32_t set)
Set number of views
-
inline H264VaapiEncoderComponent &defaultNumViews()
Reset number of views to GStreamer default
-
inline H264VaapiEncoderComponent &predictionType(PredictionType set)
Set prediction type
-
inline H264VaapiEncoderComponent &defaultPredictionType()
Reset prediction type to GStreamer default
-
inline H264VaapiEncoderComponent &qos(bool set)
Set QoS
-
inline H264VaapiEncoderComponent &defaultQos()
Reset QoS to GStreamer default
-
inline H264VaapiEncoderComponent &qpIb(int32_t set)
Set QP difference between I and B frames
-
inline H264VaapiEncoderComponent &defaultQpIb()
Reset QP IB to GStreamer default
-
inline H264VaapiEncoderComponent &qpIp(int32_t set)
Set QP difference between I and P frames
-
inline H264VaapiEncoderComponent &defaultQpIp()
Reset QP IP to GStreamer default
-
inline H264VaapiEncoderComponent &qualityFactor(uint32_t set)
Set quality factor
-
inline H264VaapiEncoderComponent &defaultQualityFactor()
Reset quality factor to GStreamer default
-
inline H264VaapiEncoderComponent &qualityLevel(uint32_t set)
Set quality level
-
inline H264VaapiEncoderComponent &defaultQualityLevel()
Reset quality level to GStreamer default
-
inline H264VaapiEncoderComponent &rateControl(RateControlMode set)
Set rate control mode
-
inline H264VaapiEncoderComponent &defaultRateControl()
Reset rate control to GStreamer default
-
inline H264VaapiEncoderComponent &refs(uint32_t set)
Set number of reference frames
-
inline H264VaapiEncoderComponent &defaultRefs()
Reset number of reference frames to GStreamer default
-
inline H264VaapiEncoderComponent &targetPercentage(uint32_t set)
Set target percentage
-
inline H264VaapiEncoderComponent &defaultTargetPercentage()
Reset target percentage to GStreamer default
-
inline H264VaapiEncoderComponent &temporalLevels(uint32_t set)
Set temporal levels
-
inline H264VaapiEncoderComponent &defaultTemporalLevels()
Reset temporal levels to GStreamer default
-
inline H264VaapiEncoderComponent &trellis(bool set)
Set trellis quantization
-
inline H264VaapiEncoderComponent &defaultTrellis()
Reset trellis quantization to GStreamer default
-
inline H264VaapiEncoderComponent &tune(Tune set)
Set encoder tuning option
-
inline H264VaapiEncoderComponent &defaultTune()
Reset encoder tuning to GStreamer default
-
inline H264VaapiEncoderComponent &viewIds(const std::string &set)
Set view IDs
-
inline H264VaapiEncoderComponent &defaultViewIds()
Reset view IDs to GStreamer default
Public Types
-
enum class RateControlMode
Rate control modes for the vaapih264enc encoder.
Values:
-
enumerator CQP
Constant QP.
-
enumerator CBR
Constant bitrate.
-
enumerator VBR
Variable bitrate.
-
enumerator VBR_CONSTRAINED
Variable bitrate - Constrained.
-
enumerator ICQ
Constant QP - Intelligent.
-
enumerator QVBR
Variable bitrate - Quality defined.
-
enumerator CQP
-
enum class ComplianceMode
Compliance mode values for tuning encode quality/performance.
Values:
-
enumerator STRICT
Strict compliance to the H264 Specification.
-
enumerator RESTRICT_BUF_ALLOC
Restrict the allocation size of coded-buffer.
-
enumerator STRICT
-
enum class PredictionType
Reference Picture Selection Modes.
Values:
-
enumerator DEFAULT
Default encode, prev/next frame as ref.
-
enumerator HIERARCHICAL_P
Hierarchical P frame encode.
-
enumerator HIERARCHICAL_B
Hierarchical B frame encode.
-
enumerator DEFAULT
Public Functions
-
H264VaapiEncoderComponent()
Default constructor.
Initializes the encoder with default values optimized for WebRTC real-time communication (CBR at 2000 kbps, 30 keyframe period, 0 B-frames, QoS disabled).
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
Public Static Functions
-
static const PxUtility::EnumMapper<RateControlMode> &rateControlModeMapper()
Get the enum-string mapper for RateControlMode.
- Returns:
Reference to the EnumMapper for RateControlMode.
-
static const PxUtility::EnumMapper<ComplianceMode> &complianceModeMapper()
Get the enum-string mapper for ComplianceMode.
- Returns:
Reference to the EnumMapper for ComplianceMode.
-
static const PxUtility::EnumMapper<PredictionType> &predictionTypeMapper()
Get the enum-string mapper for PredictionType.
- Returns:
Reference to the EnumMapper for PredictionType.
-
static const PxUtility::EnumMapper<Mbbrc> &mbbrcMapper()
Get the enum-string mapper for Mbbrc.
- Returns:
Reference to the EnumMapper for Mbbrc.
-
static const PxUtility::EnumMapper<Tune> &tuneMapper()
Get the enum-string mapper for Tune.
- Returns:
Reference to the EnumMapper for Tune.
-
class H264VideoEncoderComponent : public Proximie::PxMedia::FeedComponent<H264VideoEncoderComponentProvider>
- #include <PxMedia/feed-components-video.h>
Base class for H.264 video encoder feed components.
Provides H.264-specific functionality and type safety. All H.264 encoder implementations (x264, VAAPI) should inherit from this class.
Subclassed by Proximie::PxMedia::H264VaapiEncoderComponent, Proximie::PxMedia::X264EncoderFeedComponent
-
class IFeedFeature
- #include <PxMedia/IFeedFeature.h>
Base interface common to all feed objects.
Public Functions
-
virtual std::string id() const = 0
The unique ID for the feed
-
virtual std::string label() const = 0
The human-readable label for the feed
-
virtual outcome::result<void> startFeed() = 0
Start the feed playing.
No effect if the feed is already playing
-
virtual bool isPlaying() const = 0
Whether the feed is currently playing
-
virtual outcome::result<void> stopFeed() = 0
Stop the feed playing.
No effect if the feed is not already playing
Send a request to the feed.
- Returns:
An outcome indicating if the request was handled (
true) or not (false). If there is an error processing the feed, this will be reflected an an outcome error.
-
virtual outcome::result<std::string> getPipelineGraphWithDetails(GstDebugGraphDetails details) const = 0
Obtain GStreaming pipeline graph for the feed at a given detail level.
- Returns:
The graph is returned as a string in the .dot format as an outcome
-
virtual outcome::result<boost::filesystem::path> writePipelineGraphWithDetailsToFile(string_view filename, GstDebugGraphDetails details) const = 0
Write a pipeline .dot graph to a file at a given detail level.
The file name may be absolute or relative, if relative it will use the diagnostics folder from the
PxMedia::Configuration- Returns:
The path to the file written
Notify that a feed has successfully started
Notify that a feed has stopped, which may be intentionally or in error
-
virtual std::string id() const = 0
-
class IMediaServerFeedFeature
- #include <PxMedia/IMediaServerFeedFeature.h>
The interface common to all media server feeds.
Public Types
-
using FeedStatsCallback = std::function<void(shared_not_null<MediaServerFeedStats>)>
Callback for obtaining feed statistics.
Public Functions
-
virtual std::shared_ptr<MediaServerSession> session() const = 0
Obtain the media session this feed belongs to. This may be null if the session has shut down.
-
virtual bool feedStatistics(const FeedStatsCallback &callback) = 0
Request the feed’s statistics.
This function is asynchronous, calling the provided callback with the results when collected.
-
using FeedStatsCallback = std::function<void(shared_not_null<MediaServerFeedStats>)>
-
class IPeerFeedFeature
- #include <PxMedia/IPeerFeedFeature.h>
The interface common to all peer feeds.
Public Functions
-
virtual std::shared_ptr<PeerSession> session() const = 0
Obtain the peer session this feed belongs to. Note that the peer session may be null if the session has shut down.
-
virtual std::shared_ptr<PeerSession> session() const = 0
-
class MediaServerFeed : public Proximie::PxMedia::FeedBase
- #include <PxMedia/MediaServerFeed.h>
Base class for all feeds that are part of a media server session.
Subclassed by Proximie::PxMedia::MediaServerIncomingVideoFeed, Proximie::PxMedia::MediaServerOutgoingVideoFeed, Proximie::PxMedia::MediaServerTwoWayAudioFeed
Public Types
-
using MediaServerFeedProperties = FeedBaseProperties
Properties that apply to the whole feed.
Public Functions
-
inline IMediaServerFeedFeature &mediaServerFeed()
Supports the media server feed feature.
-
inline const IMediaServerFeedFeature &mediaServerFeed() const
Supports the media server feed feature.
-
using MediaServerFeedProperties = FeedBaseProperties
-
struct MediaServerFeedStats
- #include <PxMedia/MediaServerFeedStats.h>
Statistics for a given media feed
Public Functions
Create feed statistics details for a given feed.
Public Members
-
shared_not_null<MediaServerFeed> feed
The feed.
-
WebRtcStats webRtcStats
WebRTC stats for the feed.
-
class MediaServerIncomingVideoFeed : public Proximie::PxMedia::MediaServerFeed
- #include <PxMedia/MediaServerIncomingVideoFeed.h>
A class which manages an incoming video feed in a media server session.
Public Static Functions
Factory method to create an incoming video feed associated with a media server session.
-
struct FeedProperties : public Proximie::PxMedia::FeedBase::FeedBaseProperties
- #include <PxMedia/MediaServerIncomingVideoFeed.h>
Properties that apply to the whole feed.
Public Functions
-
inline explicit FeedProperties(string_view feedId)
Construct feed properties with just the feed-id to subscribe to.
-
inline explicit FeedProperties(string_view label, string_view feedId)
Construct feed properties with a label & stream-id to subscribe to
Public Members
-
std::string subscribeFeedId
The feed ID to subscribe to.
-
inline explicit FeedProperties(string_view feedId)
-
class MediaServerOutgoingVideoFeed : public Proximie::PxMedia::MediaServerFeed
- #include <PxMedia/MediaServerOutgoingVideoFeed.h>
A class which manages a local video feed being shared in a media server session.
Adaptive streaming support
-
void applyAdaptiveQuality(AdaptiveQuality quality)
Request the connection adjust its quality
-
AdaptiveQuality adaptiveQuality() const
Obtain the current adaptive quality
Public Static Functions
Factory method to create an outgoing video feed in a media server session.
Factory method to create an outgoing video feed in a media server session, with an additional local video output target.
Factory method to asynchronously create an outgoing video feed in a media server session.
Factory method to asynchronously create an outgoing video feed in a media server session, with an additional local video output target.
-
struct FeedProperties : public Proximie::PxMedia::FeedBase::FeedBaseProperties
- #include <PxMedia/MediaServerOutgoingVideoFeed.h>
Properties that apply to the whole feed.
Public Functions
-
inline explicit FeedProperties(string_view label = {}, StreamIndexHint indexHint = 0)
Constructor to feed properties with label etc.
Public Members
-
StreamIndexHint indexHint = 0
Index hint for the stream.
-
inline explicit FeedProperties(string_view label = {}, StreamIndexHint indexHint = 0)
-
void applyAdaptiveQuality(AdaptiveQuality quality)
-
class MediaServerSession : public std::enable_shared_from_this<MediaServerSession>
- #include <PxMedia/MediaServerSession.h>
Manages audio and video connections to media servers.
Maintains audio and video media connections to session media server. Local devices can be shared with other session participants, and their streams are made available to the host application using the session object.
For more details see Media Server Session in the SDK documentation.
Aliases
-
using ConnectionState = PxMedia::ConnectionState
Connection state.
-
using ServiceRequestFields = PxRestApi::ProximieServices::RequestFields
Service request fields.
Session recording service
-
using OnRecordingStateEvent = EventWithArgs<SessionRecordingState>
Signature for events with recording state.
-
SessionRecordingState sessionRecordingState() const
Obtain the current recording state for the session.
-
outcome::result<void> requestSessionRecording(bool recordingOn)
Request a change in the recording state for the session.
The change is requested asynchronously, and the application is notified using the onRecordingStateChanged event
-
void onRecordingStateChanged(const OnRecordingStateEvent &func)
Notifies when the session recording state has changed.
Session services
-
void onSessionServicesConnected(const OnSessionEvent &func)
Notifies when session services have connected and are available.
-
bool areSessionServicesConnected() const
Check if session services are currently connected.
-
void onSessionServicesDisconnected(const OnErrorEvent &func)
Notifies when the session services disconnected When gracefully disconnected the error code will indicate success, otherwise in case of an error condition the error code indicates the reason.
Public Types
-
template<typename ...ARGS>
using EventWithArgs = std::function<void(const shared_not_null<MediaServerSession>&, ARGS...)> General type for events with arguments.
-
using OnSessionEvent = EventWithArgs<>
Signature for event with just the session.
-
using OnErrorEvent = EventWithArgs<error_code>
Signature for events with error.
-
using OnFeedIdEvent = EventWithArgs<string_view>
Signature for events with feed-id.
-
using OnFeedIdWithErrorEvent = EventWithArgs<string_view, error_code>
Signature for events with feed-id and error.
-
using OnNewRemoteFeedEvent = EventWithArgs<const shared_not_null<FeedMetadata>&>
Signature for events with feed metadata.
Public Functions
-
ConnectionState state() const
Connectivity state of the session.
-
inline FutureOutcome<void> connectToSession(string_view sessionId, const PxCore::RemoteEnvironment &env, const ServiceRequestFields &serviceSettings)
Start to connect to a given session.
Returns a future that resolves to the outcome of the connection attempt.
The caller can use the future returned to wait for the connection to complete. Also the MediaServerSession::onSessionConnected callback is always called (i.e. immediately or later), with the error in case of an error.
-
FutureOutcome<void> connectToSession(RequestedSession session)
Start to connect to a given session.
Returns a future that resolves to the outcome of the connection attempt.
The caller can use the future returned to wait for the connection to complete. Also the MediaServerSession::onSessionConnected callback is always called (i.e. immediately or later), with the error in case of an error.
-
FutureOutcome<void> disconnectFromSession()
Disconnect from the current session.
Returns a future that resolves to the outcome of the disconnection attempt.
The caller can use the future returned to wait for the connection to complete. Also the MediaServerSession::onSessionDisconnected callback is always called (i.e. immediately or later), with the error in case of an error.
-
std::vector<std::string> listSessionFeedIds() const
Obtain a list of all feed IDs owned by the session.
-
std::vector<shared_not_null<MediaServerFeed>> listSessionFeeds() const
List all feeds currently associated with the session
-
std::shared_ptr<MediaServerFeed> getFeed(string_view feedId) const
Obtain a feed from its ID.
- Returns:
A shared pointer to the feed, or nullptr if not found
-
void audioEncoder(const AudioWebRtcEncodeFeedComponent &encoder)
Set the default audio encoder for newly created feeds.
-
void videoEncoder(const VideoWebRtcEncodeFeedComponent &encoder)
Set the default video encoder for newly created feeds.
-
void onSessionConnected(const OnErrorEvent &func)
Notifies when a session has connected, either with an error or successfully.
-
void onSessionError(const OnErrorEvent &func)
Notify when the is an error with the media session after connection.
-
void onNewRemoteFeed(const OnNewRemoteFeedEvent &func)
Notify that a new remote feed is available from the media server.
-
void onRemoteFeedRemoved(const OnFeedIdEvent &func)
Notify that a remote feed is no longer available.
-
void onFeedStarted(const OnFeedIdEvent &func)
Notify that a feed has successfully started.
-
void onFeedStopped(const OnFeedIdWithErrorEvent &func)
Notify that a feed has stopped, which may be intentionally or in error.
-
void onSessionDisconnected(const OnErrorEvent &func)
Notifies when a session has disconnected, either in error or by request.
Public Static Functions
Create a new MediaServerSession into a shared pointer.
A MediaServerSession is required to be owned as a smart pointer to permit asynchronous requests and operations.
For more details, see Creating a MediaServerSession instance.
-
struct FeedMetadata
- #include <PxMedia/MediaServerSession.h>
Metadata for a given feed.
Public Functions
-
inline FeedMetadata(string_view withId, MediaSessionFeedType::Enum withType, string_view withLabel)
Construct with the required metadata.
Public Members
-
std::string feedId
Feed ID for the feed.
-
MediaSessionFeedType::Enum feedType = MediaSessionFeedType::Enum::None
Feed type for informational purposes.
-
boost::optional<std::string> label
Human readable label, if present.
-
inline FeedMetadata(string_view withId, MediaSessionFeedType::Enum withType, string_view withLabel)
-
struct RequestedSession
- #include <PxMedia/MediaServerSession.h>
Details required to request a media server session in single struct.
Public Members
-
const std::string sessionId
Session ID.
-
const PxCore::RemoteEnvironment remoteEnv
Remote environment.
-
const PxRestApi::ProximieServices::RequestFields requestFields
Request fields.
-
const std::string sessionId
-
struct SessionRecordingState
- #include <PxMedia/MediaServerSession.h>
Recording state for the session.
The recording state is set asynchronously, and so comprises both the current value and whether an update is pending. When the client application requests a state change, the state ‘on’ value will be not set immediately, and the ‘updatePending’ flag will be set until the media server acknowledges the update. Once the change is acknowledged, the ‘updatePending’ flag will be cleared.
Public Functions
-
std::chrono::milliseconds totalRunningDurationMs() const
Helper to calculate the total running duration of the recording so far.
Public Members
-
bool on = false
The current confirmed recording state; true indicating recording is currently active.
-
bool updatePending = false
If an update is pending (e.g. a recording request has been made but not yet resolved.
-
std::chrono::milliseconds totalSegmentDurationMs = {0}
Recordings may be started and stopped during the session, creating discrete segments. This value is the total duration of all the segments recorded so far (if any)
-
boost::optional<std::chrono::milliseconds> statusUpdated
The timestamp indicating when the status was changed, after recording has been started. This timestamp is relative to the Unix epoch (Jan 1, 1970 UTC) Note, there is no timestamp initially as recording is off at the start of the session.
-
std::chrono::milliseconds totalRunningDurationMs() const
-
using ConnectionState = PxMedia::ConnectionState
-
class MediaServerTwoWayAudioFeed : public Proximie::PxMedia::MediaServerFeed
- #include <PxMedia/MediaServerTwoWayAudioFeed.h>
A class which manages a two-way audio feed in a media server session.
Public Types
-
using FeedProperties = MediaServerFeedProperties
Properties that apply to the whole feed.
Public Static Functions
Factory method to create a two-way audio feed associated with a media server session.
Factory method to asynchronously create a two-way audio feed associated with a media server session.
-
using FeedProperties = MediaServerFeedProperties
-
class PeerFeed : public Proximie::PxMedia::FeedBase
- #include <PxMedia/PeerFeed.h>
Base class for all peer session feeds.
Subclassed by Proximie::PxMedia::PeerLocalAudioFeed, Proximie::PxMedia::PeerLocalVideoFeed, Proximie::PxMedia::PeerRemoteAudioFeed, Proximie::PxMedia::PeerRemoteVideoFeed
Public Functions
-
inline IPeerFeedFeature &peerFeed()
Supports the peer feed feature
-
inline const IPeerFeedFeature &peerFeed() const
Supports the peer feed feature
-
inline IPeerFeedFeature &peerFeed()
-
class PeerLocalAudioFeed : public Proximie::PxMedia::PeerFeed
- #include <PxMedia/PeerLocalAudioFeed.h>
A peer feed that sends local Audio to the remote peer.
Public Static Functions
Factory method to create an outgoing feed associated with a peer session.
Factory method to create an outgoing feed associated with a peer session, which also outputs locally.
-
class PeerLocalVideoFeed : public Proximie::PxMedia::PeerFeed
- #include <PxMedia/PeerLocalVideoFeed.h>
A peer feed that sends local video to the remote peer.
Public Static Functions
Factory method to create an outgoing feed associated with a peer session.
Factory method to create an outgoing feed associated with a peer session, which also outputs locally.
-
class PeerRemoteAudioFeed : public Proximie::PxMedia::PeerFeed
- #include <PxMedia/PeerRemoteAudioFeed.h>
A peer feed that receives Audio from the remote peer.
Public Static Functions
Factory method to create an incoming feed associated with a peer session.
-
class PeerRemoteVideoFeed : public Proximie::PxMedia::PeerFeed
- #include <PxMedia/PeerRemoteVideoFeed.h>
A peer feed that receives video from the remote peer.
Public Static Functions
Factory method to create an incoming feed associated with a peer session.
-
class PeerSession
- #include <PxMedia/PeerSession.h>
A peer session represents a connection between two peers.
For more details see Peer Streaming in the SDK documentation.
Public Functions
-
std::vector<std::string> listSessionFeedIds() const
List all feeds currently associated with the session
-
std::vector<shared_not_null<PeerFeed>> listSessionFeeds() const
List all feeds currently associated with the session
-
shared_not_null<AVOutputFeedFile> createRecordingFeed(const std::string &videoFeedId, const std::vector<std::string> &audioFeedIds, const AVOutputFeedFile::AVOutputFeedFileSettings &settings)
Add a feed that will record a video feed to local storage.
The new feed will record a video feed and (optionally) audio feed(s) to files on local storage. Supplied audio feeds will be mixed to a single audio track in the resulting files.
- Parameters:
videoFeedId – The ID of the video feed to record
audioFeedIds – The IDs of the audio feeds to mix into the recording
settings – The settings for the recording feed, such as file path, max size, and max duration
-
shared_not_null<AVOutputFeedFile> createRecordingFeed(const std::string &videoFeedId, const std::vector<std::vector<std::string>> &audioTrackFeedIds, const AVOutputFeedFile::AVOutputFeedFileSettings &settings)
Add a feed that will record a video feed to local storage.
The new feed will record a video feed and (optionally) audio feed(s) to files on local storage.
- Parameters:
videoFeedId – The ID of the video feed to record
audioTrackFeedIds – The IDs of audio feeds to mix into audio tracks in the recording. Each sub-vector represents a track, and contains the IDs of audio feeds to mix into that track. If a sub-vector contains only one audio feed ID, that feed will be used as-is for that track without mixing.
settings – The settings for the recording feed, such as file path, max size, and max duration
Public Static Functions
Factory method to create a new peer session
-
struct PeerChannel
- #include <PxMedia/PeerSession.h>
Details needed to declare a channel sent by the peer
Public Members
-
std::string label
Human-readable name/label.
-
PxUtility::NetworkPort_t port = PxUtility::DEFAULT_UDP_PORT
The port to use.
-
std::string label
-
struct PeerDetails
- #include <PxMedia/PeerSession.h>
The details of a peer connection and it’s “channels”
Public Members
-
std::string label
Human-readable name/label.
-
KeyMap<PeerChannel> channels
The channels that the peer has declared. This is a map of unique channel key to channel details
-
std::string label
-
struct PeerHost
- #include <PxMedia/PeerSession.h>
Details needed to locate a peer host
Public Members
-
std::string hostname
The host name or IP address.
-
std::string hostname
-
struct PeerSessionSettings
- #include <PxMedia/PeerSession.h>
Settings and parameters for a session between peers
Public Functions
-
inline PeerSessionSettings(PeerDetails local, PeerDetails remote, string_view key)
Create session settings with local and remote peer details.
Note that the encryption key needs to be encoded as follows:
Only containing hexadecimal characters (not case sensitive)
Exactly 60 characters long (i.e. representing 30 bytes)
Public Members
-
std::string encryptionKey
The key used for encryption.
-
PeerDetails local
The local peer details.
-
PeerDetails remote
The remote peer details.
-
inline PeerSessionSettings(PeerDetails local, PeerDetails remote, string_view key)
-
std::vector<std::string> listSessionFeedIds() const
-
class PeerSrtpDecryptFeedComponent : public Proximie::PxMedia::FeedComponent<PeerSrtpDecryptFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Class for SRTP-based peer feed decryption components.
-
class PeerSrtpEncryptFeedComponent : public Proximie::PxMedia::FeedComponent<PeerSrtpEncryptFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Class for SRTP-based peer feed encryption components.
-
class PeerUdpSinkFeedComponent : public Proximie::PxMedia::FeedComponent<PeerUdpSinkFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Class for Peer feed Udp Sink component.
-
class PeerUdpSourceFeedComponent : public Proximie::PxMedia::FeedComponent<PeerUdpSourceFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Class for Peer feed Udp Source component.
-
class PxMediaErrorCategory : public boost::system::error_category
- #include <PxMedia/PxMediaErrorCode.h>
Error category for PxMediaErrorCode.
Error category
Implements the
error_categoryinterface-
const char *name() const noexcept override
Returns the error category name as a string
-
std::string message(int code) const override
Returns the message for the provided error code
Public Types
-
using ErrorCodeEnum = PxMediaErrorCode
Alias for the enum type used
Public Static Functions
-
static const PxMediaErrorCategory &category()
Returns the category instance for the PxMediaErrorCategory
-
static const char *messageFromErrorCode(ErrorCodeEnum code)
Helper to translate an error code into a message string
-
const char *name() const noexcept override
-
struct SrtFeedStats
- #include <PxMedia/SrtFeedStats.h>
A structure representing SRT feed statistics.
Public Members
-
std::shared_ptr<const json_object> json
Stats in plain JSON form.
-
std::shared_ptr<const SrtSenderStats> senderStats
Parsed sender stats, if any.
-
std::shared_ptr<const SrtReceiverStats> receiverStats
Parsed receiver stats, if any.
Public Static Functions
-
static outcome::result<SrtFeedStats> create(const GstStructure &statsStructure)
Create a parsed stats object from a base SRT GST structure
-
struct SrtReceiverStats
- #include <PxMedia/SrtFeedStats.h>
SRT receiver stats.
Public Functions
-
bool checkReadObjectFromJson(const json_object &source)
Read from a GST structure for SRT stats Due to a slightly unconventional layout of the SRT stats, we cannot read simply with the SDK JsonSerializer
Public Members
-
boost::optional<SrtReceiverStatsDetail> detail
Detailed stats.
-
uint64_t bytesReceivedTotal = 0
Total bytes received.
-
bool checkReadObjectFromJson(const json_object &source)
-
struct SrtReceiverStatsDetail
- #include <PxMedia/SrtFeedStats.h>
SRT receiver stats detail.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t packetsReceived = 0
Number of received data packets.
-
int64_t packetsReceivedLost = 0
Number of lost received data packets.
-
int64_t packetAckSent = 0
number of sent ACK packets
-
int64_t packetNackSent = 0
number of sent NAK packets
-
uint64_t bytesReceived = 0
Number of received data bytes.
-
uint64_t bytesReceivedLost = 0
Number of lost received data bytes.
-
double receiveRateMbps = 0.0
Receiving rate in Mb/s.
-
int64_t negotiatedLatencyMs = 0
Negotiated latency in ms.
-
double bandwidthMbps = 0.0
Estimated bandwidth, in Mb/s.
-
double rttMs = 0.0
Round-trip time in ms.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct SrtSenderCallerStats
- #include <PxMedia/SrtFeedStats.h>
SRT sender caller stats.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t packetsSent = 0
Number of sent data packets, incl. retransmissions.
-
int64_t packetsSentLost = 0
Number of lost packets (sender side)
-
int64_t packetsRetransmitted = 0
Number of retransmitted packets.
-
int64_t packetAckReceived = 0
Number of received ACK packets.
-
int64_t packetNackReceived = 0
Number of received NAK packets.
-
int64_t packetsSentDropped = 0
Number of too-late-to-send dropped packets.
-
uint64_t bytesSent = 0
Number of sent data bytes, including retransmissions.
-
uint64_t bytesRetransmitted = 0
Number of retransmitted bytes.
-
uint64_t bytesSentDropped = 0
Number of too-late-to-send dropped bytes.
-
double sendRateMbps = 0.0
Sending rate in Mb/s.
-
uint64_t sendDurationUs = 0
Busy sending time (idle time exclusive) in μs.
-
int64_t negotiatedLatencyMs = 0
Negotiated latency in ms.
-
double bandwidthMbps = 0.0
Estimated bandwidth, in Mb/s.
-
double rttMs = 0.0
Round-trip time in ms.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct SrtSenderStats
- #include <PxMedia/SrtFeedStats.h>
SRT sender stats.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
boost::optional<std::vector<SrtSenderCallerStats>> callers
Caller stats.
-
uint64_t bytesSentTotal = 0
Total bytes sent.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
std::shared_ptr<const json_object> json
-
class SrtFeedStatsRequest : public Proximie::PxMedia::FeedRequest
- #include <PxMedia/SrtFeedStats.h>
A feed request to obtain SRT feed statistics.
Public Types
-
using StatsOutcome = outcome::result<SrtFeedStats>
Type alias for stats outcome.
-
using StatsCallback = std::function<void(const StatsOutcome &stats)>
Type alias for stats callback.
Public Functions
-
inline explicit SrtFeedStatsRequest(StatsCallback callback)
Request constructor.
-
inline const StatsCallback &callback() const
The callback to receive the stats.
-
using StatsOutcome = outcome::result<SrtFeedStats>
-
class UtilityAudioLocalFeed : public Proximie::PxMedia::FeedBase
- #include <PxMedia/UtilityAudioLocalFeed.h>
A simple utility audio feed.
Utility feeds are pipelines which don’t have a remote element, and are not associated with or managed by a session. If it is given multiple inputs they will be mixed together.
Public Types
-
using FeedProperties = FeedBase::FeedBaseProperties
Properties that apply to the whole feed.
-
using AudioInputFeedComponents = std::vector<std::reference_wrapper<const AudioInputFeedComponent>>
A sequence of audio input feed components, as a vector of const references.
Public Functions
-
outcome::result<std::string> addInput(const AudioInputFeedComponent &input)
Add an audio input feed component to the feed. Returns a generated uuid for it The input will be removed when the feed is stopped or removeInput called with the uuid
-
error_code removeInput(const std::string &uuid)
Remove a audio input from the feed given its uuid.
Public Static Functions
Factory method to create a utility feed that takes one or more audio inputs and mixes them together before sending onwards to some audio output.
Factory method to create a utility feed that takes a audio input and sends onward to some audio output.
-
using FeedProperties = FeedBase::FeedBaseProperties
-
class UtilityVideoLocalFeed : public Proximie::PxMedia::FeedBase
- #include <PxMedia/UtilityVideoLocalFeed.h>
A simple utility video feed.
Utility feeds are pipelines which don’t have a remote element, and are not associated with or managed by a session.
Public Types
-
using FeedProperties = FeedBase::FeedBaseProperties
Properties that apply to the whole feed.
Public Static Functions
Factory method to create a utility feed that takes a video input and sends onward to some video output.
-
using FeedProperties = FeedBase::FeedBaseProperties
-
class VideoCapabilities
- #include <PxMedia/VideoCapabilities.h>
Provide capability settings that are common to all video media types.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline VideoCapabilities &mediaType(MediaType set)
Set media type.
-
inline VideoSizePixels height() const
Get video height in pixels.
-
inline VideoCapabilities &height(VideoSizePixels set)
Set video height in pixels.
-
inline VideoSizePixels width() const
Get video width in pixels.
-
inline VideoCapabilities &width(VideoSizePixels set)
Set video width in pixels.
-
inline const VideoResolution &resolution() const
Get video resolution.
-
inline VideoCapabilities &resolution(const VideoResolution &set)
Set video resolution.
-
inline AdaptiveRulePtr<VideoResolution> adaptiveResolution() const
Get the adaptive resolution rule.
-
inline VideoCapabilities &adaptiveResolution(const AdaptiveRulePtr<VideoResolution> &set)
Set the adaptive resolution rule.
-
inline VideoCapabilities &frameRate(FrameRate set)
Set frame rate.
-
inline AdaptiveRulePtr<FrameRate> adaptiveFrameRate() const
Get the adaptive frame rate rule.
-
inline VideoCapabilities &adaptiveFrameRate(const AdaptiveRulePtr<FrameRate> &set)
Set the adaptive frame rate rule.
Public Types
-
using VideoSizePixels = uint32_t
Video height/width, in pixels.
-
using VideoResolution = PxUtility::Size<VideoSizePixels>
Video resolution in pixels.
-
template<typename T>
using AdaptiveRulePtr = std::shared_ptr<AdaptiveRule<T>> Adaptive rule references.
-
using MediaType = VideoMediaFormat::MediaType
The underlying media type of a video feed.
-
inline VideoCapabilities &mediaType(MediaType set)
-
class VideoFeedStageComponent : public Proximie::PxMedia::FeedComponent<VideoFeedStageComponentProvider>
- #include <PxMedia/VideoFeedStage.h>
Base class for video feed stage components.
Subclassed by Proximie::PxMedia::VideoStageCrop, Proximie::PxMedia::VideoStageFrameRate, Proximie::PxMedia::VideoStagePrivacy, Proximie::PxMedia::VideoStageResize, Proximie::PxMedia::VideoStageRotateFlip, Proximie::PxMedia::VideoStageTextOverlay, Proximie::PxMedia::experimental::VideoStageFaceBlur, Proximie::PxMedia::experimental::VideoStageGaussianBlur
-
class VideoFeedStageSequence
- #include <PxMedia/VideoFeedStage.h>
A sequence of video feed stage components.
Public Types
-
using ComponentSequence = std::vector<std::reference_wrapper<const VideoFeedStageComponent>>
A sequence of feed stage component references to set a sequence.
Public Functions
-
inline void sequence(const ComponentSequence &components)
Set the sequence of feed stages with a sequence of components.
-
using ComponentSequence = std::vector<std::reference_wrapper<const VideoFeedStageComponent>>
-
class VideoFormattedInputFeedComponent : public Proximie::PxMedia::VideoInputFeedComponent
- #include <PxMedia/feed-components-video.h>
Base class for video formatted input feed components.
Subclassed by Proximie::PxMedia::VideoInputFeedFile, Proximie::PxMedia::VideoInputFeedInter, Proximie::PxMedia::VideoInputFeedTestPattern, Proximie::PxMedia::VideoInputFeedV4Linux2, Proximie::PxMedia::VideoInputFeedXImage, Proximie::PxMedia::experimental::VideoInputFeedPipewire
Public Functions
-
inline VideoCapabilities &videoCapabilities()
Obtain video capabilities object, which can be used to set video capabilities settings for the component.
-
inline const VideoCapabilities &videoCapabilities() const
Read-only access to the video capabilities.
-
inline VideoCapabilities &videoCapabilities()
-
class VideoInputFeedComponent : public Proximie::PxMedia::FeedComponent<VideoInputFeedComponentProvider>
- #include <PxMedia/feed-components-video.h>
Base class for video input feed components.
Subclassed by Proximie::PxMedia::VideoFormattedInputFeedComponent, Proximie::PxMedia::VideoInputFeedUdp
Public Functions
-
inline VideoInputProperties &videoInputProperties()
Obtain the general video input properties, which can be used to change settings.
-
inline const VideoInputProperties &videoInputProperties() const
Read-only access to the video input properties.
-
inline VideoFeedStageSequence &videoStages()
Obtain the video feed stage sequence object, which can be used to set additional video processing stages for the component.
-
inline const VideoFeedStageSequence &videoStages() const
Read-only access to the video feed stage sequence.
-
class VideoInputProperties
- #include <PxMedia/feed-components-video.h>
Properties for video inputs.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline bool doTimestamp() const
Get the timestamping setting.
-
inline VideoInputProperties &doTimestamp(bool set)
Set the timestamping setting.
-
inline bool doTimestamp() const
-
inline VideoInputProperties &videoInputProperties()
-
class VideoInputFeedFile : public Proximie::PxMedia::VideoFormattedInputFeedComponent
- #include <PxMedia/VideoInputFeedFile.h>
A video input feed component that reads a video or image file as the video feed.
This component can be used to use test video without a physical device.
File resolutions
Note that if using
X264EncoderFeedComponentto encode the resulting feed, both the width and height of the input image or video file’s resolution must be integer divisible by two.Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
To set video feed sub-properties, use the VideoInputFeedFile::videoCapabilities accessor function.
-
VideoInputFeedFile &filename(string_view set)
Set the filename
-
VideoInputFeedFile &baseFormat(VideoMediaFormat::BaseMedia set)
Set the base format
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
struct Properties
- #include <PxMedia/VideoInputFeedFile.h>
The properties required to specify the video input device and its settings.
File settings
These settings describe the file and its content.
-
std::string filename
Filename.
-
VideoMediaFormat::BaseMedia baseFormat = VideoMediaFormat::BaseMedia::IMAGE
Format of the file contents.
-
std::string filename
-
VideoInputFeedFile &filename(string_view set)
-
class VideoInputFeedInter : public Proximie::PxMedia::VideoFormattedInputFeedComponent
- #include <PxMedia/VideoInputFeedInter.h>
A video input feed component that accepts video from a named inter channel.
Instances must be obtained via
VideoOutputFeedInter::makeInput()before the associated output is passed to a feedcreate()call.Each instance represents exclusive ownership of a consumer slot and can only be used in a single feed. Because
intervideosrcuses a last-frame model, multiple independent VideoInputFeedInter instances (each obtained via a separate makeInput() call) may consume the same output simultaneously without corrupting the stream.Accessors
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
-
inline bool isConsumed() const
Returns true if this input has already been consumed by a feed.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
~VideoInputFeedInter() override = default
Destructor.
-
VideoInputFeedInter(VideoInputFeedInter&&) = default
Move constructor — transfers ownership of the consumer slot.
-
VideoInputFeedInter &operator=(VideoInputFeedInter&&) = default
Move assignment — transfers ownership of the consumer slot.
-
inline const Properties &properties() const
-
class VideoInputFeedTestPattern : public Proximie::PxMedia::VideoFormattedInputFeedComponent
- #include <PxMedia/VideoInputFeedTestPattern.h>
A video input feed component that sends a “test card” pattern as the video feed.
This component can be used to use test video without a physical device.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
To set video feed sub-properties, use the VideoInputFeedTestPattern::videoCapabilities accessor function.
-
inline VideoInputFeedTestPattern &animationMode(AnimationMode set)
Set the animation mode; see VideoInputFeedTestPattern::AnimationMode
-
inline VideoInputFeedTestPattern &pattern(Pattern set)
Set the pattern type; see VideoInputFeedTestPattern::Pattern
-
inline VideoInputFeedTestPattern &flip(bool set)
Set flip; for pattern=ball, invert colors every second.
-
inline VideoInputFeedTestPattern &horizontalSpeed(int set)
Set horizontal scroll speed in pixels per frame. Positive values scroll to the left.
-
inline VideoInputFeedTestPattern &motion(MotionType set)
Set motion type; see VideoInputFeedTestPattern::MotionType
-
inline VideoInputFeedTestPattern ×tampOffset(int64_t set)
Set timestamp offset; An offset added to timestamps set on buffers (in ns)
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Types
-
enum class AnimationMode
For pattern=ball, which counter defines the position of the ball.
Values:
-
enumerator Frames
Frame count.
-
enumerator WallTime
Wall clock time.
-
enumerator RunningTime
Running time.
-
enumerator Frames
-
enum class Pattern
Pattern type for videotestsrc.
Values:
-
enumerator SMPTE
SMPTE 100% color bars.
-
enumerator Snow
Random (television snow)
-
enumerator Black
100% Black
-
enumerator White
100% White
-
enumerator Red
Red.
-
enumerator Green
Green.
-
enumerator Blue
Blue.
-
enumerator Checkers1
Checkers 1px.
-
enumerator Checkers2
Checkers 2px.
-
enumerator Checkers4
Checkers 4px.
-
enumerator Checkers8
Checkers 8px.
-
enumerator Circular
Circular pattern.
-
enumerator Blink
Blink (alternates black/white)
-
enumerator SMPTE75
SMPTE 75% color bars.
-
enumerator ZonePlate
Zone plate (tests spatial frequency response)
-
enumerator Gamut
Gamut (checkerboard of in/out-of-gamut colors)
-
enumerator ChromaZonePlate
Chroma zone plate.
-
enumerator SolidColor
Solid color (uses foreground/background color)
-
enumerator Ball
Ball (bouncing ball animation)
-
enumerator SMPTE100
SMPTE 100% color bars.
-
enumerator Bar
Bar (vertical color bars)
-
enumerator Pinwheel
Pinwheel (rotating color wheel)
-
enumerator Spokes
Spokes.
-
enumerator Gradient
Gradient.
-
enumerator Colors
Colors.
-
enumerator SMPTERP219
SMPTE test pattern, RP 219 conformant.
-
enumerator SMPTE
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
Public Static Functions
-
static const PxUtility::EnumMapper<AnimationMode> &animationModeMapper()
Map between AnimationMode and string.
-
static const PxUtility::EnumMapper<Pattern> &patternMapper()
Map between Pattern and string.
-
static const PxUtility::EnumMapper<MotionType> &motionMapper()
Map between MotionType and string.
-
struct Properties
- #include <PxMedia/VideoInputFeedTestPattern.h>
The properties required to specify the video input device and its settings.
Test pattern video input properties
These settings describe the file and its content.
Animation mode
-
boost::optional<AnimationMode> animationMode
For pattern=ball, which counter defines the position of the ball.
-
boost::optional<bool> flip
For pattern=ball, invert colors every second.
-
boost::optional<int> horizontalSpeed
Horizontal scroll speed in pixels per frame. Positive values scroll to the left.
-
boost::optional<MotionType> motion
For pattern=ball, what motion the ball does.
-
boost::optional<int64_t> timestampOffset
Timestamp offset.
-
boost::optional<AnimationMode> animationMode
-
inline VideoInputFeedTestPattern &animationMode(AnimationMode set)
-
class VideoInputFeedUdp : public Proximie::PxMedia::VideoInputFeedComponent
- #include <PxMedia/VideoInputFeedUdp.h>
A video input feed using a UDP source.
This feed component provides properties to specify how the feed obtains H264 encoded video using RTP from a given UDP port.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline UdpSourceProperties &udpProperties()
Access the UDP source properties.
-
inline const UdpSourceProperties &udpProperties() const
Access the UDP source properties as const.
-
inline RtpProperties &rtpProperties()
Access the RTP properties.
-
inline const RtpProperties &rtpProperties() const
Access the RTP properties as const.
-
class RtpProperties
- #include <PxMedia/VideoInputFeedUdp.h>
RTP properties.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline uint32_t clockRate() const
Get the clock rate.
-
inline RtpProperties &clockRate(uint32_t set)
Set the clock rate.
-
inline uint32_t clockRate() const
-
class UdpSourceProperties
- #include <PxMedia/VideoInputFeedUdp.h>
UDP source properties.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
By default, the UDP host is set to
"localhost"and the port is set to the default 5004.-
inline const std::string &host() const
Get UDP host, where empty indicates using
"localhost"
-
inline UdpSourceProperties &host(const std::string &set)
Set UDP host - if empty, uses the value
"localhost"
-
inline UdpSourceProperties &localhost()
Sets the UDP host as localhost.
-
inline PxUtility::NetworkPort_t port() const
Get the UDP port.
-
inline UdpSourceProperties &port(PxUtility::NetworkPort_t set)
Set the UDP port.
-
inline uint32_t mtu() const
Get the maximum expected packet size (mtu), zero for default.
-
inline UdpSourceProperties &mtu(uint32_t set)
Set the maximum expected packet size (mtu), zero for default.
-
inline UdpSourceProperties &defaultMtu()
Set the maximum expected packet size (mtu) to the default.
-
inline std::chrono::milliseconds timeout() const
Get the timeout (ms) for the UDP source, where zero is disabled.
-
inline UdpSourceProperties &timeout(std::chrono::milliseconds set)
set the timeout (ms) for the UDP source, where zero is disabled
-
inline UdpSourceProperties &noTimeout()
Disable the timeout for the UDP source.
-
inline const std::string &host() const
-
virtual shared_not_null<Provider> makeProvider() const override
-
class VideoInputFeedV4Linux2 : public Proximie::PxMedia::VideoFormattedInputFeedComponent
- #include <PxMedia/VideoInputFeedV4Linux2.h>
A video input feed component using a Video4Linux2 device.
This feed component provides properties to specify which actual device to use, and the VideoCapabilities (such as resolution and frame rate).
Public Types
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline DeviceProperties &deviceProperties()
Returns the device properties for selecting the device to use.
-
inline const DeviceProperties &deviceProperties() const
Read-only access to the device properties.
Public Static Functions
-
static const PxUtility::EnumMapper<IOMode> &ioModeMapper()
Map between IOMode and string.
-
class DeviceProperties
- #include <PxMedia/VideoInputFeedV4Linux2.h>
Device properties.
The device can be specified in various ways, including path/location, file descriptor and by name. The caller should choose one value to set to specify the device.
If no device is specified, the default is to use device
/dev/video0.Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline const std::string &device() const
Get the device location.
-
inline DeviceProperties &device(string_view set)
Set the device location e.g.
"/dev/video0"
-
inline int deviceFd() const
Get the device file descriptor.
-
inline DeviceProperties &deviceFd(int set)
Set the device file descriptor.
-
inline const std::string &deviceName() const
Get the device name.
-
inline DeviceProperties &deviceName(string_view set)
Set the device name.
-
inline DeviceProperties &ioMode(IOMode set)
Set the IO mode.
-
inline DeviceProperties &defaultIOMode()
Set the default IO mode.
-
inline const std::string &device() const
-
virtual shared_not_null<Provider> makeProvider() const override
-
class VideoInputFeedXImage : public Proximie::PxMedia::VideoFormattedInputFeedComponent
- #include <PxMedia/VideoInputFeedXImage.h>
A video input feed component capturing an X desktop or window.
This feed component provides properties to specify which X display or window to capture, and the VideoCapabilities (such as resolution and frame rate).
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
To set video feed sub-properties, use the VideoInputFeedXImage::videoCapabilities accessor function.
-
VideoInputFeedXImage &displayName(string_view set)
Set the display name
-
VideoInputFeedXImage &xid(int64_t set)
Set the XID of the window to capture
-
VideoInputFeedXImage &xname(string_view set)
Set the name of the window to capture
-
VideoInputFeedXImage &captureArea(const PxUtility::Rectangle<int> &set)
Set the capture area pixel coordinates
-
VideoInputFeedXImage &startx(int set)
Set the top-left X coordinate of area to capture
-
VideoInputFeedXImage &starty(int set)
Set the top-left Y coordinate of area to capture
-
VideoInputFeedXImage &endx(int set)
Set the bottom-right X coordinate of area to capture
-
VideoInputFeedXImage &endy(int set)
Set the bottom-right Y coordinate of area to capture
-
VideoInputFeedXImage &useDamage(bool set)
Set whether to use XDamage to only capture changed regions
-
VideoInputFeedXImage &showPointer(bool set)
Set whether to show mouse pointer
-
VideoInputFeedXImage &remote(bool set)
Set whether the X display is remote
Set whether to enable navigation events
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
struct Properties
- #include <PxMedia/VideoInputFeedXImage.h>
The properties required to specify the video input device and its settings.
X Desktop capture settings
These settings determine how the X Desktop or window is captured.
Enable navigation events.
-
bool remote = false
Whether the X display is remote.
-
bool showPointer = true
Show mouse pointer (requires XFixes extension)
-
bool useDamage = true
Use XDamage to only capture changed regions (requires XDamage extension)
-
PxUtility::Rectangle<int> captureArea
The area to capture, as a rectangle of integer pixel coordinates.
-
int64_t xid = 0
The XID of the window to capture. 0 means the root window.
-
std::string displayName
X Display name.
-
std::string xname
The name of the window to capture, if any.
-
VideoInputFeedXImage &displayName(string_view set)
-
class VideoOutputComponentNull : public Proximie::PxMedia::VideoOutputFeedComponent
- #include <PxMedia/VideoOutputComponentNull.h>
A placeholder video output feed component that does not actually output video.
This feed component can be used to disable local video output from a feed.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class VideoOutputFeedAuto : public Proximie::PxMedia::VideoOutputFeedComponent
- #include <PxMedia/VideoOutputFeedAuto.h>
A video output component that chooses an appropriate output to use.
This feed component can be used to simply add a suitable video output; in practice, this will open a new window to stream video to. This can be useful to test video feeds, but real world applications will typically want to control and manage video output windows using other output components.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
virtual shared_not_null<Provider> makeProvider() const override
-
class VideoOutputFeedComponent : public Proximie::PxMedia::FeedComponent<VideoOutputFeedComponentProvider>
- #include <PxMedia/feed-components-video.h>
Base class for video output feed components.
Subclassed by Proximie::PxMedia::VideoOutputComponentNull, Proximie::PxMedia::VideoOutputFeedAuto, Proximie::PxMedia::VideoOutputFeedInter, Proximie::PxMedia::VideoOutputFeedUdp, Proximie::PxMedia::VideoOutputFeedV4Linux2
-
class VideoOutputFeedInter : public Proximie::PxMedia::VideoOutputFeedComponent
- #include <PxMedia/VideoOutputFeedInter.h>
A video output component that outputs video to a named inter channel.
This feed component allows (multiple) uses of the video stream in other pipelines, via VideoInputFeedInter.
Accessors
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Note
The channel name is auto-generated at construction time.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
VideoOutputFeedInter()
Default constructor — generates a unique internal channel identifier.
-
explicit VideoOutputFeedInter(string_view label)
Constructor with optional debug label.
The internal channel name will be “<label>-<uuid>”, which appears in GStreamer debug output for easier identification.
- Parameters:
label – A short human-readable prefix for the generated channel name.
-
VideoInputFeedInter makeInput() const
Create an input feed that consumes from this output.
Because
intervideosrcuses a last-frame model each consumer reads independently, so all inputs share the same channel name.All calls to makeInput() must be made before the owning pipeline is built (i.e. before the feed
create()call that receives this output).
-
inline const Properties &properties() const
-
class VideoOutputFeedUdp : public Proximie::PxMedia::VideoOutputFeedComponent
- #include <PxMedia/VideoOutputFeedUdp.h>
A video output feed component that sends video output to a given UDP port.
This feed component provides properties to specify how the feed is encoded using H264 streamed to UDP port using RTP.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
To set encoder sub-properties, use the VideoOutputFeedUdp::encoderProperties accessor function.
-
template<typename T, typename = std::enable_if_t<std::is_base_of<H264VideoEncoderComponent, T>::value>>
inline VideoOutputFeedUdp &encoder(const T &enc) Set the H.264 encoder (X264, VAAPI, etc.)
Note
This replaces any previously set encoder (including the default X264 encoder)
- Parameters:
enc – The encoder to use (polymorphically copied via template copy pattern)
-
inline VideoOutputFeedUdp &configInterval(int32_t set)
Set RTP config interval
-
inline VideoOutputFeedUdp &aggregateMode(RtpAggregateMode set)
Set RTP aggregate mode
-
inline VideoOutputFeedUdp &host(string_view set)
Set UDP host
-
inline VideoOutputFeedUdp &port(PxUtility::NetworkPort_t set)
Set UDP port
Public Types
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline const H264VideoEncoderComponent &encoder() const
Get encoder (read-only access)
-
inline VideoOutputFeedUdp &defaultEncoder()
Reset encoder to default X264 encoder
-
inline X264EncoderFeedComponent &encoderProperties()
Returns X264 encoder properties object for backwards compatibility.
- Deprecated:
Use encoder() setter with encoder configuration instead
Note
For backwards compatibility only. To set a non-X264 encoder, use encoder() setter.
- Throws:
std::runtime_error – if the current encoder is not X264 (e.g., if VAAPI encoder was set)
- Returns:
Reference to X264 encoder settings
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Static Functions
-
static const PxUtility::EnumMapper<RtpAggregateMode> &rtpAggregateModeMapper()
Map between RtpAggregateMode and string.
-
static inline X264EncoderFeedComponent makeDefaultEncoder()
The default encoder this component uses is X264.
-
struct Properties
- #include <PxMedia/VideoOutputFeedUdp.h>
The properties required to specify the video output encoder and UDP settings.
RTP settings
-
int32_t configInterval
The send SPS and PPS insertion interval, in seconds.
The interval can also be set to the following special values:
0for disabled-1to send with every IDR frame
-
RtpAggregateMode aggregateMode
Bundle suitable SPS/PPS NAL units into STAP-A aggregate packets.
UDP settings
-
std::string host
Host - if empty, uses the value
"localhost"
-
PxUtility::NetworkPort_t port = PxUtility::DEFAULT_UDP_PORT
Port to use for UDP
Public Members
-
shared_not_null<H264VideoEncoderComponent> encoder
H.264 encoder for the video feed (X264 by default, supports VAAPI, etc.
Defaults to X264 encoder in constructor. Can be changed to any H264VideoEncoderComponent implementation (VAAPI, etc.) using the encoder() setter.
-
int32_t configInterval
-
template<typename T, typename = std::enable_if_t<std::is_base_of<H264VideoEncoderComponent, T>::value>>
-
class VideoOutputFeedV4Linux2 : public Proximie::PxMedia::VideoOutputFeedComponent
- #include <PxMedia/VideoOutputFeedV4Linux2.h>
A video output feed component that sends video output to a V4L2 loopback device.
This feed component provides properties to specify the V4L2 loopback device for raw video output. No encoding is performed as v4l2sink handles raw video data.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline VideoOutputFeedV4Linux2 &device(string_view set)
Set V4Linux2 device path
-
inline VideoOutputFeedV4Linux2 &defaultDevice()
Reset V4Linux2 device path to default (empty string, uses gstreamer default)
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
-
inline VideoOutputFeedV4Linux2 &device(string_view set)
-
class VideoPeerRtpDecodeFeedComponent : public Proximie::PxMedia::FeedComponent<VideoPeerRtpDecodeFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Class for video Peer decoder feed components.
-
class VideoPeerRtpEncodeFeedComponent : public Proximie::PxMedia::FeedComponent<VideoPeerRtpEncodeFeedComponentProvider>
- #include <PxMedia/feed-components-peer.h>
Class for video Peer encoder feed components.
-
class VideoStageCrop : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageCrop.h>
A processing stage that applies cropping to the video.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline const CropRectangle &cropRectangle() const
Get the crop rectangle.
-
inline VideoStageCrop &cropRectangle(const CropRectangle &cropRectangle)
Set the crop rectangle.
-
inline CropRectangle &cropRectangle()
Access the crop rectangle for modification.
Public Types
-
using CropSizePixels = uint32_t
Cropping values, in pixels.
-
using CropRectangle = PxUtility::Rectangle<CropSizePixels>
A cropping rectangle, in pixels.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline const CropRectangle &cropRectangle() const
-
class VideoStageFrameRate : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageFrameRate.h>
A processing stage that alters the video frame rate.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline VideoStageFrameRate &frameRate(FrameRate set)
Set the frame rate.
-
inline bool dropOnly() const
Get the drop-only flag (only drop frames, no duplicates are produced)
-
inline VideoStageFrameRate &dropOnly(bool set)
Set the drop-only flag (only drop frames, no duplicates are produced)
-
inline bool skipToFirst() const
Get the skip-to-first flag (don’t produce buffers before the first one we receive)
-
inline VideoStageFrameRate &skipToFirst(bool set)
Set the skip-to-first flag (don’t produce buffers before the first one we receive)
-
inline VideoStageFrameRate &frameRate(FrameRate set)
-
class VideoStagePrivacy : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStagePrivacy.h>
A video stage which allows the video to be obscured at runtime by sending a feed request. Video is obscured by setting the brightness and saturation of the video to fixed values that produce a solid black output, ensuring that no pixel data survives. Pixel data destruction is validated in unit tests, which are automatically run before every release.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline bool initialPrivacy() const
Get the initial privacy state.
-
inline VideoStagePrivacy &initialPrivacy(bool set)
Set the initial privacy state.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
class RequestPrivacy : public Proximie::PxMedia::FeedRequest
- #include <PxMedia/VideoStagePrivacy.h>
A request to set the privacy on/off that is handled by this component.
-
inline bool initialPrivacy() const
-
class VideoStageResize : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageResize.h>
A processing stage that resizes a video feed.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline VideoResolutionUnits height() const
Get video height in pixels.
-
inline VideoStageResize &height(VideoResolutionUnits set)
Set video height in pixels.
-
inline VideoResolutionUnits width() const
Get video width in pixels.
-
inline VideoStageResize &width(VideoResolutionUnits set)
Set video width in pixels.
-
inline const VideoResolution &resolution() const
Get video resolution.
-
inline VideoStageResize &resolution(const VideoResolution &set)
Set video resolution.
Public Types
-
using VideoResolution = VideoCapabilities::VideoResolution
Height & width in pixels.
-
using VideoResolutionUnits = VideoResolution::SizeType
Resolution size units.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline explicit VideoStageResize(const VideoResolution &resolution = {})
Create with a resolution.
-
inline VideoResolutionUnits height() const
-
class VideoStageRotateFlip : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageRotateFlip.h>
A processing stage that applies a rotation to or flips a video.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline VideoStageRotateFlip &method(Method set)
Set the rotation/flip method.
Public Types
-
enum class Method
Rotation/flip method.
Values:
-
enumerator None
No rotation or flip.
-
enumerator Clockwise90
Rotate 90 degrees clockwise.
-
enumerator Rotate180
Rotate 180 degrees.
-
enumerator Anticlockwise90
Rotate 90 degrees anticlockwise.
-
enumerator FlipHorizontal
Flip horizontally.
-
enumerator FlipVertical
Flip vertically.
-
enumerator FlipDiagonalUL
Flip diagonally upper-left to lower-right.
-
enumerator FlipDiagonalUR
Flip diagonally upper-right to lower-left.
-
enumerator None
-
inline VideoStageRotateFlip &method(Method set)
-
class VideoStageTextOverlay : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageTextOverlay.h>
A processing stage that overlays text on a video.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline string_view text() const
Get the text to overlay.
-
inline VideoStageTextOverlay &text(string_view set)
Set the text to overlay.
-
inline bool autoResize() const
Get the autosize flag.
-
inline VideoStageTextOverlay &autoResize(bool set)
Set the autosize flag.
-
inline VideoStageTextOverlay &textColor(const TextColor &set)
Set the text color.
-
inline PxUtility::Point<PixelUnits> textOffset() const
Get the text offset in pixels.
-
inline VideoStageTextOverlay &textOffset(const PxUtility::Point<PixelUnits> &set)
Set the text offset in pixels.
-
inline VideoStageTextOverlay &outlineColor(const TextColor &set)
Set the outline color.
-
inline bool drawOutline() const
Get the draw outline flag.
-
inline VideoStageTextOverlay &drawOutline(bool set)
Set the draw outline flag.
-
inline bool drawShadow() const
Get the draw shadow flag.
-
inline VideoStageTextOverlay &drawShadow(bool set)
Set the draw shadow flag.
-
inline const std::string &fontDescription() const
Get the font description.
-
inline VideoStageTextOverlay &fontDescription(string_view set)
Set the font description.
Uses Pango, see: FontDescription from_string utility function
-
inline HorizontalAlignment horizontalAlignment() const
Get the horizontal alignment.
-
inline VideoStageTextOverlay &horizontalAlignment(HorizontalAlignment set)
Set the horizontal alignment.
-
inline bool isHorizontalAlignmentAbsolute() const
Test if the horizontal alignment is absolute or positional.
-
inline LineAlignment lineAlignment() const
Get the line alignment.
-
inline VideoStageTextOverlay &lineAlignment(LineAlignment set)
Set the line alignment.
-
inline VerticalAlignment verticalAlignment() const
Get the vertical alignment.
-
inline VideoStageTextOverlay &verticalAlignment(VerticalAlignment set)
Set the vertical alignment.
-
inline bool isVerticalAlignmentAbsolute() const
Test if the vertical alignment is absolute or positional.
-
inline boost::optional<PxUtility::Point<double>> absoluteAlignment() const
Get the absolute alignment position (0..1 relative to canvas)
-
inline VideoStageTextOverlay &absoluteAlignment(const PxUtility::Point<double> &set)
Set the absolute alignment position (0..1 relative to canvas)
-
inline VideoStageTextOverlay &resetAbsoluteAlignment()
Reset the absolute alignment position.
-
inline boost::optional<PxUtility::Point<double>> positionalAlignment() const
Get the positional alignment position (0..1 relative to canvas)
-
inline VideoStageTextOverlay &positionalAlignment(const PxUtility::Point<double> &set)
Set the positional alignment position (0..1 relative to canvas)
-
inline VideoStageTextOverlay &resetPositionalAlignment()
Reset the positional alignment position.
-
inline PxUtility::Size<PixelUnits> paddingSize() const
Get the padding used for (top/bottom/left/right alignment)
-
inline VideoStageTextOverlay &paddingSize(const PxUtility::Size<PixelUnits> &set)
Set the padding used for (top/bottom/left/right alignment)
-
inline TextWrapMode textWrapMode() const
Get the text wrap mode.
-
inline VideoStageTextOverlay &textWrapMode(TextWrapMode set)
Set the text wrap mode.
-
inline bool responseTimeCompensation() const
Get the response time compensation flag.
-
inline VideoStageTextOverlay &responseTimeCompensation(bool set)
Set the response time compensation flag Setting to true will compensate for display response time by doing a second text render in a slightly different (sequential and non-overlapping) place every frame
Public Types
-
enum class HorizontalAlignment
Horizontal alignment options.
Values:
-
enumerator Left
Left aligned.
-
enumerator Center
Center aligned.
-
enumerator Right
Right aligned.
-
enumerator Position
Absolute position clamped to canvas.
-
enumerator Absolute
Absolute position.
-
enumerator Left
-
enum class VerticalAlignment
Vertical alignment options.
Values:
-
enumerator Top
Top aligned.
-
enumerator Center
Center aligned.
-
enumerator Bottom
Bottom aligned.
-
enumerator Baseline
Align to baseline.
-
enumerator Position
Absolute position clamped to canvas.
-
enumerator Absolute
Absolute position.
-
enumerator Top
-
enum class LineAlignment
Alignment of text lines relative to each other.
Values:
-
enumerator Left
Left aligned.
-
enumerator Center
Center aligned.
-
enumerator Right
Right aligned.
-
enumerator Left
-
enum class TextWrapMode
Text wrap mode.
Values:
-
enumerator None
No wrapping.
-
enumerator Word
Word wrapping.
-
enumerator Char
Character wrapping.
-
enumerator WordChar
Word and character wrapping.
-
enumerator None
-
using PixelUnits = int32_t
Type numbers of pixels for offsets etc.
Public Functions
-
VideoStageTextOverlay() = default
Construction.
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
Public Static Functions
-
static const PxUtility::EnumMapper<HorizontalAlignment> &horizontalAlignmentMapper()
Map between HorizontalAlignment and string.
-
static const PxUtility::EnumMapper<VerticalAlignment> &verticalAlignmentMapper()
Map between VerticalAlignment and string.
-
static const PxUtility::EnumMapper<LineAlignment> &lineAlignmentMapper()
Map between LineAlignment and string.
-
static const PxUtility::EnumMapper<TextWrapMode> &textWrapModeMapper()
Map between TextWrapMode and string.
-
class RequestSetText : public Proximie::PxMedia::FeedRequest
- #include <PxMedia/VideoStageTextOverlay.h>
A request to change the overlay text.
-
inline string_view text() const
-
class VideoWebRtcEncodeFeedComponent : public Proximie::PxMedia::FeedComponent<VideoWebRtcEncodeFeedComponentProvider>
- #include <PxMedia/feed-components-video.h>
Base class for video WebRTC encoder feed components.
Subclassed by Proximie::PxMedia::VideoWebRtcEncodeFeedH264, Proximie::PxMedia::VideoWebRtcEncodeFeedVp8
-
class VideoWebRtcEncodeFeedH264 : public Proximie::PxMedia::VideoWebRtcEncodeFeedComponent
- #include <PxMedia/VideoWebRtcEncodeFeedH264.h>
A video feed component for specifying H264 encoding for WebRTC.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
To set video feed sub-properties, use the VideoWebRtcEncodeFeedH264::encodingProperties accessor function.
-
template<typename T, typename = std::enable_if_t<std::is_base_of<H264VideoEncoderComponent, T>::value>>
inline VideoWebRtcEncodeFeedH264 &encoder(const T &enc) Set the H.264 encoder (X264, VAAPI, etc.).
Note
This replaces any previously set encoder (including the default X264 encoder)
- Parameters:
enc – The encoder to copy from (polymorphically copied via template copy pattern)
-
inline VideoWebRtcEncodeFeedH264 &rtpMtu(int32_t set)
Set the RTP MTU value
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline const H264VideoEncoderComponent &encoder() const
Get encoder (read-only access)
-
inline VideoWebRtcEncodeFeedH264 &defaultEncoder()
Reset encoder to default X264 encoder
-
inline X264EncoderFeedComponent &encodingProperties()
Returns X264 encoding properties object for backwards compatibility.
- Deprecated:
Use encoder() setter with encoder configuration instead
Note
For backwards compatibility only. To set a non-X264 encoder, use encoder() setter.
- Throws:
std::runtime_error – if the current encoder is not X264 (e.g., if VAAPI encoder was set)
- Returns:
Reference to X264 encoder settings
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Static Functions
-
static inline X264EncoderFeedComponent makeDefaultEncoder()
The default encoder this component uses is X264.
-
struct Properties
- #include <PxMedia/VideoWebRtcEncodeFeedH264.h>
The properties required to encode the video feed for WebRTC using H264.
RTP properties
-
uint32_t rtpMtu
Maximum size of one packet for rtp.
Public Members
-
shared_not_null<H264VideoEncoderComponent> encoding
H264 encoder parameters (X264 by default, supports VAAPI, etc.
Defaults to X264 encoder in constructor. Can be changed to any H264VideoEncoderComponent implementation (VAAPI, etc.) using the encoder() setter.
-
uint32_t rtpMtu
-
template<typename T, typename = std::enable_if_t<std::is_base_of<H264VideoEncoderComponent, T>::value>>
-
class VideoWebRtcEncodeFeedVp8 : public Proximie::PxMedia::VideoWebRtcEncodeFeedComponent
- #include <PxMedia/VideoWebRtcEncodeFeedVp8.h>
A video feed component for specifying VP8 encoding for WebRTC.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline VideoWebRtcEncodeFeedVp8 &targetBitrate(BitRate set)
Set the target bitrate, where zero indicates “auto”
-
inline VideoWebRtcEncodeFeedVp8 &deadline(int64_t set)
Set the frame deadline
-
inline VideoWebRtcEncodeFeedVp8 &keyframeMaxDist(int32_t set)
Set the keyframe maximum distance
-
inline VideoWebRtcEncodeFeedVp8 &cpuUsed(int32_t set)
Set CPU used (see https://www.webmproject.org/docs/encoder-parameters/)
-
inline VideoWebRtcEncodeFeedVp8 &threads(int32_t set)
Set threads to use
-
inline VideoWebRtcEncodeFeedVp8 &rtpMtu(uint32_t set)
Set RTP MTU (maximum size of one packet for rtp)
-
inline VideoWebRtcEncodeFeedVp8 &endUsage(EndUsageType set)
Set end usage rate contorl mode
-
inline VideoWebRtcEncodeFeedVp8 &errorResilient(ErrorResilienceType set)
Set error resilience
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Types
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
Public Static Functions
-
static const PxUtility::EnumMapper<EndUsageType> &endUsageMapper()
Map between EndUsageType and string.
-
static const PxUtility::EnumMapper<ErrorResilienceType> &errorResilienceMapper()
Map between ErrorResilienceType and string.
-
struct Properties
- #include <PxMedia/VideoWebRtcEncodeFeedVp8.h>
The properties required to encode the video feed for WebRTC using VP8.
Public Members
-
int64_t deadline
Deadline (usec per frame, or 0=best, 1=realtime)
-
int32_t keyframeMaxDist
Maximum number of frames between keyframes.
-
int32_t cpuUsed
-
int32_t threads
Number of threads to use.
-
uint32_t rtpMtu
Maximum size of one packet for rtp.
-
EndUsageType endUsage
End usage setting
-
ErrorResilienceType errorResilient
Error resilience.
-
int64_t deadline
-
inline VideoWebRtcEncodeFeedVp8 &targetBitrate(BitRate set)
-
struct WebRtcStats
- #include <PxMedia/WebRtcStats.h>
Statistics gather from a WebRTC feed.
WebRTC stats are based on the webrtc-stats spec available from https://www.w3.org/TR/webrtc-stats/. Since the webrtc-stats spec is a draft and subject to change, the stats are represented by a JSON object rather than strongly typed at this stage.
Note:
timestampfields in the output are based on the host system’s “monotonic clock”, in microseconds. The basis of the clock value is undefined/system dependent, and applications should use the values for relative comparisons only.Public Members
-
std::shared_ptr<const json_object> json
Stats in plain JSON form.
-
std::shared_ptr<const StatsElements> elements
Stats parsed into a typed structure.
Public Static Functions
-
static outcome::result<WebRtcStats> create(const GstStructure &stats)
Create a parsed stats object from a base WebRTC GST structure
Ref.: https://gstreamer.freedesktop.org/documentation/webrtc/index.html#webrtcbin::get-stats
-
struct BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Base/common properties for all WebRTC stats.
Subclassed by Proximie::PxMedia::WebRtcStats::CandidatePairStats, Proximie::PxMedia::WebRtcStats::CodecStats, Proximie::PxMedia::WebRtcStats::IceCandidateStats, Proximie::PxMedia::WebRtcStats::InboundRtpStats, Proximie::PxMedia::WebRtcStats::OutboundRtpStats, Proximie::PxMedia::WebRtcStats::PeerConnectionStats, Proximie::PxMedia::WebRtcStats::RemoteInboundRtpStats, Proximie::PxMedia::WebRtcStats::RemoteOutboundRtpStats, Proximie::PxMedia::WebRtcStats::TransportStats
Public Functions
-
PxUtility::JsonSerializer &serializeBase(PxUtility::JsonSerializer &serializer, string_view type)
Helper to serialize with type
-
PxUtility::JsonSerializer &serializeBase(PxUtility::JsonSerializer &serializer, string_view type)
-
struct CandidatePairStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for a candidate pair.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
boost::optional<double> availableIncomingBitrate
Available incoming bitrate.
-
boost::optional<double> availableOutgoingBitrate
Available outgoing bitrate.
-
boost::optional<int64_t> bytesReceived
Bytes received.
-
boost::optional<int64_t> bytesSent
Bytes sent.
-
boost::optional<double> currentRoundTripTime
Current round trip time.
-
boost::optional<double> lastPacketReceivedTimestamp
Last packet received timestamp.
-
boost::optional<double> lastPacketSentTimestamp
Last packet sent timestamp.
-
boost::optional<std::string> localCandidateId
Local candidate identifier.
-
boost::optional<bool> nominated
Whether or not the candidate pair has been nominated to be used.
-
boost::optional<std::string> remoteCandidateId
Remote candidate identifier.
-
boost::optional<int64_t> requestsReceived
Requests received.
-
boost::optional<int64_t> requestsSent
Requests sent.
-
boost::optional<int64_t> responsesReceived
Responses received.
-
boost::optional<int64_t> responsesSent
Responses sent.
-
boost::optional<std::string> state
State of the connection between the two candidates.
-
boost::optional<double> totalRoundTripTime
Total round trip time.
-
boost::optional<std::string> transportId
The transport inspected to obtain the transport-related stats.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct CodecStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for a codec.
Note that in some cases the codec stats are omitted
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
boost::optional<int64_t> payloadType
Payload type of the codec.
-
boost::optional<int64_t> ssrc
Synchronization source.
-
boost::optional<std::string> mimeType
MIME type of the codec.
-
boost::optional<std::string> codecType
Codec type, e.g. “encode”.
-
boost::optional<int64_t> clockRate = 0
Clock rate of the codec.
-
boost::optional<int64_t> channels
Number of channels.
-
boost::optional<std::string> sdpFmtpLine
SDP FMTP line.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct GstRtpJitterBufferStats
- #include <PxMedia/WebRtcStats.h>
GST RTP jitter buffer stats.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t numPushed = 0
Number of packets pushed.
-
int64_t numLost = 0
Number of packets lost.
-
int64_t numLate = 0
Number of packets late.
-
int64_t numDuplicates = 0
Number of packets duplicated.
-
int64_t avgJitter = 0
Average jitter.
-
int64_t rtxCount = 0
RTX count.
-
int64_t rtxSuccessCount = 0
RTX success count.
-
double rtxPerPacket = 0
RTX per packet.
-
int64_t rtxRtt = 0
RTX round trip time.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct GstRtpSourceStats
- #include <PxMedia/WebRtcStats.h>
GST RTP source stats.
See https://gstreamer.freedesktop.org/documentation/rtpmanager/RTPSource.html#RTPSource:stats
Subclassed by Proximie::PxMedia::WebRtcStats::GstRtpSourceStatsWithRb
Public Functions
-
virtual void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t ssrc = 0
Synchronization source.
-
bool internal = false
Internal flag.
-
bool validated = false
Validated flag.
-
bool receivedBye = false
Received “BYE” flag.
-
bool isCsrc = false
Is CSRC flag.
-
bool isSender = false
Is sender flag.
-
int64_t seqNumBase = 0
Sequence number base.
-
int64_t clockRate = 0
Clock rate.
-
uint64_t octetsSent = 0
Number of octets sent.
-
uint64_t packetsSent = 0
Number of packets sent.
-
uint64_t octetsReceived = 0
Number of octets received.
-
uint64_t packetsReceived = 0
Number of packets received.
-
uint64_t bytesReceived = 0
Number of bytes received.
-
uint64_t bitRate = 0
Bit rate.
-
int64_t packetsLost = 0
Number of packets lost.
-
uint64_t jitter = 0
Jitter.
-
int64_t sentPliCount = 0
Number of PLI packets sent.
-
int64_t recvPliCount = 0
Number of PLI packets received.
-
int64_t sentFirCount = 0
Number of FIR packets sent.
-
int64_t recvFirCount = 0
Number of FIR packets received.
-
int64_t sentNackCount = 0
Number of NACK packets sent.
-
int64_t recvNackCount = 0
Number of NACK packets received.
-
int64_t recvPacketRate = 0
Receive packet rate.
-
bool haveSr = false
Have SR flag.
-
uint64_t srNtpTime = 0
SR NTP time.
-
int64_t srRtpTime = 0
SR RTP time.
-
int64_t srOctetCount = 0
SR octet count.
-
int64_t srPacketCount = 0
SR packet count.
-
virtual void serialize(PxUtility::JsonSerializer &serializer)
-
struct GstRtpSourceStatsWithRb : public Proximie::PxMedia::WebRtcStats::GstRtpSourceStats
- #include <PxMedia/WebRtcStats.h>
GST RTP source stats, with RB details.
See https://gstreamer.freedesktop.org/documentation/rtpmanager/RTPSource.html#RTPSource:stats
Public Functions
-
virtual void serialize(PxUtility::JsonSerializer &serializer) override
Serialize with JsonSerializer
Public Members
-
bool sentRb = false
Sent RB flag.
-
int64_t sentRbFractionLost = 0
Sent RB fraction lost.
-
int64_t sentRbPacketsLost = 0
Sent RB packets lost.
-
int64_t sentRbExtHighestSeq = 0
Sent RB extended highest sequence.
-
int64_t sentRbJitter = 0
Sent RB jitter.
-
int64_t sentRbLsr = 0
Sent RB LSR.
-
int64_t sentRbDlsr = 0
Sent RB DLSR.
-
bool haveRb = false
Have RB flag.
-
int64_t rbSsrc = 0
RB SSRC.
-
int64_t rbFractionLost = 0
RB fraction lost.
-
int64_t rbPacketsLost = 0
RB packets lost.
-
int64_t rbExtHighestSeq = 0
RB extended highest sequence.
-
int64_t rbJitter = 0
RB jitter.
-
int64_t rbLsr = 0
RB LSR.
-
int64_t rbDlsr = 0
RB DLSR.
-
int64_t rbRoundTrip = 0
RB round trip time.
-
virtual void serialize(PxUtility::JsonSerializer &serializer) override
-
struct IceCandidateStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for an ICE candidate.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
boost::optional<std::string> address
Candidate address.
-
std::string candidateType
Candidate type.
-
boost::optional<bool> deleted
Deleted flag.
-
boost::optional<int64_t> port
Candidate port.
-
boost::optional<uint64_t> priority
Candidate priority.
-
boost::optional<std::string> protocol
Candidate protocol.
-
boost::optional<std::string> relayProtocol
Relay protocol.
-
std::string transportId
Transport identifier.
-
boost::optional<std::string> url
URL of the ICE server.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct InboundRtpStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for inbound RTP.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t ssrc = 0
Synchronization source.
-
std::string codecId
Codec identifier.
-
std::string transportId
Transport identifier.
-
int64_t packetsReceived = 0
Number of packets received.
-
double jitter = 0
Jitter.
-
std::string remoteId
Remote identifier.
-
int64_t bytesReceived = 0
Number of bytes received.
-
int64_t firCount = 0
Number of FIR packets.
-
int64_t pliCount = 0
Number of PLI packets.
-
int64_t nackCount = 0
Number of NACK packets.
-
boost::optional<int64_t> packetsLost
Number of packets lost.
-
boost::optional<int64_t> packetsDiscarded
Number of packets discarded.
-
boost::optional<int64_t> packetsDuplicated
Number of packets duplicated.
-
boost::optional<GstRtpJitterBufferStats> gstRtpJitterBufferStats
RTP jitter stats.
-
GstRtpSourceStatsWithRb gstRtpSourceStats
GST RTP source stats.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct OutboundRtpStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for outbound RTP.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t ssrc = 0
Synchronization source.
-
std::string codecId
Codec identifier.
-
std::string transportId
Transport identifier.
-
int64_t bytesSent = 0
Number of bytes sent.
-
int64_t packetsSent = 0
Number of packets sent.
-
int64_t firCount = 0
Number of FIR packets.
-
int64_t pliCount = 0
Number of PLI packets.
-
int64_t nackCount = 0
Number of NACK packets.
-
GstRtpSourceStats gstRtpSourceStats
GST RTP source stats.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct PeerConnectionStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for a peer connection.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct RemoteInboundRtpStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for remote inbound RTP.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
std::string localId
Local identifier.
-
int64_t ssrc = 0
Synchronization source.
-
std::string codecId
Codec identifier.
-
std::string transportId
Transport identifier.
-
int64_t packetsLost = 0
Number of packets lost.
-
double jitter = 0
Jitter.
-
double fractionLost = 0
Fraction of packets lost.
-
double roundTripTime = 0
Round trip time.
-
GstRtpSourceStatsWithRb gstRtpSourceStats
GST RTP source stats.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct RemoteOutboundRtpStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for remote outbound RTP.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
Public Members
-
int64_t ssrc = 0
Synchronization source.
-
std::string codecId
Codec identifier.
-
std::string transportId
Transport identifier.
-
int64_t bytesSent = 0
Number of bytes sent.
-
int64_t packetsSent = 0
Number of packets sent.
-
double remoteTimestamp = 0
Remote timestamp.
-
std::string localId
Local identifier.
-
void serialize(PxUtility::JsonSerializer &serializer)
-
struct StatsElements
- #include <PxMedia/WebRtcStats.h>
All the WebRTC stats elements.
Public Members
-
KeyMap<PeerConnectionStats> peerConnections
Peer connections.
-
KeyMap<CodecStats> codecs
Codec sources.
-
KeyMap<TransportStats> transports
Transports.
-
KeyMap<InboundRtpStats> inboundRtps
Inbound RTPs.
-
KeyMap<OutboundRtpStats> outboundRtps
Outbound RTPs.
-
KeyMap<RemoteInboundRtpStats> remoteInboundRtps
Remote inbound RTPs.
-
KeyMap<RemoteOutboundRtpStats> remoteOutboundRtps
Remote outbound RTPs.
-
KeyMap<CandidatePairStats> candidatePairs
Candidate pairs.
-
KeyMap<IceCandidateStats> iceCandidates
ICE candidate stats.
-
std::vector<std::string> unparsedStats
List of identifiers for unparsed stats.
-
KeyMap<PeerConnectionStats> peerConnections
-
struct TransportStats : public Proximie::PxMedia::WebRtcStats::BaseWebRtcStats
- #include <PxMedia/WebRtcStats.h>
Stats for a transport.
Public Functions
-
void serialize(PxUtility::JsonSerializer &serializer)
Serialize with JsonSerializer
-
void serialize(PxUtility::JsonSerializer &serializer)
-
std::shared_ptr<const json_object> json
-
class WebRtcStatsRequest : public Proximie::PxMedia::FeedRequest
- #include <PxMedia/WebRtcStats.h>
A feed request to obtain SRT feed statistics.
Public Types
-
using StatsOutcome = outcome::result<WebRtcStats>
Type alias for stats outcome.
-
using StatsCallback = std::function<void(const StatsOutcome &stats)>
Type alias for stats callback.
Public Functions
-
inline explicit WebRtcStatsRequest(StatsCallback callback)
Request constructor.
-
inline const StatsCallback &callback() const
The callback to receive the stats.
-
using StatsOutcome = outcome::result<WebRtcStats>
-
class X264EncoderFeedComponent : public Proximie::PxMedia::H264VideoEncoderComponent
- #include <PxMedia/X264EncoderFeedComponent.h>
Encapsulates X264 encoder element for use in feed components.
File resolutions
Note that this encoder requires that both the width and height of the video stream resolution be integer divisible by two.
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline X264EncoderFeedComponent &bitrate(BitRate set)
Set bitrate
-
inline X264EncoderFeedComponent &speedPreset(EncoderPreset set)
Set speed preset type
-
inline X264EncoderFeedComponent &tune(EncoderTune set)
Set encoder tuning as a single flag
-
inline X264EncoderFeedComponent &tune(EncoderTuneFlags set)
Set encoder tuning as one or more EncoderTune bit flags
-
inline X264EncoderFeedComponent &tuneNone()
Set no encoder tuning
-
inline X264EncoderFeedComponent &keyIntMax(uint32_t set)
Set maximum between two key-frames (
0= auto)
-
inline X264EncoderFeedComponent &pass(EncoderPass set)
Set encoder pass setting
-
inline X264EncoderFeedComponent &byteStream(bool set)
Set byte stream flag
-
inline X264EncoderFeedComponent &threads(uint32_t set)
Set threads used (
0= auto)
Public Types
-
enum class EncoderPreset
Encoder speed/quality tradeoff preset options.
Values:
-
enumerator NONE
No preset.
-
enumerator ULTRAFAST
Ultrafast preset.
-
enumerator SUPERFAST
Superfast preset.
-
enumerator VERYFAST
Very fast preset.
-
enumerator FASTER
Faster preset.
-
enumerator FAST
Fast preset.
-
enumerator MEDIUM
Medium preset.
-
enumerator SLOW
Slow preset.
-
enumerator SLOWER
Slower preset.
-
enumerator VERYSLOW
Very slow preset.
-
enumerator PLACEBO
Placebo preset.
-
enumerator NONE
-
enum class EncoderPass
Encoding pass type.
Values:
-
enumerator CBR
Constant Bit Rate encoding.
-
enumerator QUANT
Constant Quantizer.
-
enumerator QUAL
Constant Quality.
-
enumerator PASS1
VBR Encoding - Pass 1.
-
enumerator PASS2
VBR Encoding - Pass 2.
-
enumerator PASS3
VBR Encoding - Pass 3.
-
enumerator CBR
-
using EncoderTuneFlags = uint16_t
The base type that can be used to store the EncoderTune bit flags.
-
using EncoderTune = EncoderTuneClass::Enum
Encoder “non-psychovisual tuning” options.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Static Functions
-
static const PxUtility::EnumMapper<EncoderPreset> &encoderPresetMapper()
Map between EncoderPreset and string.
-
static const PxUtility::EnumMapper<EncoderTune> &encoderTuneMapper()
Map between EncoderPreset and string.
-
static const PxUtility::EnumMapper<EncoderPass> &encoderPassMapper()
Map between EncoderPass and string.
-
struct EncoderTuneClass
- #include <PxMedia/X264EncoderFeedComponent.h>
Encapsulating class for encoder tuning flags.
-
struct Properties
- #include <PxMedia/X264EncoderFeedComponent.h>
Properties required to encode video with X264.
Public Members
-
EncoderPreset speedPreset
Preset for speed/quality tradeoff.
-
EncoderTuneFlags tune
Flags for “non-psychovisual” tuning.
-
uint32_t keyIntMax
Maximum between two key-frames (
0= auto)
-
EncoderPass pass
Encoding pass/type.
-
bool byteStream
Generate byte stream format of NALU.
-
uint32_t threads
Threads used by the codec (
0= auto)
-
EncoderPreset speedPreset
-
inline X264EncoderFeedComponent &bitrate(BitRate set)
-
namespace BitRateLiterals
This namespace contains literals for BitRate values.
See the main BitRate class for more details.
-
namespace experimental
-
class FeedDiagnosticsRequest : public Proximie::PxMedia::FeedRequest
- #include <PxMedia/FeedDiagnosticsRequest.h>
A request to enable diagnostics on a feed.
Diagnostics in this context are triggered by certain conditions or events, e.g. queue overruns, rather than periodic reports or stats tracking.
Public Functions
-
inline explicit FeedDiagnosticsRequest(bool enabled)
Create a request to enable or disable diagnostics When enabled, a default logging level of DEBUG is used
-
inline explicit FeedDiagnosticsRequest(PxCore::PxLogger::LogSeverity logLevel)
Create a request to enable diagnostics at a given logging level.
-
inline bool enabled() const
Whether the diagnostics are enabled.
-
inline PxCore::PxLogger::LogSeverity logLevel() const
Get the logging level, which only applies if diagnostics are enabled.
-
inline explicit FeedDiagnosticsRequest(bool enabled)
-
class NetworkQualityMonitor
- #include <PxMedia/NetworkQualityMonitor.h>
A class that checks the performance of a set of feeds and summarises an assessment of the overall network quality.
This is an experimental feature that will be expanded and improved in future releases.
Public Functions
-
bool isRunning() const
Returns whether the monitor is currently running.
-
void start(std::chrono::milliseconds interval)
Start the feed quality monitor with the given interval.
If the monitor is already running, it will change the interval after any ongoing collection pass is complete.
-
void stop()
Stop the feed quality monitor. If the monitor is not running, this is a no-op.
Check if a feed is being monitored already.
Register a feed to be monitored. Ignored if the feed is already registered.
Unregister a feed from being monitored. Ignored if the feed is not registered.
-
void unregisterAllFeeds()
Unregister all currently registered feeds.
Public Static Functions
Create a new network monitor.
After creation, the owner can add feeds and start the monitor.
-
bool isRunning() const
-
class VideoInputFeedPipewire : public Proximie::PxMedia::VideoFormattedInputFeedComponent
- #include <PxMedia/VideoInputFeedPipewire.h>
A video input feed component capturing a pipewire video source.
This feed component provides properties to specify which pipewire video source to capture, and the VideoCapabilities (such as resolution and frame rate).
Setters
These setter functions return a reference to the parent object, allowing callers to chain setting functions.
To set video feed sub-properties, use the VideoInputFeedPipewire::videoCapabilities accessor function.
-
VideoInputFeedPipewire &alwaysCopy(bool set)
Set whether to always copy the buffer data
-
VideoInputFeedPipewire &autoconnect(bool set)
Set whether to autoconnect
-
VideoInputFeedPipewire &automaticEos(bool set)
Set whether to automatically send EOS when the segment is done
-
VideoInputFeedPipewire &blocksize(uint32_t set)
Set the size in bytes to read per buffer
-
VideoInputFeedPipewire &clientName(string_view set)
Set the client name to use
-
VideoInputFeedPipewire &clientProperties(string_view set)
Set the list of PipeWire client properties
-
VideoInputFeedPipewire &doTimestamp(bool set)
Set whether to apply current stream time to buffers
-
VideoInputFeedPipewire &fd(int32_t set)
Set the fd to connect with
-
VideoInputFeedPipewire &keepaliveTime(int32_t set)
Set the keepalive time
-
VideoInputFeedPipewire &maxBuffers(int32_t set)
Set the maximum number of buffers to negotiate with PipeWire
-
VideoInputFeedPipewire &minBuffers(int32_t set)
Set the minimum number of buffers to negotiate with PipeWire
-
VideoInputFeedPipewire &name(string_view set)
Set the name of the object
-
VideoInputFeedPipewire &numBuffers(int32_t set)
Set the number of buffers to output before sending EOS
-
VideoInputFeedPipewire &parent(string_view set)
Set the parent of the object
-
VideoInputFeedPipewire &path(string_view set)
Set the source path to connect to
-
VideoInputFeedPipewire &resendLast(bool set)
Set whether to resend last buffer on EOS
-
VideoInputFeedPipewire &streamProperties(string_view set)
Set the list of PipeWire stream properties
-
VideoInputFeedPipewire &targetObject(string_view set)
Set the source name/serial to connect to
-
VideoInputFeedPipewire &typefind(bool set)
Set whether to run typefind before negotiating
-
inline const Properties &properties() const
Returns a read-only reference to the properties for the object
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
struct Properties
- #include <PxMedia/VideoInputFeedPipewire.h>
The properties required to specify the video input device and its settings.
Pipewire video capture settings
These settings determine how the Pipewire video source is captured.
-
boost::optional<bool> alwaysCopy
Always copy the buffer data.
-
boost::optional<bool> autoconnect
Attempt to find a peer to connect to.
-
boost::optional<bool> automaticEos
Automatically EOS when the segment is done.
-
boost::optional<uint32_t> blocksize
Size in bytes to read per buffer (-1 = default)
-
boost::optional<std::string> clientName
The client name to use (NULL = default)
-
boost::optional<std::string> clientProperties
List of PipeWire client properties.
-
boost::optional<bool> doTimestamp
Apply current stream time to buffers.
-
boost::optional<int32_t> fd
The fd to connect with.
-
boost::optional<int32_t> keepaliveTime
Periodically send last buffer (in milliseconds, 0 = disabled)
-
boost::optional<int32_t> maxBuffers
Maximum number of buffers to negotiate with PipeWire.
-
boost::optional<int32_t> minBuffers
Minimum number of buffers to negotiate with PipeWire.
-
boost::optional<std::string> name
The name of the object.
-
boost::optional<int32_t> numBuffers
Number of buffers to output before sending EOS (-1 = unlimited)
-
boost::optional<std::string> parent
The parent of the object.
-
boost::optional<std::string> path
The source path to connect to (NULL = default)
-
boost::optional<bool> resendLast
Resend last buffer on EOS.
-
boost::optional<std::string> streamProperties
List of PipeWire stream properties.
-
boost::optional<std::string> targetObject
The source name/serial to connect to (NULL = default)
-
boost::optional<bool> typefind
Run typefind before negotiating (deprecated, non-functional)
-
boost::optional<bool> alwaysCopy
-
VideoInputFeedPipewire &alwaysCopy(bool set)
-
class VideoStageFaceBlur : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageFaceBlur.h>
A processing stage that applies basic Open CV-based face blurring to a video.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline bool doCannyPruning() const
Get Canny pruning flag.
-
inline VideoStageFaceBlur &doCannyPruning(bool set)
Set Canny pruning flag.
-
inline boost::optional<uint32_t> minNeighbours() const
Get minimum number of neighbours.
-
inline VideoStageFaceBlur &minNeighbours(uint32_t set)
Set minimum number of neighbours.
-
inline VideoStageFaceBlur &minNeighboursDefault()
Set minimum number of neighbours to the default.
-
inline VideoStageFaceBlur &minSize(const Size &set)
Set minimum window size.
-
inline VideoStageFaceBlur &minSizeDefault()
Set window minimum size to default.
-
inline const std::string &profile() const
Get profile name.
-
inline VideoStageFaceBlur &profile(string_view set)
Set profile name.
-
inline VideoStageFaceBlur &profileDefault()
Set profile name to default.
-
inline boost::optional<double> scaleFactor() const
Get scale factor.
-
inline VideoStageFaceBlur &scaleFactor(double set)
Set scale factor.
-
inline VideoStageFaceBlur &scaleFactorDefault()
Set scale factor to default.
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline bool doCannyPruning() const
-
class VideoStageGaussianBlur : public Proximie::PxMedia::VideoFeedStageComponent
- #include <PxMedia/VideoStageGaussianBlur.h>
A processing stage that applies a Gaussian blur to a video feed.
Note that this is a simple CPU-based blur, so not suitable for high resolutions or frame rates.
Getters and setters
Setter functions return a reference to the parent object, allowing callers to chain setting functions.
-
inline SigmaValue sigma() const
Get the Gaussian sigma value.
-
inline VideoStageGaussianBlur &sigma(SigmaValue set)
Set the Gaussian sigma value.
Public Types
-
using SigmaValue = double
Blur sigma value Sigma is positive for increasing blur, negative for sharpen, zero for no effect
Public Functions
-
virtual shared_not_null<Provider> makeProvider() const override
Required override to create a provider for the component
-
inline explicit VideoStageGaussianBlur(SigmaValue sigma = 0)
Construct a Gaussian blur stage, optionally supplying a sigma value.
-
inline SigmaValue sigma() const
-
class FeedDiagnosticsRequest : public Proximie::PxMedia::FeedRequest
-
namespace Literals
-
namespace MediaSessionFeedType
Define media session feed type identifiers.
Enums
-
enum class Enum
Enumerated constant for a media session feed type.
Values:
-
enumerator None
Unknown/no feed type.
-
enumerator Audio
Audiofeed.
-
enumerator Camera
Camera feed.
-
enumerator Screen
Screen-share feed.
-
enumerator RemoteHand
Legacy: “remote hand” feed.
-
enumerator Monitor
Feed that monitors feed activity.
-
enumerator None
Functions
-
bool validateEnumValue(int64_t value, Enum &set)
Helper to take an untyped integer value and produce a type-safe MediaSessionFeedType::Enum value.
- Parameters:
value – [in] Untyped integer value to attempt to convert
set – [out] When the submitted value is valid, set this value accordingly
- Returns:
truewhen the conversion was successful, otherwisefalse.
-
enum class Enum
-
namespace VideoMediaFormat
Constants and supporting functions for video media formats
Helper functions to get media type strings
-
const char *mediaTypeToString(MediaType type)
Obtain the media type e.g. “video/x-raw” or “image/jpeg”.
-
const char *mediaTypeFormatToString(MediaType type)
Obtain the media format string from the
MediaType, if any e.g. “I420” forMediaType::VIDEO_XRAW_I420Returns nullptr if there is no format for the underlying media type
Enums
-
enum class BaseMedia : uint16_t
Base media format type.
Values:
-
enumerator IMAGE
image (e.g. image/jpeg)
-
enumerator VIDEO_ENCODED
encoded video (e.g. video/mpeg)
-
enumerator VIDEO_XRAW
video/x-raw, which has further raw formats
-
enumerator IMAGE
-
enum class MediaType
Video media types
Values:
-
enumerator IMAGE
Image media type without explicit format.
-
enumerator IMAGE_JPEG
image/jpeg
-
enumerator VIDEO_ENCODED
encoded video media type without explicit format
-
enumerator VIDEO_XRAW
Video/x-raw without explicit format.
-
enumerator VIDEO_XRAW_I420
planar 4:2:0 YUV
-
enumerator VIDEO_XRAW_YV12
planar 4:2:0 YUV (I420 with U/V planes swapped)
-
enumerator VIDEO_XRAW_YUY2
packed 4:2:2 YUV
-
enumerator VIDEO_XRAW_YVYU
packed 4:2:2 YUV (YUY2 with U/V planes swapped)
-
enumerator VIDEO_XRAW_UYVY
packed 4:2:2 YUV
-
enumerator VIDEO_XRAW_AYUV
packed 4:4:4 YUV + alpha channel
-
enumerator VIDEO_XRAW_RGBx
sparse RGB packed into 32 bit, space last
-
enumerator VIDEO_XRAW_BGRx
sparse reverse RGB packed into 32 bit, space last
-
enumerator VIDEO_XRAW_xRGB
sparse RGB packed into 32 bit, space first
-
enumerator VIDEO_XRAW_xBGR
sparse reverse RGB packed into 32 bit, space first
-
enumerator VIDEO_XRAW_RGBA
RGB, alpha last.
-
enumerator VIDEO_XRAW_BGRA
reverse RGB, alpha last
-
enumerator VIDEO_XRAW_ARGB
RGB, alpha channel first.
-
enumerator VIDEO_XRAW_ABGR
reverse RGB, alpha channel first
-
enumerator VIDEO_XRAW_RGB
plain RGB
-
enumerator VIDEO_XRAW_BGR
reverse RGB
-
enumerator VIDEO_XRAW_Y41B
planar 4:1:1 YUV
-
enumerator VIDEO_XRAW_Y42B
planar 4:2:2 YUV
-
enumerator VIDEO_XRAW_Y444
planar 4:4:4 YUV
-
enumerator VIDEO_XRAW_v210
packed 4:2:2 10-bit YUV, complex format
-
enumerator VIDEO_XRAW_v216
packed 4:2:2 16-bit YUV, Y0-U0-Y1-V1 order
-
enumerator VIDEO_XRAW_NV12
planar 4:2:0 YUV with interleaved UV plane
-
enumerator VIDEO_XRAW_NV21
planar 4:2:0 YUV with interleaved VU plane
-
enumerator VIDEO_XRAW_GRAY8
8-bit grayscale
-
enumerator VIDEO_XRAW_GRAY16_BE
16-bit grayscale, most sig. byte first
-
enumerator VIDEO_XRAW_GRAY16_LE
16-bit grayscale, least sig. byte first
-
enumerator VIDEO_XRAW_Y16
same as “GRAY16_LE”
-
enumerator VIDEO_XRAW_v308
packed 4:4:4 YUV
-
enumerator VIDEO_XRAW_IYU2
packed 4:4:4 YUV, U-Y-V order
-
enumerator VIDEO_XRAW_RGB16
RGB 5-6-5 bits per component.
-
enumerator VIDEO_XRAW_BGR16
reverse RGB 5-6-5 bits per component
-
enumerator VIDEO_XRAW_RGB15
RGB 5-5-5 bits per component.
-
enumerator VIDEO_XRAW_BGR15
reverse RGB 5-5-5 bits per component
-
enumerator VIDEO_XRAW_UYVP
packed 10-bit 4:2:2 YUV
-
enumerator VIDEO_XRAW_A420
planar 4:4:2:0 AYUV
-
enumerator VIDEO_XRAW_RGB8P
8-bit paletted RGB
-
enumerator VIDEO_XRAW_YUV9
planar 4:1:0 YUV
-
enumerator VIDEO_XRAW_YVU9
planar 4:1:0 YUV (YUV9 but UV planes swapped)
-
enumerator VIDEO_XRAW_IYU1
packed 4:1:1 YUV (Cb-Y0-Y1-Cr-Y2-Y3 …)
-
enumerator VIDEO_XRAW_ARGB64
RGB, alpha first, 16 bits/channel, native endian
-
enumerator VIDEO_XRAW_AYUV64
Packed 4:4:4 YUV + alpha, 16 bits/ch., native endian.
-
enumerator VIDEO_XRAW_r210
packed 4:4:4 RGB, 10 bits/channel
-
enumerator VIDEO_XRAW_I420_10LE
planar 4:2:0 YUV, 10 bits/channel LE
-
enumerator VIDEO_XRAW_I420_10BE
planar 4:2:0 YUV, 10 bits/channel BE
-
enumerator VIDEO_XRAW_I422_10LE
planar 4:2:2 YUV, 10 bits/channel LE
-
enumerator VIDEO_XRAW_I422_10BE
planar 4:2:2 YUV, 10 bits/channel BE
-
enumerator VIDEO_XRAW_Y444_10BE
planar 4:4:4 YUV, 10 bits/channel
-
enumerator VIDEO_XRAW_Y444_10LE
planar 4:4:4 YUV, 10 bits/channel
-
enumerator VIDEO_XRAW_GBR
planar 4:4:4 RGB, 8 bits/channel
-
enumerator VIDEO_XRAW_GBR_10BE
planar 4:4:4 RGB, 10 bits/channel
-
enumerator VIDEO_XRAW_GBR_10LE
planar 4:4:4 RGB, 10 bits/channel
-
enumerator VIDEO_XRAW_RGBP
-
enumerator VIDEO_XRAW_BGRP
planar 4:4:4 RGB, R-G-B order, 8 bits/channel
-
enumerator VIDEO_XRAW_RGBA64_LE
planar 4:4:4 RGB, B-G-R order, 8 bits/channel
-
enumerator VIDEO_XRAW_RGBA64_BE
RGB, alpha last, 16 bits/channel, LE
-
enumerator VIDEO_XRAW_BGRA64_LE
RGB, alpha last, 16 bits/channel, BE
-
enumerator VIDEO_XRAW_BGRA64_BE
reverse RGB, alpha last, 16 bits/channel, LE
-
enumerator VIDEO_XRAW_ARGB64_LE
reverse RGB, alpha last, 16 bits/channel, BE
-
enumerator VIDEO_XRAW_ARGB64_BE
RGB, alpha first, 16 bits/channel, LE
-
enumerator VIDEO_XRAW_ABGR64_LE
RGB, alpha first, 16 bits/channel, BE
-
enumerator VIDEO_XRAW_ABGR64_BE
reverse RGB, alpha first, 16 bits/channel, LE
-
enumerator VIDEO_XRAW_NV16
reverse RGB, alpha first, 16 bits/channel, BE
planar 4:2:2 YUV with interleaved UV plane
-
enumerator VIDEO_XRAW_NV61
planar 4:2:2 YUV with interleaved VU plane
-
enumerator VIDEO_XRAW_NV24
planar 4:4:4 YUV with interleaved UV plane
-
enumerator VIDEO_XRAW_NV12_64Z32
planar 4:2:0 YUV, interleaved UV plane in 64x32 tiles zigzag
-
enumerator VIDEO_XRAW_P012_LE
4:2:0 YUV with interleaved UV plane, 2 bytes per channel, color stored in MSB 12 bits, LE
-
enumerator VIDEO_XRAW_P012_BE
4:2:0 YUV with interleaved UV plane, 2 bytes per channel, color stored in MSB 12 bits, BE
-
enumerator VIDEO_XRAW_Y212_LE
packed 4:2:2 YUV, 2 bytes per channel, color stored in MSB 12 bits (Y-U-Y-V), LE
-
enumerator VIDEO_XRAW_Y212_BE
packed 4:2:2 YUV, 2 bytes per channel, color stored in MSB 12 bits (Y-U-Y-V), BE
-
enumerator VIDEO_XRAW_Y412_LE
packed 4:4:4:4 AYUV, 2 bytes per channel, color stored in MSB 12 bits (U-Y-V-A), LE
-
enumerator VIDEO_XRAW_Y412_BE
packed 4:4:4:4 AYUV, 2 bytes per channel, color stored in MSB 12 bits (U-Y-V-A), BE
-
enumerator IMAGE
-
const char *mediaTypeToString(MediaType type)
-
using PxMediaError = PxUtility::ErrorCodeException<PxMediaErrorCategory>