Struct bt_a2dp::media_task::tests::TestMediaTaskRunner
source · pub struct TestMediaTaskRunner {
pub peer_id: PeerId,
pub codec_config: MediaCodecConfig,
pub reconfigurable: bool,
pub supports_set_delay: bool,
pub set_delay: Option<Duration>,
pub sender: Sender<TestMediaTask>,
}
Fields§
§peer_id: PeerId
The peer_id this was started with.
codec_config: MediaCodecConfig
The config that this runner will start tasks for
reconfigurable: bool
If this is reconfigurable
supports_set_delay: bool
If this supports delay reporting
set_delay: Option<Duration>
What the delay is right now
sender: Sender<TestMediaTask>
The Sender that will send a clone of the started tasks to the builder.
Trait Implementations§
source§impl MediaTaskRunner for TestMediaTaskRunner
impl MediaTaskRunner for TestMediaTaskRunner
source§fn start(
&mut self,
stream: MediaStream,
_offload: Option<AudioOffloadExtProxy>,
) -> Result<Box<dyn MediaTask>, MediaTaskError>
fn start( &mut self, stream: MediaStream, _offload: Option<AudioOffloadExtProxy>, ) -> Result<Box<dyn MediaTask>, MediaTaskError>
Start a MediaTask using the MediaStream given.
If the task started, returns a MediaTask which will finish if the stream ends or an
error occurs, and can be stopped using
MediaTask::stop
or by dropping the MediaTask.
This can fail with MediaTaskError::ResourcesInUse if a MediaTask cannot be started because
one is already running.source§fn set_delay(&mut self, delay: Duration) -> Result<(), MediaTaskError>
fn set_delay(&mut self, delay: Duration) -> Result<(), MediaTaskError>
Set the delay reported from the peer for this media task.
This should configure the media source or sink to attempt to compensate.
Typically this is zero for Sink tasks, but Source tasks can receive this info from the peer.
May only be supported before start.
If an Error is returned, the delay has not been set.
source§fn reconfigure(
&mut self,
config: &MediaCodecConfig,
) -> Result<(), MediaTaskError>
fn reconfigure( &mut self, config: &MediaCodecConfig, ) -> Result<(), MediaTaskError>
Try to reconfigure the MediaTask to accept a new configuration. This differs from
MediaTaskBuilder::configure
as it attempts to preserve the same configured session.
The runner remains configured with the initial configuration on an error.Auto Trait Implementations§
impl Freeze for TestMediaTaskRunner
impl !RefUnwindSafe for TestMediaTaskRunner
impl Send for TestMediaTaskRunner
impl Sync for TestMediaTaskRunner
impl Unpin for TestMediaTaskRunner
impl !UnwindSafe for TestMediaTaskRunner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more