[][src]Struct stainless_ffmpeg_sys::AVHWAccel

#[repr(C)]pub struct AVHWAccel {
    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>,
}

@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_char

Name 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_: AVMediaType

Type of codec implemented by the hardware accelerator.

See AVMEDIA_TYPE_xxx

id: AVCodecID

Codec implemented by the hardware accelerator.

See AV_CODEC_ID_xxx

pix_fmt: AVPixelFormat

Supported pixel format.

Only hardware accelerated formats are supported here.

capabilities: c_int

Hardware 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_int

Size 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_int

Size of the private data to allocate in AVCodecInternal.hwaccel_priv_data.

caps_internal: c_int

Internal 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 Clone for AVHWAccel[src]

impl Copy for AVHWAccel[src]

impl Debug for AVHWAccel[src]

impl Eq for AVHWAccel[src]

impl PartialEq<AVHWAccel> for AVHWAccel[src]

impl StructuralEq for AVHWAccel[src]

impl StructuralPartialEq for AVHWAccel[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.