cyndilib.finder#

Source#

class cyndilib.finder.Source#

Bases: object

Represents an NDI® source

name#

The source name

Type:

str, readonly

valid#

True if this source is currently tracked by the NDI® library

Type:

bool, readonly

preview_tally#

A bool indicating the source’s preview tally state

program_tally#

A bool indicating the source’s program tally state

set_preview_tally(self, bool value)#

Set the source’s preview tally to the given state

Note

This is only valid for sources attached to an active receiver.Receiver

set_program_tally(self, bool value)#

Set the source’s program tally to the given state

Note

This is only valid for sources attached to an active receiver.Receiver

update(self) bool#

Finder#

class cyndilib.finder.Finder#

Bases: object

Discovers NDI® sources available on the network

notify#

A Condition to notify listeners when sources are added or removed

Type:

Condition

num_sources#

The current number of sources found

Type:

int

change_callback#

A callback to be used when sources are added or removed

finder_thread#

The thread used to make blocking calls to update sources

close(self)#

Closes the finder_thread

get_source(self, unicode name) Source#

Get a Source by its name

get_source_names(self)#

Get the discovered sources as a list[str]

iter_sources(self)#

Iterate over the current sources as Source objects

open(self)#

Starts the finder_thread and begins searching for sources

set_change_callback(self, cb)#

Set the change_callback

update_sources(self)#

Manually update the current sources tracked by the NDI® library

Warning

This method should typically not be called directly and especially not if the finder_thread is in use.

wait(self, timeout=None)#

Wait for a source to be added or removed

wait_for_sources(self, float timeout)#

Wait for the NDI® library to report a change in its source list

If a change was detected a call to update_sources() should follow.

Parameters:

timeout (float) – Time (in seconds) to block before a change is detected

Returns:

Flag indicating if a change was detected before the timout was reached

Return type:

bool

Warning

This method should typically not be called directly and especially not if the finder_thread is in use.