Trait bt_a2dp::media_task::MediaTaskBuilder
source · pub trait MediaTaskBuilder: Send + Sync {
// Required method
fn configure(
&self,
peer_id: &PeerId,
codec_config: &MediaCodecConfig
) -> Result<Box<dyn MediaTaskRunner>, 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§
sourcefn configure(
&self,
peer_id: &PeerId,
codec_config: &MediaCodecConfig
) -> Result<Box<dyn MediaTaskRunner>, MediaTaskError>
fn configure( &self, peer_id: &PeerId, codec_config: &MediaCodecConfig ) -> Result<Box<dyn MediaTaskRunner>, MediaTaskError>
Set up to stream based on the given codec_config
parameters.
Returns a MediaTaskRunner if the configuration is supported, and
MediaTaskError::NotSupported otherwise.