stream.h
This file includes the type definition for an audio-video stream along with several function declarations useful when handling it.
Includes: config.h, connection.h
typedef otc_stream
Type definition for a struct representing an audio-video stream in an OpenTok session.
typedef struct otc_stream otc_stream;
enum otc_stream_video_type
Stream video type enumeration.
This enumeration represents the different stream video types supported.
| Name | Value | Description |
|---|---|---|
OTC_STREAM_VIDEO_TYPE_CAMERA |
1 |
Camera video stream. |
OTC_STREAM_VIDEO_TYPE_SCREEN |
2 |
Screen video stream. This is used for screen-sharing. |
OTC_STREAM_VIDEO_TYPE_CUSTOM |
3 |
Custom video stream. |
Functions
| Name | Description |
|---|---|
otc_stream_get_id(stream) → {const char *} |
Gets the unique identifier for this stream. |
otc_stream_get_name(stream) → {const char *} |
Gets the name of the stream. |
otc_stream_has_video_track(stream) → {otc_bool} |
Checks whether this stream contains a video track or not. |
otc_stream_has_video(stream) → {otc_bool} |
Checks whether this stream is currently publishing video or not. |
otc_stream_has_audio_track(stream) → {otc_bool} |
Checks whether this stream contains an audio track or not. |
otc_stream_has_audio(stream) → {otc_bool} |
Checks whether this stream is currently publishing audio or not. |
otc_stream_has_captions(stream) → {otc_bool} |
Checks whether this stream is currently publishing captions or not. |
otc_stream_copy(stream) → {otc_stream *} |
Makes a copy of a stream. |
otc_stream_delete(stream) → {otc_status} |
Releases resources associated with the stream. |
otc_stream_get_video_width(stream) → {int} |
Returns the width of the publisher's capturer target resolution, in pixels, as last signaled to the session. |
otc_stream_get_video_height(stream) → {int} |
Returns the height of the publisher's capturer target resolution, in pixels, as last signaled to the session. |
otc_stream_get_creation_time(stream) → {int64_t} |
Gets the creation time of the stream. |
otc_stream_get_video_type(stream) → {enum otc_stream_video_type} |
Returns the video type of the stream. |
otc_stream_get_connection(stream) → {const otc_connection *} |
Get the connection associated with the client publishing the stream. |
otc_stream_get_id(stream) → {const char *}
Gets the unique identifier for this stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream. |
Returns:
The unique identifier for this stream.
otc_stream_get_name(stream) → {const char *}
Gets the name of the stream. The publisher of the stream can set this name to identify the stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
The stream name.
otc_stream_has_video_track(stream) → {otc_bool}
Checks whether this stream contains a video track or not.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
Return value indicating whether this stream contains a video track or not.
otc_stream_has_video(stream) → {otc_bool}
Checks whether this stream is currently publishing video or not.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
Return value indicating whether this stream is publishing video or not.
otc_stream_has_audio_track(stream) → {otc_bool}
Checks whether this stream contains an audio track or not.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
Return value indicating whether this stream contains an audio track or not.
otc_stream_has_audio(stream) → {otc_bool}
Checks whether this stream is currently publishing audio or not.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
Return value indicating whether this stream is publishing audio or not.
otc_stream_has_captions(stream) → {otc_bool}
Checks whether this stream is currently publishing captions or not.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
Return value indicating whether this stream is publishing captions or not.
otc_stream_copy(stream) → {otc_stream *}
Makes a copy of a stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream to be copied. |
Returns:
A copy of the stream. This can be null if there is an error.
otc_stream_delete(stream) → {otc_status}
Releases resources associated with the stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
otc_stream * | The stream being queried. |
Returns:
Return value indicating either error or success.
otc_stream_get_video_width(stream) → {int}
Returns the width of the publisher's capturer target resolution, in pixels, as last signaled to the session. This value is broadcast to all session participants and is readable on both the publishing and subscribing clients.
Note: This represents the publisher's capturer target resolution, not the resolution actually encoded or received by a subscriber. The publisher may encode at a lower resolution due to bandwidth or CPU constraints. For streams published using the scalable video feature, this is set to the width of the maximum resolution available for the stream. For more information on scalable video, see the documentation for the OpenTok Media Router.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
The width, in pixels, of the publisher's capturer target resolution.
otc_stream_get_video_height(stream) → {int}
Returns the height of the publisher's capturer target resolution, in pixels, as last signaled to the session. This value is broadcast to all session participants and is readable on both the publishing and subscribing clients.
Note: This represents the publisher's capturer target resolution, not the resolution actually encoded or received by a subscriber. The publisher may encode at a lower resolution due to bandwidth or CPU constraints.
For streams published using the scalable video feature, this is set to the height of the maximum resolution available for the stream. For more information on scalable video, see the documentation for the OpenTok Media Router.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
The height, in pixels, of the publisher's capturer target resolution.
otc_stream_get_creation_time(stream) → {int64_t}
Gets the creation time of the stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
The timestamp for the creation time of the stream.
otc_stream_get_video_type(stream) → {enum otc_stream_video_type}
Returns the video type of the stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
See: : - otc_stream_video_type
Returns:
The video type of the stream.
otc_stream_get_connection(stream) → {const otc_connection *}
Get the connection associated with the client publishing the stream.
Parameters:
| Name | Type | Description |
|---|---|---|
stream |
const otc_stream * | The stream being queried. |
Returns:
The connection associated with the client publishing the stream.