pub struct CaptureSession {
pub purpose: CapturePurpose,
pub intent_granted: bool,
pub sample_rate: u32,
pub channels: u16,
pub frames_captured: u64,
pub live: bool,
/* private fields */
}Expand description
Session state — cold construction; pull path is lock-free enough for tests.
Fields§
§purpose: CapturePurpose§intent_granted: bool§sample_rate: u32§channels: u16§frames_captured: u64§live: boolImplementations§
Source§impl CaptureSession
impl CaptureSession
pub const RING_CAP: usize
Sourcepub fn new(purpose: CapturePurpose, sample_rate: u32, channels: u16) -> Self
pub fn new(purpose: CapturePurpose, sample_rate: u32, channels: u16) -> Self
Creates a new instance.
Sourcepub fn grant_intent(&mut self)
pub fn grant_intent(&mut self)
User/shell grants capture for this purpose (Webizen intent).
Sourcepub fn revoke_intent(&mut self)
pub fn revoke_intent(&mut self)
Revokes intent.
Sourcepub fn start(&mut self) -> Result<(), AudioError>
pub fn start(&mut self) -> Result<(), AudioError>
Arm capture. Fails closed without intent.
Sourcepub fn push_mono(&mut self, samples: &[f32]) -> usize
pub fn push_mono(&mut self, samples: &[f32]) -> usize
Shell pushes mono PCM (device or file stream). Dropped if not live.
Trait Implementations§
Source§impl Clone for CaptureSession
impl Clone for CaptureSession
Auto Trait Implementations§
impl Freeze for CaptureSession
impl RefUnwindSafe for CaptureSession
impl Send for CaptureSession
impl Sync for CaptureSession
impl Unpin for CaptureSession
impl UnsafeUnpin for CaptureSession
impl UnwindSafe for CaptureSession
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