Skip to main content

PostDecodeHook

Type Alias PostDecodeHook 

Source
pub type PostDecodeHook = Arc<dyn Fn(&DecodedStreamInfo) -> Option<String> + Sync + Send>;
Expand description

Hook invoked once per feed when the decoded stream’s caps are known.

The hook receives a DecodedStreamInfo describing the decoded stream and returns an optional GStreamer element name to insert between the decoder and the color-space converter. Returning None means no additional element is needed.

§Example

On Jetson, hardware decoders output video/x-raw(memory:NVMM) — GPU-mapped buffers that the standard videoconvert cannot accept. A post-decode hook can bridge this:

use std::sync::Arc;
use nv_media::PostDecodeHook;

let hook: PostDecodeHook = Arc::new(|info| {
    if info.memory_type.as_deref() == Some("NVMM") {
        Some("nvvidconv".into())
    } else {
        None
    }
});

Aliased Type§

pub struct PostDecodeHook { /* private fields */ }