pub struct AudioCapturerProxy { /* private fields */ }

Implementations§

source§

impl AudioCapturerProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.media/AudioCapturer.

source

pub fn take_event_stream(&self) -> AudioCapturerEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

source

pub fn add_payload_buffer( &self, id: u32, payload_buffer: Vmo ) -> Result<(), Error>

Adds a payload buffer to the current buffer set associated with the connection. A StreamPacket struct reference a payload buffer in the current set by ID using the StreamPacket.payload_buffer_id field.

A buffer with ID id must not be in the current set when this method is invoked, otherwise the service will close the connection.

source

pub fn remove_payload_buffer(&self, id: u32) -> Result<(), Error>

Removes a payload buffer from the current buffer set associated with the connection.

A buffer with ID id must exist in the current set when this method is invoked, otherwise the service will will close the connection.

source

pub fn release_packet(&self, packet: &StreamPacket) -> Result<(), Error>

Releases payload memory associated with a packet previously delivered via OnPacketProduced.

source

pub fn discard_all_packets(&self) -> QueryResponseFut<()>

source

pub fn discard_all_packets_no_reply(&self) -> Result<(), Error>

source

pub fn set_pcm_stream_type( &self, stream_type: &AudioStreamType ) -> Result<(), Error>

Sets the stream type of the stream to be delivered. Causes the source material to be reformatted/resampled if needed in order to produce the requested stream type. Must be called before the payload buffer is established.

source

pub fn capture_at( &self, payload_buffer_id: u32, payload_offset: u32, frames: u32 ) -> QueryResponseFut<StreamPacket>

Explicitly specifies a region of the shared payload buffer for the audio input to capture into.

source

pub fn start_async_capture(&self, frames_per_packet: u32) -> Result<(), Error>

Places the AudioCapturer into ‘async’ capture mode and begin to produce packets of exactly ‘frames_per_packet’ number of frames each. The OnPacketProduced event (of StreamSink) will be used to inform the client of produced packets.

source

pub fn stop_async_capture(&self) -> QueryResponseFut<()>

Stops capturing in ‘async’ capture mode and (optionally) deliver a callback that may be used by the client if explicit synchronization is needed.

source

pub fn stop_async_capture_no_reply(&self) -> Result<(), Error>

source

pub fn bind_gain_control( &self, gain_control_request: ServerEnd<GainControlMarker> ) -> Result<(), Error>

Binds to the gain control for this AudioCapturer.

source

pub fn get_reference_clock(&self) -> QueryResponseFut<Clock>

Retrieves the stream’s reference clock. The returned handle will have READ, DUPLICATE and TRANSFER rights, and will refer to a zx::clock that is MONOTONIC and CONTINUOUS.

source

pub fn set_reference_clock( &self, reference_clock: Option<Clock> ) -> Result<(), Error>

Sets the reference clock that controls this capturer’s playback rate. If the input parameter is a valid zx::clock, it must have READ, DUPLICATE, TRANSFER rights and refer to a clock that is both MONOTONIC and CONTINUOUS. If instead an invalid clock is passed (such as the uninitialized zx::clock()), this indicates that the stream will use a ‘flexible’ clock generated by AudioCore that tracks the audio device.

SetReferenceClock cannot be called after the capturer payload buffer has been added. It also cannot be called a second time (even before capture). If the client wants a reference clock that is initially CLOCK_MONOTONIC but may diverge at some later time, they should create a clone of the monotonic clock, set this as the stream’s reference clock, then rate-adjust it subsequently as needed.

source

pub fn set_usage(&self, usage: AudioCaptureUsage) -> Result<(), Error>

Sets the usage of the capture stream. This may be changed on the fly, but packets in flight may be affected by the new usage. By default the Capturer is created with the FOREGROUND usage.

source

pub fn get_stream_type(&self) -> QueryResponseFut<StreamType>

Gets the currently configured stream type. Note: for an AudioCapturer which was just created and has not yet had its stream type explicitly set, this will retrieve the stream type – at the time the AudioCapturer was created – of the source (input or looped-back output) to which the AudioCapturer is bound. Even if this matches the client’s desired format, SetPcmStreamType must still be called.

Trait Implementations§

source§

impl AudioCapturerProxyInterface for AudioCapturerProxy

source§

fn add_payload_buffer(&self, id: u32, payload_buffer: Vmo) -> Result<(), Error>

source§

fn remove_payload_buffer(&self, id: u32) -> Result<(), Error>

source§

fn release_packet(&self, packet: &StreamPacket) -> Result<(), Error>

§

type DiscardAllPacketsResponseFut = QueryResponseFut<()>

source§

fn discard_all_packets(&self) -> Self::DiscardAllPacketsResponseFut

source§

fn discard_all_packets_no_reply(&self) -> Result<(), Error>

source§

fn set_pcm_stream_type( &self, stream_type: &AudioStreamType ) -> Result<(), Error>

§

type CaptureAtResponseFut = QueryResponseFut<StreamPacket>

source§

fn capture_at( &self, payload_buffer_id: u32, payload_offset: u32, frames: u32 ) -> Self::CaptureAtResponseFut

source§

fn start_async_capture(&self, frames_per_packet: u32) -> Result<(), Error>

§

type StopAsyncCaptureResponseFut = QueryResponseFut<()>

source§

fn stop_async_capture(&self) -> Self::StopAsyncCaptureResponseFut

source§

fn stop_async_capture_no_reply(&self) -> Result<(), Error>

source§

fn bind_gain_control( &self, gain_control_request: ServerEnd<GainControlMarker> ) -> Result<(), Error>

§

type GetReferenceClockResponseFut = QueryResponseFut<Clock>

source§

fn get_reference_clock(&self) -> Self::GetReferenceClockResponseFut

source§

fn set_reference_clock( &self, reference_clock: Option<Clock> ) -> Result<(), Error>

source§

fn set_usage(&self, usage: AudioCaptureUsage) -> Result<(), Error>

§

type GetStreamTypeResponseFut = QueryResponseFut<StreamType>

source§

fn get_stream_type(&self) -> Self::GetStreamTypeResponseFut

source§

impl Clone for AudioCapturerProxy

source§

fn clone(&self) -> AudioCapturerProxy

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 Debug for AudioCapturerProxy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Proxy for AudioCapturerProxy

§

type Protocol = AudioCapturerMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more