pub struct CarrierResampler<C: FfmpegCarrier> { /* private fields */ }Available on crate feature
resample only.Expand description
mediadecode::resampler::AudioResampler impl wrapping
swresample.
Construction is Self::new, off the trait, taking both specs —
see the trait’s own documentation for why the target can never be a
constant.
Implementations§
Source§impl CarrierResampler<View>
impl CarrierResampler<View>
Sourcepub fn new(
source: ResampleSpec,
target: ResampleSpec,
limits: FrameLimits,
) -> Result<Self, ResampleError>
pub fn new( source: ResampleSpec, target: ResampleSpec, limits: FrameLimits, ) -> Result<Self, ResampleError>
Opens a resampler between two explicit specs. See
CarrierResampler::new_impl for the full contract.
Sourcepub const fn source(&self) -> &ResampleSpec
pub const fn source(&self) -> &ResampleSpec
The spec frames must arrive in.
Sourcepub const fn target(&self) -> &ResampleSpec
pub const fn target(&self) -> &ResampleSpec
The spec frames leave in.
Source§impl CarrierResampler<Owned>
impl CarrierResampler<Owned>
Sourcepub fn new(
source: ResampleSpec,
target: ResampleSpec,
limits: FrameLimits,
) -> Result<Self, ResampleError>
pub fn new( source: ResampleSpec, target: ResampleSpec, limits: FrameLimits, ) -> Result<Self, ResampleError>
Opens a resampler between two explicit specs. See
CarrierResampler::new_impl for the full contract.
Sourcepub const fn source(&self) -> &ResampleSpec
pub const fn source(&self) -> &ResampleSpec
The spec frames must arrive in.
Sourcepub const fn target(&self) -> &ResampleSpec
pub const fn target(&self) -> &ResampleSpec
The spec frames leave in.
Trait Implementations§
Source§impl AudioResampler for CarrierResampler<View>
impl AudioResampler for CarrierResampler<View>
Source§type Adapter = Ffmpeg
type Adapter = Ffmpeg
Backend vocabulary. The source and target specs are both
expressed in it.
Source§type Buffer = <View as FfmpegCarrier>::Buffer
type Buffer = <View as FfmpegCarrier>::Buffer
Buffer type held by the frames this resampler accepts and
produces.
Source§type Error = ResampleError
type Error = ResampleError
Resampler-specific error type. Carries both the
“nothing ready yet” signal out of
receive_frame
and the mid-stream-change refusal out of
send_frame.Source§fn send_frame(
&mut self,
frame: &AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <View as FfmpegCarrier>::Buffer>,
) -> Result<(), ResampleError>
fn send_frame( &mut self, frame: &AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <View as FfmpegCarrier>::Buffer>, ) -> Result<(), ResampleError>
Submits one decoded frame. Read more
Source§fn receive_frame(
&mut self,
dst: &mut AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <View as FfmpegCarrier>::Buffer>,
) -> Result<(), ResampleError>
fn receive_frame( &mut self, dst: &mut AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <View as FfmpegCarrier>::Buffer>, ) -> Result<(), ResampleError>
Drains one converted frame into
dst. Implementations signal
“no frame ready” via a backend-specific Error
variant, exactly as
AudioStreamDecoder::receive_frame
does.Source§fn send_eof(&mut self) -> Result<(), ResampleError>
fn send_eof(&mut self) -> Result<(), ResampleError>
Signals end of stream. The conversion tail becomes drainable
through
receive_frame.Source§impl AudioResampler for CarrierResampler<Owned>
impl AudioResampler for CarrierResampler<Owned>
Source§type Adapter = Ffmpeg
type Adapter = Ffmpeg
Backend vocabulary. The source and target specs are both
expressed in it.
Source§type Buffer = <Owned as FfmpegCarrier>::Buffer
type Buffer = <Owned as FfmpegCarrier>::Buffer
Buffer type held by the frames this resampler accepts and
produces.
Source§type Error = ResampleError
type Error = ResampleError
Resampler-specific error type. Carries both the
“nothing ready yet” signal out of
receive_frame
and the mid-stream-change refusal out of
send_frame.Source§fn send_frame(
&mut self,
frame: &AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <Owned as FfmpegCarrier>::Buffer>,
) -> Result<(), ResampleError>
fn send_frame( &mut self, frame: &AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <Owned as FfmpegCarrier>::Buffer>, ) -> Result<(), ResampleError>
Submits one decoded frame. Read more
Source§fn receive_frame(
&mut self,
dst: &mut AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <Owned as FfmpegCarrier>::Buffer>,
) -> Result<(), ResampleError>
fn receive_frame( &mut self, dst: &mut AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <Owned as FfmpegCarrier>::Buffer>, ) -> Result<(), ResampleError>
Drains one converted frame into
dst. Implementations signal
“no frame ready” via a backend-specific Error
variant, exactly as
AudioStreamDecoder::receive_frame
does.Source§fn send_eof(&mut self) -> Result<(), ResampleError>
fn send_eof(&mut self) -> Result<(), ResampleError>
Signals end of stream. The conversion tail becomes drainable
through
receive_frame.Auto Trait Implementations§
impl<C> !Send for CarrierResampler<C>
impl<C> !Sync for CarrierResampler<C>
impl<C> Freeze for CarrierResampler<C>where
VecDeque<AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <C as FfmpegCarrier>::Buffer>>: Freeze,
PhantomData<C>: Freeze,
impl<C> RefUnwindSafe for CarrierResampler<C>where
VecDeque<AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <C as FfmpegCarrier>::Buffer>>: RefUnwindSafe,
PhantomData<C>: RefUnwindSafe,
impl<C> Unpin for CarrierResampler<C>where
VecDeque<AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <C as FfmpegCarrier>::Buffer>>: Unpin,
PhantomData<C>: Unpin,
impl<C> UnsafeUnpin for CarrierResampler<C>where
VecDeque<AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <C as FfmpegCarrier>::Buffer>>: UnsafeUnpin,
PhantomData<C>: UnsafeUnpin,
impl<C> UnwindSafe for CarrierResampler<C>where
VecDeque<AudioFrame<SampleFormat, ChannelLayoutDescription, AudioFrameExtra, <C as FfmpegCarrier>::Buffer>>: UnwindSafe,
PhantomData<C>: UnwindSafe,
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