1#ifndef MILLICAST_API_PUBLISHER_H
2#define MILLICAST_API_PUBLISHER_H
115 std::vector<uint8_t>& data) {}
143 std::optional<std::string>
145 std::optional<std::string>
164inline namespace compat {
186 const std::optional<Publisher::Option>& options = std::nullopt) = 0;
229 virtual void add_track(std::weak_ptr<VideoTrack> track) = 0;
230 virtual void add_track(std::weak_ptr<AudioTrack> track) = 0;
251 static std::unique_ptr<Publisher>
create();
272 std::optional<PublisherOption>&& options = std::nullopt) = 0;
332 static std::unique_ptr<Publisher>
create();
ClientOption Option
Definition client.h:162
The Client base class.
Definition client.h:194
The Publisher class. Its purpose is to publish media to a Millicast stream.
Definition publisher.h:170
virtual void set_listener(Publisher::Listener *listener)=0
set_listener : set the viewer listener to receive event from the viewer.
virtual bool is_publishing() const =0
Tell if the publisher is publishing.
virtual void clear_tracks()=0
clear_tracks will clear all track added to the publisher.
virtual void add_track(std::weak_ptr< Track > track)=0
Add a track that will be used to publish media (audio or video).
static std::unique_ptr< Publisher > create()
Create a publisher object.
virtual void set_recording_listener(RecordingListener *rlistener)=0
virtual bool publish(const std::optional< Publisher::Option > &options=std::nullopt)=0
Publish a stream to Millicast You must be connected first in order to publish a stream.
virtual void add_track(std::weak_ptr< VideoTrack > track)=0
virtual bool unpublish()=0
Stop sending media to Millicast. The SDK will automatically disconnect after unpublish.
virtual void add_track(std::weak_ptr< AudioTrack > track)=0
virtual bool set_credentials(Credentials &&creds)=0
virtual Credentials get_credentials() const =0
Get the current publisher credentials.
virtual bool set_credentials(const Credentials &creds)=0
Set the publisher credentials.
virtual void unrecord()=0
The Client base class.
Definition client.h:265
The Publisher class. Its purpose is to publish media to a Millicast stream.
Definition publisher.h:260
virtual Promise< bool > is_publishing() const =0
Tell if the publisher is publishing.
virtual Promise< void > set_listener(PublisherListener *listener)=0
set_listener : set the publisher listener to receive event from the publisher.
virtual Promise< void > unrecord()=0
virtual Promise< void > add_track(std::weak_ptr< VideoTrack > track)=0
virtual Promise< void > add_track(std::weak_ptr< Track > track)=0
virtual Promise< void > record()=0
static std::unique_ptr< Publisher > create()
Create a publisher object.
virtual Promise< PublisherCredentials > get_credentials() const =0
Get the current publisher credentials.
virtual Promise< void > clear_tracks()=0
virtual Promise< void > add_track(std::weak_ptr< AudioTrack > track)=0
virtual Promise< void > unpublish()=0
Stop sending media to Millicast. The SDK will automatically disconnect after unpublish.
virtual Promise< void > set_credentials(PublisherCredentials &&creds)=0
Set the publisher credentials.
virtual Promise< void > publish(std::optional< PublisherOption > &&options=std::nullopt)=0
Publish a stream to Millicast You must be connected first in order to publish a stream.
virtual compat::Publisher & get_old_api()=0
Gets the synchronous API for this publisher. Note that it will be deprecated in the future.
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
ScalabilityMode
Definition publisher.h:23
Allows setting the desired minimum and/or maximum bitrates when publishing a stream....
Definition client.h:51
The Client Listener struct which contains methods that will be called on specific events from a Clien...
Definition client.h:70
The Credentials struct represent the credentials need to be able to connect and publish to a Millicas...
Definition publisher.h:62
std::string api_url
Definition publisher.h:70
bool is_valid
Definition publisher.h:63
std::string token
Definition publisher.h:68
std::string stream_name
Definition publisher.h:66
The PublisherListener struct for the Publisher class. It adds the publishing event on top of the Clie...
Definition publisher.h:79
virtual void on_transformable_frame(uint32_t ssrc, uint32_t timestamp, std::vector< uint8_t > &data)
Called after a frame has been encoded if you need to add data to this frame before the frame is being...
Definition publisher.h:113
virtual void on_publishing_error(const std::string &reason)=0
Called when the was an error while establishing the peerconnection.
virtual void on_active()=0
This event is called when the first viewer starts viewing the stream.
virtual void on_inactive()=0
This event is called when the last viewer stops viewing the stream.
virtual void on_publishing()=0
on_publishing is called when a peerconnection has been established with Millicast and the media excha...
Option specific to the publisher.
Definition publisher.h:135
std::optional< ScalabilityMode > svc_mode
Definition publisher.h:154
std::optional< std::string > video
Definition publisher.h:144
bool record_stream
Definition publisher.h:159
BitrateSettings bitrate_settings
Definition publisher.h:157
std::optional< int > priority
Definition publisher.h:161
std::optional< std::string > audio
Definition publisher.h:146
struct millicast::PublisherOption::@0 multisource
std::optional< std::string > source_id
Definition publisher.h:138
bool simulcast
Enable simulcast (for VP8 and H264 only)
Definition publisher.h:152
struct millicast::PublisherOption::@1 codecs
Definition publisher.h:118
virtual void failed_to_stop_recording()=0
virtual void own_recording_stopped()=0
RecordingListener()=default
virtual void failed_to_start_recording()=0
virtual ~RecordingListener()=default
virtual void own_recording_started()=0