Struct ffmpeg_sys_next::AVHWAccel
source · [−]#[repr(C)]pub struct AVHWAccel {Show 17 fields
pub name: *const c_char,
pub type_: AVMediaType,
pub id: AVCodecID,
pub pix_fmt: AVPixelFormat,
pub capabilities: c_int,
pub alloc_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, frame: *mut AVFrame) -> c_int>,
pub start_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, buf: *const u8, buf_size: u32) -> c_int>,
pub decode_params: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, type_: c_int, buf: *const u8, buf_size: u32) -> c_int>,
pub decode_slice: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, buf: *const u8, buf_size: u32) -> c_int>,
pub end_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext) -> c_int>,
pub frame_priv_data_size: c_int,
pub decode_mb: Option<unsafe extern "C" fn(s: *mut MpegEncContext)>,
pub init: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext) -> c_int>,
pub uninit: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext) -> c_int>,
pub priv_data_size: c_int,
pub caps_internal: c_int,
pub frame_params: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, hw_frames_ctx: *mut AVBufferRef) -> c_int>,
}Expand description
@defgroup lavc_hwaccel AVHWAccel
@note Nothing in this structure should be accessed by the user. At some point in future it will not be externally visible at all.
@{
Fields
name: *const c_charName of the hardware accelerated codec. The name is globally unique among encoders and among decoders (but an encoder and a decoder can share the same name).
type_: AVMediaTypeType of codec implemented by the hardware accelerator.
See AVMEDIA_TYPE_xxx
id: AVCodecIDCodec implemented by the hardware accelerator.
See AV_CODEC_ID_xxx
pix_fmt: AVPixelFormatSupported pixel format.
Only hardware accelerated formats are supported here.
capabilities: c_intHardware accelerated codec capabilities. see AV_HWACCEL_CODEC_CAP_*
alloc_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, frame: *mut AVFrame) -> c_int>Allocate a custom buffer
start_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, buf: *const u8, buf_size: u32) -> c_int>Called at the beginning of each frame or field picture.
Meaningful frame information (codec specific) is guaranteed to be parsed at this point. This function is mandatory.
Note that buf can be NULL along with buf_size set to 0. Otherwise, this means the whole frame is available at this point.
@param avctx the codec context @param buf the frame data buffer base @param buf_size the size of the frame in bytes @return zero if successful, a negative value otherwise
decode_params: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, type_: c_int, buf: *const u8, buf_size: u32) -> c_int>Callback for parameter data (SPS/PPS/VPS etc).
Useful for hardware decoders which keep persistent state about the video parameters, and need to receive any changes to update that state.
@param avctx the codec context @param type the nal unit type @param buf the nal unit data buffer @param buf_size the size of the nal unit in bytes @return zero if successful, a negative value otherwise
decode_slice: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, buf: *const u8, buf_size: u32) -> c_int>Callback for each slice.
Meaningful slice information (codec specific) is guaranteed to be parsed at this point. This function is mandatory. The only exception is XvMC, that works on MB level.
@param avctx the codec context @param buf the slice data buffer base @param buf_size the size of the slice in bytes @return zero if successful, a negative value otherwise
end_frame: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext) -> c_int>Called at the end of each frame or field picture.
The whole picture is parsed at this point and can now be sent to the hardware accelerator. This function is mandatory.
@param avctx the codec context @return zero if successful, a negative value otherwise
frame_priv_data_size: c_intSize of per-frame hardware accelerator private data.
Private data is allocated with av_mallocz() before AVCodecContext.get_buffer() and deallocated after AVCodecContext.release_buffer().
decode_mb: Option<unsafe extern "C" fn(s: *mut MpegEncContext)>Called for every Macroblock in a slice.
XvMC uses it to replace the ff_mpv_reconstruct_mb(). Instead of decoding to raw picture, MB parameters are stored in an array provided by the video driver.
@param s the mpeg context
init: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext) -> c_int>Initialize the hwaccel private data.
This will be called from ff_get_format(), after hwaccel and hwaccel_context are set and the hwaccel private data in AVCodecInternal is allocated.
uninit: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext) -> c_int>Uninitialize the hwaccel private data.
This will be called from get_format() or avcodec_close(), after hwaccel and hwaccel_context are already uninitialized.
priv_data_size: c_intSize of the private data to allocate in AVCodecInternal.hwaccel_priv_data.
caps_internal: c_intInternal hwaccel capabilities.
frame_params: Option<unsafe extern "C" fn(avctx: *mut AVCodecContext, hw_frames_ctx: *mut AVBufferRef) -> c_int>Fill the given hw_frames context with current codec parameters. Called from get_format. Refer to avcodec_get_hw_frames_parameters() for details.
This CAN be called before AVHWAccel.init is called, and you must assume that avctx->hwaccel_priv_data is invalid.
Trait Implementations
impl Copy for AVHWAccel
impl Eq for AVHWAccel
impl StructuralEq for AVHWAccel
impl StructuralPartialEq for AVHWAccel
Auto Trait Implementations
impl RefUnwindSafe for AVHWAccel
impl !Send for AVHWAccel
impl !Sync for AVHWAccel
impl Unpin for AVHWAccel
impl UnwindSafe for AVHWAccel
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more