pub trait NodeContext: Send + Sync {
// Required methods
fn add_audio_input(&self) -> AudioInputId;
fn add_video_input(&self) -> VideoInputId;
fn add_audio_output(&self) -> AudioOutput;
fn add_video_output(&self) -> VideoOutput;
fn create_to_rgba(
&self,
video_format: &VideoFormat,
colour_space: &ColourSpec,
width: usize,
height: usize,
) -> ToRGBA;
fn create_from_rgba(
&self,
video_format: &VideoFormat,
colour_space: &ColourSpec,
width: usize,
height: usize,
interlace: InterlaceMode,
) -> FromRGBA;
fn create_to_audio_f32(
&self,
audio_format: AudioFormat,
channel_layout: AudioChannelLayout,
) -> ToAudioF32;
fn create_from_audio_f32(
&self,
audio_format: AudioFormat,
channel_layout: AudioChannelLayout,
) -> FromAudioF32;
fn create_process_shader(
&self,
kernel: RStr<'_>,
program_name: RStr<'_>,
) -> ProcessShader;
}Expand description
Context provided to nodes when they are initialized.
Required Methods§
Sourcefn add_audio_input(&self) -> AudioInputId
fn add_audio_input(&self) -> AudioInputId
Add an audio input to the node.
Sourcefn add_video_input(&self) -> VideoInputId
fn add_video_input(&self) -> VideoInputId
Add a video input to the node.
Sourcefn add_audio_output(&self) -> AudioOutput
fn add_audio_output(&self) -> AudioOutput
Add an audio output to the node.
Sourcefn add_video_output(&self) -> VideoOutput
fn add_video_output(&self) -> VideoOutput
Add a video output to the node.
Sourcefn create_to_rgba(
&self,
video_format: &VideoFormat,
colour_space: &ColourSpec,
width: usize,
height: usize,
) -> ToRGBA
fn create_to_rgba( &self, video_format: &VideoFormat, colour_space: &ColourSpec, width: usize, height: usize, ) -> ToRGBA
Create a ToRGBA that can be used to load video frames onto the GPU.
Sourcefn create_from_rgba(
&self,
video_format: &VideoFormat,
colour_space: &ColourSpec,
width: usize,
height: usize,
interlace: InterlaceMode,
) -> FromRGBA
fn create_from_rgba( &self, video_format: &VideoFormat, colour_space: &ColourSpec, width: usize, height: usize, interlace: InterlaceMode, ) -> FromRGBA
Create a [’FromRGBA`] that can be used to consume video frames from the GPU.
Sourcefn create_to_audio_f32(
&self,
audio_format: AudioFormat,
channel_layout: AudioChannelLayout,
) -> ToAudioF32
fn create_to_audio_f32( &self, audio_format: AudioFormat, channel_layout: AudioChannelLayout, ) -> ToAudioF32
Create a ToAudioF32 that can be used to load audio in 32 bit floating-point format.
Sourcefn create_from_audio_f32(
&self,
audio_format: AudioFormat,
channel_layout: AudioChannelLayout,
) -> FromAudioF32
fn create_from_audio_f32( &self, audio_format: AudioFormat, channel_layout: AudioChannelLayout, ) -> FromAudioF32
Create a FromAudioF32 that can be used to consume 32 bit floating-point audio in other formats.
Sourcefn create_process_shader(
&self,
kernel: RStr<'_>,
program_name: RStr<'_>,
) -> ProcessShader
fn create_process_shader( &self, kernel: RStr<'_>, program_name: RStr<'_>, ) -> ProcessShader
Create a shader from a source string.
kernel- Shader code.program_name- Name of the kernel function.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".