bt_a2dp::media_task

Trait MediaTaskBuilder

Source
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§