MediaFormat

Struct MediaFormat 

Source
pub struct MediaFormat { /* private fields */ }
Expand description

This structure stores data in key-value pairs for use in MediaCodec and other places in the NDK

Implementations§

Source§

impl MediaFormat

Source

pub fn from_raw(inner: *mut AMediaFormat) -> Self

Construct a MediaFormat from a raw pointer

Source

pub fn new() -> Option<Self>

Create a new MediaFormat

Source

pub fn set_i32(&mut self, name: &str, value: i32) -> bool

Set a 32-bit integer value

Source

pub fn get_i32(&self, name: &str) -> Option<i32>

Get a 32-bit integer value

Source

pub fn set_i64(&mut self, name: &str, value: i64) -> bool

Set a 64-bit integer value

Source

pub fn get_i64(&self, name: &str) -> Option<i64>

Get a 64-bit integer value

Source

pub fn set_f32(&mut self, name: &str, value: f32) -> bool

Set a 32-bit floating-point value

Source

pub fn get_f32(&self, name: &str) -> Option<f32>

Get a 32-bit floating-point value

Source

pub fn is_audio(&self) -> bool

Convenience function to check whether the mime type is audio

Source

pub fn is_video(&self) -> bool

Convenience function to check whether the mime type is video

Source

pub fn set_f64(&mut self, name: &str, value: f64) -> bool

Set a 64-bit floating point value

Source

pub fn get_f64(&self, name: &str) -> Option<f64>

Get a 64-bit floating-point value

Source

pub fn set_string(&mut self, name: &str, value: &str) -> bool

Set a string value

Source

pub fn get_string(&self, name: &str) -> Option<String>

Get a string value

Trait Implementations§

Source§

impl Debug for MediaFormat

Source§

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

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

impl Drop for MediaFormat

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl ToString for MediaFormat

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl Send for MediaFormat

Source§

impl Sync for MediaFormat

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
Source§

impl<'a, T> Desc<'a, T> for T

Source§

fn lookup(self, _: &JNIEnv<'a>) -> Result<T, Error>

Look up the concrete type from the JVM.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

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

Source§

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>,

Source§

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.