pub trait MediaTaskBuilder: Send + Sync + DynClone {
    // Required methods
    fn configure(
        &self,
        peer_id: &PeerId,
        codec_config: &MediaCodecConfig
    ) -> Result<Box<dyn MediaTaskRunner>, MediaTaskError>;
    fn direction(&self) -> EndpointType;
    fn supported_configs(
        &self,
        peer_id: &PeerId,
        offload: Option<AudioOffloadExtProxy>
    ) -> BoxFuture<'static, Result<Vec<MediaCodecConfig>, MediaTaskError>>;
}
Expand description

MediaTaskRunners are configured with information about the media codec when either peer in a conversation configures a stream endpoint. When successfully configured, they can start MediaTasks by accepting a MediaStream, which will provide or consume media on that stream until dropped or stopped.

A builder that will make media task runners from requested configurations.

Required Methods§

source

fn configure( &self, peer_id: &PeerId, codec_config: &MediaCodecConfig ) -> Result<Box<dyn MediaTaskRunner>, MediaTaskError>

Configure a new stream based on the given codec_config parameters. Returns a MediaTaskRunner if the configuration is supported, an MediaTaskError::NotSupported otherwise.

source

fn direction(&self) -> EndpointType

Return the direction of tasks created by this builder. Source tasks provide local encoded audio to a peer. Sink tasks consume encoded audio from a peer.

source

fn supported_configs( &self, peer_id: &PeerId, offload: Option<AudioOffloadExtProxy> ) -> BoxFuture<'static, Result<Vec<MediaCodecConfig>, MediaTaskError>>

Provide a set of encoded media configurations that this task can support. This can vary based on current system capabilities, and should be checked before communicating capabilities to each peer. offload is a proxy to the offload capabilities of the controller for this peer. Returns a future that resolves to the set of MediaCodecConfigs that this builder supports, typically one config per MediaCodecType, or an error if building the configs failed.

Trait Implementations§

source§

impl<'clone> Clone for Box<dyn MediaTaskBuilder + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn MediaTaskBuilder + Send + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn MediaTaskBuilder + Send + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn MediaTaskBuilder + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§