rsmpeg 0.18.0+ffmpeg.8.0

A Rust crate that exposes FFmpeg's power as much as possible.
Documentation
1
2
3
4
5
6
7
8
9
use crate::{ffi, shared::PointerUpgrade};
use std::ffi::CStr;

/// Return a string describing the media_type enum, NULL if media_type is unknown.
pub fn get_media_type_string(media_type: i32) -> Option<&'static CStr> {
    unsafe { ffi::av_get_media_type_string(media_type) }
        .upgrade()
        .map(|str| unsafe { CStr::from_ptr(str.as_ptr()) })
}