pub struct InjectionSynchronousProxy { /* private fields */ }
Implementations§
Source§impl InjectionSynchronousProxy
impl InjectionSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<InjectionEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<InjectionEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn write_input_audio(
&self,
index: i32,
audio_writer: Socket,
) -> Result<(), Error>
pub fn write_input_audio( &self, index: i32, audio_writer: Socket, ) -> Result<(), Error>
Set the audio to be injected at index
.
The first time this is called, an empty vector will be created, subsequent calls will
append to audio_data
to the same vector.
Use ClearInputAudio
to clear audio input data stored at index
.
Further requests on the same Injection connection are blocked until the audio_writer socket is drained completely. To determine when injection is complete, users may initiate a call to GetInputAudioSize immediately following the call to this method.
- request
index
refers a specificaudio_data
input record. We can have multiple records. - request
audio_writer
socket where audio data will be loaded from.
Sourcepub fn get_input_audio_size(
&self,
index: i32,
___deadline: MonotonicInstant,
) -> Result<InjectionGetInputAudioSizeResult, Error>
pub fn get_input_audio_size( &self, index: i32, ___deadline: MonotonicInstant, ) -> Result<InjectionGetInputAudioSizeResult, Error>
Get the size of audio data stored at index
.
This method returns the number of bytes of input data stored at the given index.
If a WriteInputAudio
call is pending for the given index,
this method will block until the socket is drained and the data
is fully stored.
- request
index
refers to a specificaudio_data
input record.
- response
error
description of failure action to take.
Sourcepub fn clear_input_audio(
&self,
index: i32,
___deadline: MonotonicInstant,
) -> Result<InjectionClearInputAudioResult, Error>
pub fn clear_input_audio( &self, index: i32, ___deadline: MonotonicInstant, ) -> Result<InjectionClearInputAudioResult, Error>
Clears audio data stored at index
.
If no data exists at index
nothing will get cleared, but no error will be returned.
- request
index
refers a specificaudio_data
input record to clear.
- response
error
description of failure action to take.
Sourcepub fn wait_until_input_is_done(
&self,
___deadline: MonotonicInstant,
) -> Result<InjectionWaitUntilInputIsDoneResult, Error>
pub fn wait_until_input_is_done( &self, ___deadline: MonotonicInstant, ) -> Result<InjectionWaitUntilInputIsDoneResult, Error>
Wait until injected inputs are done playing.
This function returns only when all injected audio tracks are complete.
This is intended to be called after calling StartInputInjection
.
If no tracks have been started, or all started tracks have already completed,
then this function will immediately return without error.
- response
error
description of failure action to take.
Sourcepub fn start_input_injection(
&self,
index: i32,
___deadline: MonotonicInstant,
) -> Result<InjectionStartInputInjectionResult, Error>
pub fn start_input_injection( &self, index: i32, ___deadline: MonotonicInstant, ) -> Result<InjectionStartInputInjectionResult, Error>
Start injecting the incoming audio for this device, using the audio at index
.
Before calling this, use WriteInputAudio
to store audio data at the given index.
- request
index
refers a specificaudio_data
input record to play on the virtual microphone.
- response
error
description of failure action to take.
Sourcepub fn stop_input_injection(
&self,
___deadline: MonotonicInstant,
) -> Result<InjectionStopInputInjectionResult, Error>
pub fn stop_input_injection( &self, ___deadline: MonotonicInstant, ) -> Result<InjectionStopInputInjectionResult, Error>
Stop injecting audio data.
This stops playing all injected tracks.
This is intended to be called after calling StartInputInjection
.
If no tracks have been started, or if all started tracks have already completed,
then this function will immediately return without error.
- response
error
description of failure action to take.
Trait Implementations§
Source§impl Debug for InjectionSynchronousProxy
impl Debug for InjectionSynchronousProxy
Source§impl From<Channel> for InjectionSynchronousProxy
impl From<Channel> for InjectionSynchronousProxy
Source§impl From<InjectionSynchronousProxy> for Handle
impl From<InjectionSynchronousProxy> for Handle
Source§fn from(value: InjectionSynchronousProxy) -> Self
fn from(value: InjectionSynchronousProxy) -> Self
Source§impl SynchronousProxy for InjectionSynchronousProxy
impl SynchronousProxy for InjectionSynchronousProxy
Source§type Proxy = InjectionProxy
type Proxy = InjectionProxy
Source§type Protocol = InjectionMarker
type Protocol = InjectionMarker
Proxy
controls.