-
- All Implemented Interfaces:
-
java.io.Serializable
public final class PublishOption extends Message<PublishOption, Nothing>
PublishOption represents the configuration options for publishing a track.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPublishOption.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<AudioBitrate>audio_bitrate_profilesprivate final TrackTypetrack_typeprivate final Codeccodecprivate final Integerbitrateprivate final Integerfpsprivate final Integermax_spatial_layersprivate final Integermax_temporal_layersprivate final VideoDimensionvideo_dimensionprivate final Integeridprivate final Booleanuse_single_layerprivate final DegradationPreferencedegradation_preferenceprivate final ProtoAdapter<PublishOption>adapterprivate final ByteStringunknownFields
-
Constructor Summary
Constructors Constructor Description PublishOption(TrackType track_type, Codec codec, Integer bitrate, Integer fps, Integer max_spatial_layers, Integer max_temporal_layers, VideoDimension video_dimension, Integer id, Boolean use_single_layer, List<AudioBitrate> audio_bitrate_profiles, DegradationPreference degradation_preference, ByteString unknownFields)
-
Method Summary
Modifier and Type Method Description final List<AudioBitrate>getAudio_bitrate_profiles()Audio bitrate profiles for different audio quality profiles. final TrackTypegetTrack_type()The type of the track being published (e.g., video, screenshare). final CodecgetCodec()The codec to be used for encoding the track (e.g., VP8, VP9, H264). final IntegergetBitrate()The target bitrate for the published track, in bits per second. final IntegergetFps()The target frames per second (FPS) for video encoding. final IntegergetMax_spatial_layers()The maximum number of spatial layers to send. final IntegergetMax_temporal_layers()The maximum number of temporal layers for scalable video coding (SVC). final VideoDimensiongetVideo_dimension()The dimensions of the video (e.g., width and height in pixels). final IntegergetId()The unique identifier for the publish request. final BooleangetUse_single_layer()If true, instructs the publisher to send only the highest available simulcast layer, disabling all lower layers. final DegradationPreferencegetDegradation_preference()The degradation preference for video encoding. final ProtoAdapter<PublishOption>adapter()final ByteStringunknownFields()VoidnewBuilder()Booleanequals(Object other)IntegerhashCode()StringtoString()final PublishOptioncopy(TrackType track_type, Codec codec, Integer bitrate, Integer fps, Integer max_spatial_layers, Integer max_temporal_layers, VideoDimension video_dimension, Integer id, Boolean use_single_layer, List<AudioBitrate> audio_bitrate_profiles, DegradationPreference degradation_preference, ByteString unknownFields)-
-
Constructor Detail
-
PublishOption
PublishOption(TrackType track_type, Codec codec, Integer bitrate, Integer fps, Integer max_spatial_layers, Integer max_temporal_layers, VideoDimension video_dimension, Integer id, Boolean use_single_layer, List<AudioBitrate> audio_bitrate_profiles, DegradationPreference degradation_preference, ByteString unknownFields)
-
-
Method Detail
-
getAudio_bitrate_profiles
final List<AudioBitrate> getAudio_bitrate_profiles()
Audio bitrate profiles for different audio quality profiles.
-
getTrack_type
final TrackType getTrack_type()
The type of the track being published (e.g., video, screenshare).
-
getBitrate
final Integer getBitrate()
The target bitrate for the published track, in bits per second.
-
getMax_spatial_layers
final Integer getMax_spatial_layers()
The maximum number of spatial layers to send.
For SVC (e.g., VP9), spatial layers downscale by a factor of 2:
1 layer: full resolution
2 layers: full resolution + half resolution
3 layers: full resolution + half resolution + quarter resolution
For non-SVC codecs (e.g., VP8/H264), this determines the number of encoded resolutions (e.g., quarter, half, full) sent for simulcast.
-
getMax_temporal_layers
final Integer getMax_temporal_layers()
The maximum number of temporal layers for scalable video coding (SVC). Temporal layers allow varying frame rates for different bandwidths.
-
getVideo_dimension
final VideoDimension getVideo_dimension()
The dimensions of the video (e.g., width and height in pixels). Spatial layers are based on this base resolution. For example, if the base resolution is 1280x720:
Full resolution (1 layer) = 1280x720
Half resolution (2 layers) = 640x360
Quarter resolution (3 layers) = 320x180
-
getId
final Integer getId()
The unique identifier for the publish request.
This
idis assigned exclusively by the SFU. Anyidset by the client in thePublishOptionwill be ignored and overwritten by the SFU.The primary purpose of this
idis to uniquely identify each publish request, even in scenarios where multiple publish requests for the sametrack_typeandcodecare active simultaneously. For example:This uniqueness ensures that individual requests can be managed independently. For instance, an
idis critical when stopping a specific publish request without affecting others.
-
getUse_single_layer
final Boolean getUse_single_layer()
If true, instructs the publisher to send only the highest available simulcast layer, disabling all lower layers. This applies to simulcast encodings. For SVC codecs, prefer using the L1T3 (single spatial, 3 temporal layers) mode instead.
-
getDegradation_preference
final DegradationPreference getDegradation_preference()
The degradation preference for video encoding.
-
adapter
final ProtoAdapter<PublishOption> adapter()
-
unknownFields
final ByteString unknownFields()
-
newBuilder
@Deprecated(message = Shouldn't be used in Kotlin, level = DeprecationLevel.HIDDEN) Void newBuilder()
-
copy
final PublishOption copy(TrackType track_type, Codec codec, Integer bitrate, Integer fps, Integer max_spatial_layers, Integer max_temporal_layers, VideoDimension video_dimension, Integer id, Boolean use_single_layer, List<AudioBitrate> audio_bitrate_profiles, DegradationPreference degradation_preference, ByteString unknownFields)
-
-
-
-