#include <stream/webrtc/include_pub/privmx/endpoint/stream/StreamApi.hpp>
Public Member Functions | |
| StreamApi ()=default | |
| std::string | createStreamRoom (const std::string &contextId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const std::optional< core::ContainerPolicy > &policies) |
| void | updateStreamRoom (const std::string &streamRoomId, const std::vector< core::UserWithPubKey > &users, const std::vector< core::UserWithPubKey > &managers, const core::Buffer &publicMeta, const core::Buffer &privateMeta, const int64_t version, const bool force, const bool forceGenerateNewKey, const std::optional< core::ContainerPolicy > &policies) |
| core::PagingList< StreamRoom > | listStreamRooms (const std::string &contextId, const core::PagingQuery &query) |
| StreamRoom | getStreamRoom (const std::string &streamRoomId) |
| void | deleteStreamRoom (const std::string &streamRoomId) |
| std::vector< std::string > | subscribeFor (const std::vector< std::string > &subscriptionQueries) |
| void | unsubscribeFrom (const std::vector< std::string > &subscriptionIds) |
| std::string | buildSubscriptionQuery (EventType eventType, EventSelectorType selectorType, const std::string &selectorId) |
| std::vector< StreamInfo > | listStreams (const std::string &streamRoomId) |
| void | joinStreamRoom (const std::string &streamRoomId) |
| void | leaveStreamRoom (const std::string &streamRoomId) |
| void | enableStreamRoomRecording (const std::string &streamRoomId) |
| std::vector< stream::RecordingEncKey > | getStreamRoomRecordingKeys (const std::string &streamRoomId) |
| StreamHandle | createStream (const std::string &streamRoomId) |
| std::vector< AudioDevice > | getAudioDevices () |
| std::vector< VideoDevice > | getVideoDevices () |
| std::vector< DesktopDevice > | getDesktopDevices (DesktopType desktopType) |
| MediaTrack | addTrack (const StreamHandle &streamHandle, const MediaDevice &track, const MediaTrackConstrains &mediaTrackConstrains) |
| void | removeTrack (const StreamHandle &streamHandle, const MediaDevice &track) |
| StreamPublishResult | publishStream (const StreamHandle &streamHandle) |
| StreamPublishResult | updateStream (const StreamHandle &streamHandle) |
| void | unpublishStream (const StreamHandle &streamHandle) |
| void | subscribeToRemoteStreams (const std::string &streamRoomId, const std::vector< StreamSubscription > &subscriptions) |
| void | modifyRemoteStreamsSubscriptions (const std::string &streamRoomId, const std::vector< StreamSubscription > &subscriptionsToAdd, const std::vector< StreamSubscription > &subscriptionsToRemove) |
| void | unsubscribeFromRemoteStreams (const std::string &streamRoomId, const std::vector< StreamSubscription > &subscriptionsToRemove) |
| void | dropBrokenFrames (const std::string &streamRoomId, bool enable) |
| void | addRemoteStreamListener (const std::string &streamRoomId, std::optional< int64_t > streamId, std::shared_ptr< OnTrackInterface > onTrack) |
| std::shared_ptr< StreamApiImpl > | getImpl () const |
Static Public Member Functions | |
| static StreamApi | create (core::Connection &connection, event::EventApi &eventApi) |
|
default |
//doc-gen:ignore
| void privmx::endpoint::stream::StreamApi::addRemoteStreamListener | ( | const std::string & | streamRoomId, |
| std::optional< int64_t > | streamId, | ||
| std::shared_ptr< OnTrackInterface > | onTrack ) |
| MediaTrack privmx::endpoint::stream::StreamApi::addTrack | ( | const StreamHandle & | streamHandle, |
| const MediaDevice & | track, | ||
| const MediaTrackConstrains & | mediaTrackConstrains ) |
Adds a local media track to a Stream handle. The track is staged locally and becomes visible to others after publishStream/updateStream.
| streamHandle | handle returned by createStream |
| track | media device to capture from |
| mediaTrackConstrains | capture constraints (resolution/fps) |
| std::string privmx::endpoint::stream::StreamApi::buildSubscriptionQuery | ( | EventType | eventType, |
| EventSelectorType | selectorType, | ||
| const std::string & | selectorId ) |
Generate subscription Query for the Stream Room events.
| eventType | type of event which you listen for |
| selectorType | scope on which you listen for events |
| selectorId | ID of the selector |
|
static |
| StreamHandle privmx::endpoint::stream::StreamApi::createStream | ( | const std::string & | streamRoomId | ) |
| std::string privmx::endpoint::stream::StreamApi::createStreamRoom | ( | const std::string & | contextId, |
| const std::vector< core::UserWithPubKey > & | users, | ||
| const std::vector< core::UserWithPubKey > & | managers, | ||
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const std::optional< core::ContainerPolicy > & | policies ) |
Creates a new Stream Room in given Context.
| contextId | ID of the Context to create the Stream Room in |
| users | vector of UserWithPubKey structs which indicates who will have access to the created Stream Room |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the created Stream Room |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| policies | Stream Room's policies (pass std::nullopt to use defaults) |
| void privmx::endpoint::stream::StreamApi::deleteStreamRoom | ( | const std::string & | streamRoomId | ) |
| void privmx::endpoint::stream::StreamApi::dropBrokenFrames | ( | const std::string & | streamRoomId, |
| bool | enable ) |
Configures whether to drop encrypted frames that cannot be decrypted.
| streamRoomId | ID of the Stream Room |
| enable | if true, broken frames will be dropped |
| void privmx::endpoint::stream::StreamApi::enableStreamRoomRecording | ( | const std::string & | streamRoomId | ) |
| std::vector< AudioDevice > privmx::endpoint::stream::StreamApi::getAudioDevices | ( | ) |
Lists available local audio input devices.
| std::vector< DesktopDevice > privmx::endpoint::stream::StreamApi::getDesktopDevices | ( | DesktopType | desktopType | ) |
Lists available desktop capture sources.
| desktopType | type of desktop source (screen/window) |
|
inline |
//doc-gen:ignore
| StreamRoom privmx::endpoint::stream::StreamApi::getStreamRoom | ( | const std::string & | streamRoomId | ) |
| std::vector< stream::RecordingEncKey > privmx::endpoint::stream::StreamApi::getStreamRoomRecordingKeys | ( | const std::string & | streamRoomId | ) |
| std::vector< VideoDevice > privmx::endpoint::stream::StreamApi::getVideoDevices | ( | ) |
Lists available local video input devices (cameras).
| void privmx::endpoint::stream::StreamApi::joinStreamRoom | ( | const std::string & | streamRoomId | ) |
| void privmx::endpoint::stream::StreamApi::leaveStreamRoom | ( | const std::string & | streamRoomId | ) |
| core::PagingList< StreamRoom > privmx::endpoint::stream::StreamApi::listStreamRooms | ( | const std::string & | contextId, |
| const core::PagingQuery & | query ) |
| std::vector< StreamInfo > privmx::endpoint::stream::StreamApi::listStreams | ( | const std::string & | streamRoomId | ) |
Gets a list of currently published streams in given Stream Room.
| streamRoomId | ID of the Stream Room to list streams from |
| void privmx::endpoint::stream::StreamApi::modifyRemoteStreamsSubscriptions | ( | const std::string & | streamRoomId, |
| const std::vector< StreamSubscription > & | subscriptionsToAdd, | ||
| const std::vector< StreamSubscription > & | subscriptionsToRemove ) |
Modifies current remote streams subscriptions.
| streamRoomId | ID of the Stream Room |
| subscriptionsToAdd | list of subscriptions to add |
| subscriptionsToRemove | list of subscriptions to remove |
| StreamPublishResult privmx::endpoint::stream::StreamApi::publishStream | ( | const StreamHandle & | streamHandle | ) |
Publishes the Stream (with currently staged tracks) to the server.
| streamHandle | handle returned by createStream |
| void privmx::endpoint::stream::StreamApi::removeTrack | ( | const StreamHandle & | streamHandle, |
| const MediaDevice & | track ) |
Removes a previously added media track from a Stream handle. For already published streams the removal is applied on updateStream.
| streamHandle | handle returned by createStream |
| track | media device previously passed to addTrack |
| std::vector< std::string > privmx::endpoint::stream::StreamApi::subscribeFor | ( | const std::vector< std::string > & | subscriptionQueries | ) |
Subscribe for the Stream Room events on the given subscription query.
| subscriptionQueries | list of queries |
| void privmx::endpoint::stream::StreamApi::subscribeToRemoteStreams | ( | const std::string & | streamRoomId, |
| const std::vector< StreamSubscription > & | subscriptions ) |
| void privmx::endpoint::stream::StreamApi::unpublishStream | ( | const StreamHandle & | streamHandle | ) |
Stops publishing the Stream.
| streamHandle | handle returned by createStream |
| void privmx::endpoint::stream::StreamApi::unsubscribeFrom | ( | const std::vector< std::string > & | subscriptionIds | ) |
Unsubscribe from events for the given subscriptionId.
| subscriptionIds | list of subscriptionId |
| void privmx::endpoint::stream::StreamApi::unsubscribeFromRemoteStreams | ( | const std::string & | streamRoomId, |
| const std::vector< StreamSubscription > & | subscriptionsToRemove ) |
| StreamPublishResult privmx::endpoint::stream::StreamApi::updateStream | ( | const StreamHandle & | streamHandle | ) |
Updates a published Stream after adding/removing tracks.
| streamHandle | handle returned by createStream |
| void privmx::endpoint::stream::StreamApi::updateStreamRoom | ( | const std::string & | streamRoomId, |
| const std::vector< core::UserWithPubKey > & | users, | ||
| const std::vector< core::UserWithPubKey > & | managers, | ||
| const core::Buffer & | publicMeta, | ||
| const core::Buffer & | privateMeta, | ||
| const int64_t | version, | ||
| const bool | force, | ||
| const bool | forceGenerateNewKey, | ||
| const std::optional< core::ContainerPolicy > & | policies ) |
Updates an existing Stream Room.
| streamRoomId | ID of the Stream Room to update |
| users | vector of UserWithPubKey structs which indicates who will have access to the Stream Room |
| managers | vector of UserWithPubKey structs which indicates who will have access (and management rights) to the Stream Room |
| publicMeta | public (unencrypted) metadata |
| privateMeta | private (encrypted) metadata |
| version | current version of the updated Stream Room |
| force | force update (without checking version) |
| forceGenerateNewKey | force to regenerate a key for the Stream Room |
| policies | Stream Room's policies (pass std::nullopt to keep current/defaults) |