Struct ndk::media::media_codec::MediaCodec
source · [−]pub struct MediaCodec { /* private fields */ }
Available on crate feature
media
only.Expand description
A native AMediaCodec *
Implementations
sourceimpl MediaCodec
impl MediaCodec
pub fn from_codec_name(name: &str) -> Option<Self>
pub fn from_decoder_type(mime_type: &str) -> Option<Self>
pub fn from_encoder_type(mime_type: &str) -> Option<Self>
pub fn configure(
&self,
format: &MediaFormat,
surface: Option<&NativeWindow>,
direction: MediaCodecDirection
) -> Result<()>
pub fn create_input_surface(&self) -> Result<NativeWindow>
Available on crate feature
api-level-26
only.pub fn create_persistent_input_surface() -> Result<NativeWindow>
Available on crate feature
api-level-26
only.sourcepub fn dequeue_input_buffer(
&self,
timeout: Duration
) -> Result<Option<InputBuffer<'_>>>
pub fn dequeue_input_buffer(
&self,
timeout: Duration
) -> Result<Option<InputBuffer<'_>>>
Returns None
if timeout is reached.
sourcepub fn dequeue_output_buffer(
&self,
timeout: Duration
) -> Result<Option<OutputBuffer<'_>>>
pub fn dequeue_output_buffer(
&self,
timeout: Duration
) -> Result<Option<OutputBuffer<'_>>>
Returns None
if timeout is reached.
pub fn flush(&self) -> Result<()>
pub fn input_format(&self) -> MediaFormat
Available on crate feature
api-level-28
only.pub fn output_format(&self) -> MediaFormat
pub fn name(&self) -> Result<String>
Available on crate feature
api-level-28
only.pub fn queue_input_buffer(
&self,
buffer: InputBuffer<'_>,
offset: usize,
size: usize,
time: u64,
flags: u32
) -> Result<()>
pub fn release_output_buffer(
&self,
buffer: OutputBuffer<'_>,
render: bool
) -> Result<()>
pub fn release_output_buffer_at_time(
&self,
buffer: OutputBuffer<'_>,
timestamp_ns: i64
) -> Result<()>
pub fn set_input_surface(&self, surface: &NativeWindow) -> Result<()>
Available on crate feature
api-level-26
only.pub fn set_output_surface(&self, surface: &NativeWindow) -> Result<()>
pub fn set_parameters(&self, params: MediaFormat) -> Result<()>
Available on crate feature
api-level-26
only.pub fn set_signal_end_of_input_stream(&self) -> Result<()>
Available on crate feature
api-level-26
only.pub fn start(&self) -> Result<()>
pub fn stop(&self) -> Result<()>
Trait Implementations
sourceimpl Debug for MediaCodec
impl Debug for MediaCodec
Auto Trait Implementations
impl RefUnwindSafe for MediaCodec
impl !Send for MediaCodec
impl !Sync for MediaCodec
impl Unpin for MediaCodec
impl UnwindSafe for MediaCodec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more