pub struct Send { /* private fields */ }
Expand description
A sender struct for sending NDI
Implementations
sourceimpl Send
impl Send
sourcepub fn new() -> Result<Self, SendCreateError>
pub fn new() -> Result<Self, SendCreateError>
Create a new instance with default parameters
It is recommended to use SendBuilder
instead
sourcepub fn get_tally(&self, tally: &mut Tally, timeout_ms: u32) -> bool
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
sourcepub fn capture(
&self,
meta_data: &mut Option<MetaData>,
timeout_ms: u32
) -> FrameType
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
sourcepub fn get_source(&self) -> Source
pub fn get_source(&self) -> Source
Retrieve the source information for the given sender instance.
sourcepub fn send_metadata(&self, metadata: &MetaData)
pub fn send_metadata(&self, metadata: &MetaData)
This will add a metadata frame
sourcepub fn send_audio(&self, audio_data: &AudioData)
pub fn send_audio(&self, audio_data: &AudioData)
This will add an audio frame
sourcepub fn send_video(&self, video_data: &VideoData)
pub fn send_video(&self, video_data: &VideoData)
This will add a video frame
sourcepub fn send_video_async(&self, video_data: &VideoData)
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
sourcepub fn get_no_connections(&self, timeout_ms: u32) -> u32
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 RefUnwindSafe for Send
impl !Send for Send
impl !Sync for Send
impl Unpin for Send
impl UnwindSafe for Send
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more