17#ifndef AWS_IVS_REALTIME_H
18#define AWS_IVS_REALTIME_H
27#define AWS_IVS_REALTIME_VERSION_MAJOR 1
28#define AWS_IVS_REALTIME_VERSION_MINOR 49
29#define AWS_IVS_REALTIME_VERSION_PATCH 0
30#define AWS_IVS_REALTIME_VERSION_STRING "1.49.0"
32#if defined(__GNUC__) || defined(__clang__)
33# define AWS_IVS_REALTIME_API __attribute__((visibility("default")))
34# define AWS_IVS_REALTIME_NODISCARD __attribute__((warn_unused_result))
36# define AWS_IVS_REALTIME_API
37# define AWS_IVS_REALTIME_NODISCARD
358 size_t bytes_per_sample,
360 uint32_t samples_per_sec,
361 int64_t timestamp_ms,
456 size_t streams_count,
474 size_t streams_count,
490 size_t streams_count,
689 uint32_t samples_per_sec,
774 const char* participant_id,
865 const char* language_code,
867 const char* utterance_id,
898 const char** out_version,
948 const char** out_stream_id,
1286 const char** out_stream_id,
void(*) aws_ivs_realtime_participant_publish_state_changed_cb(const aws_ivs_realtime_participant_info *participant, aws_ivs_realtime_publish_state publish_state, void *user_data)
A participant's publish state changed.
Definition aws_ivs_realtime.h:420
AWS_IVS_REALTIME_API bool aws_ivs_realtime_audio_source_push_buffer(aws_ivs_realtime_audio_source *audio_source, const uint8_t *data, size_t data_size, size_t num_frames, int64_t pts, aws_ivs_realtime_error **out_error)
Push one buffer of PCM to publish. The SDK copies the buffer before returning. Push in real time,...
void(*) aws_ivs_realtime_participant_subscribe_state_changed_cb(const aws_ivs_realtime_participant_info *participant, aws_ivs_realtime_subscribe_state subscribe_state, void *user_data)
The local participant's subscribe state changed with respect to a remote publisher....
Definition aws_ivs_realtime.h:435
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_set_audio_callback(aws_ivs_realtime_stage *stage, aws_ivs_realtime_audio_cb callback, void *user_data, aws_ivs_realtime_error **out_error)
Register the mixed-PCM audio callback. Call this before aws_ivs_realtime_stage_join or after aws_ivs_...
AWS_IVS_REALTIME_API bool aws_ivs_realtime_channel_transcriber_write_transcription(aws_ivs_realtime_channel_transcriber *channel_transcriber, int64_t start_ms, int64_t end_ms, const char *language_code, const char *text, const char *utterance_id, aws_ivs_realtime_error **out_error)
Submit a transcription result for delivery to the Stage. Safe to call from any thread....
void(*) aws_ivs_realtime_participant_left_cb(const aws_ivs_realtime_participant_info *participant, void *user_data)
A participant left the Stage or stopped publishing.
Definition aws_ivs_realtime.h:396
AWS_IVS_REALTIME_API void aws_ivs_realtime_stage_destroy(aws_ivs_realtime_stage *stage)
Leave if necessary and free the handle. Idempotent on null. Must be called exactly once for each succ...
void(*) aws_ivs_realtime_error_cb(const aws_ivs_realtime_error *error, void *user_data)
An asynchronous error that does not change the connection state. The Stage stays connected....
Definition aws_ivs_realtime.h:506
struct aws_ivs_realtime_stage_stream aws_ivs_realtime_stage_stream
Definition aws_ivs_realtime.h:232
AWS_IVS_REALTIME_API void aws_ivs_realtime_channel_transcriber_destroy(aws_ivs_realtime_channel_transcriber *channel_transcriber)
Free a channel transcriber handle. Idempotent on null. Destroy any Stage still using this transcriber...
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_stream_get_is_muted(aws_ivs_realtime_stage_stream *stage_stream, bool *out_is_muted, aws_ivs_realtime_error **out_error)
Whether the stream is muted on the Stage, meaning no media reaches any subscriber....
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_create(const char *token, aws_ivs_realtime_stage_strategy *stage_strategy, const aws_ivs_realtime_stage_event_callbacks *stage_event_callbacks, aws_ivs_realtime_stage **out_stage, aws_ivs_realtime_error **out_error)
Create a Stage from a valid IVS Stage participant token. This does not connect to the Stage; call aws...
#define AWS_IVS_REALTIME_NODISCARD
Definition aws_ivs_realtime.h:37
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_local_subtitle_stream_create(aws_ivs_realtime_local_subtitle_stream **out_local_subtitle_stream, aws_ivs_realtime_error **out_error)
Create a subtitle stream. It publishes nothing until a strategy names it in aws_ivs_realtime_publish_...
struct aws_ivs_realtime_publish_streams aws_ivs_realtime_publish_streams
Definition aws_ivs_realtime.h:211
aws_ivs_realtime_pcm_format
Definition aws_ivs_realtime.h:127
@ AWS_IVS_REALTIME_PCM_FORMAT_F64_PLANAR
Definition aws_ivs_realtime.h:159
@ AWS_IVS_REALTIME_PCM_FORMAT_F32_INTERLEAVED
Definition aws_ivs_realtime.h:139
@ AWS_IVS_REALTIME_PCM_FORMAT_S16_PLANAR
Definition aws_ivs_realtime.h:135
@ AWS_IVS_REALTIME_PCM_FORMAT_S16_INTERLEAVED
Definition aws_ivs_realtime.h:131
@ AWS_IVS_REALTIME_PCM_FORMAT_S32_INTERLEAVED
Definition aws_ivs_realtime.h:147
@ AWS_IVS_REALTIME_PCM_FORMAT_F32_PLANAR
Definition aws_ivs_realtime.h:143
@ AWS_IVS_REALTIME_PCM_FORMAT_S32_PLANAR
Definition aws_ivs_realtime.h:151
@ AWS_IVS_REALTIME_PCM_FORMAT_F64_INTERLEAVED
Definition aws_ivs_realtime.h:155
void(*) aws_ivs_realtime_streams_added_cb(const aws_ivs_realtime_participant_info *participant, aws_ivs_realtime_stage_stream *const *streams, size_t streams_count, void *user_data)
A participant added streams. For a remote participant this is the result of a subscription taking eff...
Definition aws_ivs_realtime.h:453
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_audio_source_create(uint32_t samples_per_sec, size_t num_channels, aws_ivs_realtime_pcm_format format, aws_ivs_realtime_audio_source **out_audio_source, aws_ivs_realtime_error **out_error)
Create an audio source. samples_per_sec, num_channels, and format describe every buffer you push to i...
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_refresh_strategy(aws_ivs_realtime_stage *stage, aws_ivs_realtime_error **out_error)
Ask the SDK to re-query the strategy. Every strategy callback is invoked again for the participants i...
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_strategy_create(const aws_ivs_realtime_stage_strategy_callbacks *callbacks, aws_ivs_realtime_stage_strategy **out_stage_strategy, aws_ivs_realtime_error **out_error)
Create a stage strategy backed by application callbacks. Every required callback in the table must be...
aws_ivs_realtime_subscribe_state
Definition aws_ivs_realtime.h:83
@ AWS_IVS_REALTIME_SUBSCRIBE_STATE_ATTEMPTING_SUBSCRIBE
Definition aws_ivs_realtime.h:91
@ AWS_IVS_REALTIME_SUBSCRIBE_STATE_SUBSCRIBED
Definition aws_ivs_realtime.h:95
@ AWS_IVS_REALTIME_SUBSCRIBE_STATE_NOT_SUBSCRIBED
Definition aws_ivs_realtime.h:87
void(*) aws_ivs_realtime_streams_removed_cb(const aws_ivs_realtime_participant_info *participant, aws_ivs_realtime_stage_stream *const *streams, size_t streams_count, void *user_data)
A participant removed streams. They could have unpublished, stopped sharing a certain stream type,...
Definition aws_ivs_realtime.h:471
bool(*) aws_ivs_realtime_should_publish_cb(const aws_ivs_realtime_participant_info *participant, void *user_data)
Ask whether to publish as a participant. Return true to publish, false to stop publishing....
Definition aws_ivs_realtime.h:541
void(*) aws_ivs_realtime_participant_joined_cb(const aws_ivs_realtime_participant_info *participant, void *user_data)
A participant joined the Stage.
Definition aws_ivs_realtime.h:385
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_stream_clone(aws_ivs_realtime_stage_stream *source, aws_ivs_realtime_stage_stream **out_stage_stream, aws_ivs_realtime_error **out_error)
Retain a stream past the callback that delivered it. The result refers to the same stream and keeps a...
aws_ivs_realtime_connection_state
Definition aws_ivs_realtime.h:47
@ AWS_IVS_REALTIME_CONNECTION_STATE_CONNECTING
Definition aws_ivs_realtime.h:55
@ AWS_IVS_REALTIME_CONNECTION_STATE_CONNECTED
Definition aws_ivs_realtime.h:59
@ AWS_IVS_REALTIME_CONNECTION_STATE_DISCONNECTED
Definition aws_ivs_realtime.h:51
struct aws_ivs_realtime_channel_transcriber aws_ivs_realtime_channel_transcriber
Definition aws_ivs_realtime.h:182
AWS_IVS_REALTIME_API bool aws_ivs_realtime_publish_streams_add_subtitle_stream(aws_ivs_realtime_publish_streams *publish_streams, aws_ivs_realtime_local_subtitle_stream *subtitle_stream, aws_ivs_realtime_error **out_error)
Publish subtitle cues from this stream. Naming the same stream twice adds it once....
AWS_IVS_REALTIME_API void aws_ivs_realtime_local_subtitle_stream_destroy(aws_ivs_realtime_local_subtitle_stream *local_subtitle_stream)
Free a subtitle stream handle. Idempotent on null. Destroying a stream a Stage is publishing stops th...
AWS_IVS_REALTIME_API bool aws_ivs_realtime_publish_streams_set_audio(aws_ivs_realtime_publish_streams *publish_streams, aws_ivs_realtime_audio_source *audio, aws_ivs_realtime_error **out_error)
Publish audio from this source. Passing null publishes no audio. Calling this more than once replaces...
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_stream_set_audio_callback(aws_ivs_realtime_stage_stream *stage_stream, aws_ivs_realtime_audio_cb callback, void *user_data, aws_ivs_realtime_error **out_error)
Register a callback receiving only this stream's audio, before it is mixed with any other participant...
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_stream_get_stream_type(aws_ivs_realtime_stage_stream *stage_stream, aws_ivs_realtime_stream_type *out_stream_type, aws_ivs_realtime_error **out_error)
The kind of content this stream carries. This applies to a published stream and to a subscribed strea...
AWS_IVS_REALTIME_API void aws_ivs_realtime_stage_stream_destroy(aws_ivs_realtime_stage_stream *stage_stream)
Release a handle from aws_ivs_realtime_stage_stream_clone. Null is a no-op. Do not pass a handle deli...
void(*) aws_ivs_realtime_participant_metadata_updated_cb(const aws_ivs_realtime_participant_info *participant, void *user_data)
A participant's metadata changed (user_id or attributes). The participant snapshot is a new value sha...
Definition aws_ivs_realtime.h:409
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_stream_get_stream_id(aws_ivs_realtime_stage_stream *stage_stream, const char **out_stream_id, aws_ivs_realtime_error **out_error)
The stream's identifier, fixed for its lifetime and unique within the Stage. Two handles name the sam...
AWS_IVS_REALTIME_API void aws_ivs_realtime_error_destroy(aws_ivs_realtime_error *error)
Free an error returned through an out_error parameter. Idempotent on null. Never pass an error receiv...
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_channel_transcriber_create(const char *participant_id, aws_ivs_realtime_channel_transcriber **out_channel_transcriber, aws_ivs_realtime_error **out_error)
Create a channel transcriber for one remote participant. It owns a stage strategy,...
struct aws_ivs_realtime_stage_strategy aws_ivs_realtime_stage_strategy
Definition aws_ivs_realtime.h:221
AWS_IVS_REALTIME_API bool aws_ivs_realtime_get_version(const char **out_version, aws_ivs_realtime_error **out_error)
Retrieve the SDK version string, a NUL-terminated UTF-8 string.
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_leave(aws_ivs_realtime_stage *stage, aws_ivs_realtime_error **out_error)
Leave the Stage. A no-op if not joined. The connection transitions to DISCONNECTED....
struct aws_ivs_realtime_local_subtitle_stream aws_ivs_realtime_local_subtitle_stream
Definition aws_ivs_realtime.h:196
void(*) aws_ivs_realtime_connection_state_changed_cb(aws_ivs_realtime_connection_state state, const aws_ivs_realtime_error *error, void *user_data)
The Stage connection state changed.
Definition aws_ivs_realtime.h:373
void(*) aws_ivs_realtime_streams_muted_changed_cb(const aws_ivs_realtime_participant_info *participant, aws_ivs_realtime_stage_stream *const *streams, size_t streams_count, void *user_data)
One or more streams changed mute state.
Definition aws_ivs_realtime.h:487
void(*) aws_ivs_realtime_cue_sent_cb(const aws_ivs_realtime_error *error, void *user_data)
Reports what became of the one cue passed to the aws_ivs_realtime_local_subtitle_stream_send_cue call...
Definition aws_ivs_realtime.h:328
AWS_IVS_REALTIME_NODISCARD AWS_IVS_REALTIME_API bool aws_ivs_realtime_channel_transcriber_get_strategy(aws_ivs_realtime_channel_transcriber *channel_transcriber, aws_ivs_realtime_stage_strategy **out_stage_strategy, aws_ivs_realtime_error **out_error)
Return the stage strategy owned by this transcriber, for passing to aws_ivs_realtime_stage_create.
struct aws_ivs_realtime_audio_source aws_ivs_realtime_audio_source
Definition aws_ivs_realtime.h:170
AWS_IVS_REALTIME_API bool aws_ivs_realtime_local_subtitle_stream_send_cue(aws_ivs_realtime_local_subtitle_stream *local_subtitle_stream, const aws_ivs_realtime_subtitle_cue *cue, aws_ivs_realtime_cue_sent_cb callback, void *user_data, aws_ivs_realtime_error **out_error)
Send one subtitle cue. A synchronous failure does not call callback. A successful return means the SD...
#define AWS_IVS_REALTIME_API
Definition aws_ivs_realtime.h:36
uint32_t aws_ivs_realtime_stream_type
Definition aws_ivs_realtime.h:103
void(*) aws_ivs_realtime_streams_to_publish_cb(const aws_ivs_realtime_participant_info *participant, aws_ivs_realtime_publish_streams *streams, void *user_data)
Name what to publish as a participant. Invoked after should_publish returns true for the same partici...
Definition aws_ivs_realtime.h:565
AWS_IVS_REALTIME_API bool aws_ivs_realtime_stage_join(aws_ivs_realtime_stage *stage, aws_ivs_realtime_error **out_error)
Connect to the Stage associated with the token and begin the callback flow. Connection progress is re...
aws_ivs_realtime_publish_state
Definition aws_ivs_realtime.h:65
@ AWS_IVS_REALTIME_PUBLISH_STATE_PUBLISHED
Definition aws_ivs_realtime.h:77
@ AWS_IVS_REALTIME_PUBLISH_STATE_NOT_PUBLISHED
Definition aws_ivs_realtime.h:69
@ AWS_IVS_REALTIME_PUBLISH_STATE_ATTEMPTING_PUBLISH
Definition aws_ivs_realtime.h:73
AWS_IVS_REALTIME_API bool aws_ivs_realtime_local_subtitle_stream_get_stream_id(aws_ivs_realtime_local_subtitle_stream *local_subtitle_stream, const char **out_stream_id, aws_ivs_realtime_error **out_error)
The stream's identifier, fixed for its lifetime and unique within the Stage. It matches the id on the...
struct aws_ivs_realtime_stage aws_ivs_realtime_stage
Definition aws_ivs_realtime.h:203
AWS_IVS_REALTIME_API void aws_ivs_realtime_audio_source_destroy(aws_ivs_realtime_audio_source *audio_source)
Free an audio source handle. Idempotent on null. You can destroy a source that a Stage is publishing;...
@ AWS_IVS_REALTIME_STREAM_TYPE_VIDEO
Definition aws_ivs_realtime.h:116
@ AWS_IVS_REALTIME_STREAM_TYPE_NONE
Definition aws_ivs_realtime.h:108
@ AWS_IVS_REALTIME_STREAM_TYPE_SUBTITLE
Definition aws_ivs_realtime.h:120
@ AWS_IVS_REALTIME_STREAM_TYPE_AUDIO
Definition aws_ivs_realtime.h:112
AWS_IVS_REALTIME_API void aws_ivs_realtime_stage_strategy_destroy(aws_ivs_realtime_stage_strategy *stage_strategy)
Free a stage strategy handle. Idempotent on null. Destroy any Stage still using a stage strategy befo...
aws_ivs_realtime_stream_type(*) aws_ivs_realtime_subscription_types_cb(const aws_ivs_realtime_participant_info *participant, void *user_data)
Ask which stream types to subscribe to from a participant. Return NONE (0) to skip the participant,...
Definition aws_ivs_realtime.h:525
void(*) aws_ivs_realtime_audio_cb(const uint8_t *data, size_t data_size, size_t num_frames, size_t bytes_per_sample, size_t num_channels, uint32_t samples_per_sec, int64_t timestamp_ms, void *user_data)
Receives interleaved mixed PCM from subscribed remote participants. Call aws_ivs_realtime_stage_set_a...
Definition aws_ivs_realtime.h:354
Generated error codes for the IVS Linux Broadcast SDK.
Definition aws_ivs_realtime_errors.h:802
Definition aws_ivs_realtime.h:275
const char * participant_id
Definition aws_ivs_realtime.h:280
const char * user_id
Definition aws_ivs_realtime.h:285
const char *const * attributes_keys
Definition aws_ivs_realtime.h:300
const char *const * attributes_values
Definition aws_ivs_realtime.h:305
bool is_local
Definition aws_ivs_realtime.h:289
size_t attributes_count
Definition aws_ivs_realtime.h:294
Definition aws_ivs_realtime.h:573
aws_ivs_realtime_streams_muted_changed_cb on_streams_muted_changed
Definition aws_ivs_realtime.h:619
aws_ivs_realtime_streams_removed_cb on_streams_removed
Definition aws_ivs_realtime.h:615
aws_ivs_realtime_participant_left_cb on_participant_left
Definition aws_ivs_realtime.h:595
aws_ivs_realtime_participant_publish_state_changed_cb on_participant_publish_state_changed
Definition aws_ivs_realtime.h:603
aws_ivs_realtime_streams_added_cb on_streams_added
Definition aws_ivs_realtime.h:611
aws_ivs_realtime_participant_subscribe_state_changed_cb on_participant_subscribe_state_changed
Definition aws_ivs_realtime.h:607
size_t size
Definition aws_ivs_realtime.h:578
aws_ivs_realtime_connection_state_changed_cb on_connection_state_changed
Definition aws_ivs_realtime.h:587
aws_ivs_realtime_participant_joined_cb on_participant_joined
Definition aws_ivs_realtime.h:591
aws_ivs_realtime_participant_metadata_updated_cb on_participant_metadata_updated
Definition aws_ivs_realtime.h:599
void * user_data
Definition aws_ivs_realtime.h:583
aws_ivs_realtime_error_cb on_error
Definition aws_ivs_realtime.h:623
Definition aws_ivs_realtime.h:635
aws_ivs_realtime_should_publish_cb should_publish
Definition aws_ivs_realtime.h:652
aws_ivs_realtime_subscription_types_cb subscription_types
Definition aws_ivs_realtime.h:648
void * user_data
Definition aws_ivs_realtime.h:644
aws_ivs_realtime_streams_to_publish_cb streams_to_publish
Definition aws_ivs_realtime.h:656
size_t size
Definition aws_ivs_realtime.h:640
Definition aws_ivs_realtime.h:237
const char * target_participant_id
Definition aws_ivs_realtime.h:252
int64_t start_time_ms
Definition aws_ivs_realtime.h:265
const char * language_code
Definition aws_ivs_realtime.h:247
const char * text
Definition aws_ivs_realtime.h:241
int64_t end_time_ms
Definition aws_ivs_realtime.h:269
const char * language_label
Definition aws_ivs_realtime.h:258