Struct Send

Source
pub struct Send { /* private fields */ }
Expand description

A sender struct for sending NDI

Implementations§

Source§

impl Send

Source

pub fn new() -> Result<Self, SendCreateError>

Create a new instance with default parameters

It is recommended to use SendBuilder instead

Source

pub fn get_tally(&self, tally: &mut Tally, timeout_ms: u32) -> bool

Get the current tally

the return value is whether Tally was actually updated or not

Source

pub fn capture( &self, meta_data: &mut Option<MetaData>, timeout_ms: u32, ) -> FrameType

This allows you to receive metadata from the other end of the connection

Source

pub fn get_source(&self) -> Source

Retrieve the source information for the given sender instance.

Source

pub fn send_metadata(&self, metadata: &MetaData)

This will add a metadata frame

Source

pub fn send_audio(&self, audio_data: &AudioData)

This will add an audio frame

Source

pub fn send_video(&self, video_data: &VideoData)

This will add a video frame

Source

pub fn send_video_async(&self, video_data: &VideoData)

This will add a video frame and will return immediately, having scheduled the frame to be displayed.

All processing and sending of the video will occur asynchronously. The memory accessed by NDIlib_video_frame_t cannot be freed or re-used by the caller until a synchronizing event has occurred. In general the API is better able to take advantage of asynchronous processing than you might be able to by simple having a separate thread to submit frames.

This call is particularly beneficial when processing BGRA video since it allows any color conversion, compression and network sending to all be done on separate threads from your main rendering thread.

Synchronizing events are :

  • a call to send_video
  • a call to send_video_async with another frame to be sent
  • a call to send_video with p_video_data=NULL
  • Dropping a Send instance
Source

pub fn get_no_connections(&self, timeout_ms: u32) -> u32

Get the current number of receivers connected to this source.

This can be used to avoid even rendering when nothing is connected to the video source. which can significantly improve the efficiency if you want to make a lot of sources available on the network. If you specify a timeout that is not 0 then it will wait until there are connections for this amount of time.

Auto Trait Implementations§

§

impl Freeze for Send

§

impl RefUnwindSafe for Send

§

impl !Send for Send

§

impl !Sync for Send

§

impl Unpin for Send

§

impl UnwindSafe for Send

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.