1 #pragma once
2 
3 // NOTE : The following MIT license applies to this file ONLY and not to the SDK as a whole. Please review the SDK documentation
4 // for the description of the full license terms, which are also provided in the file "NDI License Agreement.pdf" within the SDK or
5 // online at http://new.tk/ndisdk_license/. Your use of any part of this SDK is acknowledgment that you agree to the SDK license
6 // terms. The full NDI SDK may be downloaded at http://ndi.tv/
7 //
8 //*************************************************************************************************************************************
9 //
10 // Copyright(c) 2014-2020, NewTek, inc.
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
13 // files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
14 // merge, publish, distribute, sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
15 // furnished to do so, subject to the following conditions :
16 //
17 // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
18 //
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
21 // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //*************************************************************************************************************************************
25 
26 // Structures and type definitions required by NDI finding
27 // The reference to an instance of the finder
28 typedef void* NDIlib_find_instance_t;
29 
30 // The creation structure that is used when you are creating a finder
31 typedef struct NDIlib_find_create_t
32 {	// Do we want to include the list of NDI sources that are running
33 	// on the local machine ?
34 	// If TRUE then local sources will be visible, if FALSE then they
35 	// will not.
36 	bool show_local_sources;
37 
38 	// Which groups do you want to search in for sources
39 	const char* p_groups;
40 
41 	// The list of additional IP addresses that exist that we should query for
42 	// sources on. For instance, if you want to find the sources on a remote machine
43 	// that is not on your local sub-net then you can put a comma separated list of
44 	// those IP addresses here and those sources will be available locally even though
45 	// they are not mDNS discoverable. An example might be "12.0.0.8,13.0.12.8".
46 	// When none is specified the registry is used.
47 	// Default = NULL;
48 	const char* p_extra_ips;
49 
50 #if NDILIB_CPP_DEFAULT_CONSTRUCTORS
51 	NDIlib_find_create_t(bool show_local_sources_ = true, const char* p_groups_ = NULL, const char* p_extra_ips_ = NULL);
52 #endif // NDILIB_CPP_DEFAULT_CONSTRUCTORS
53 
54 } NDIlib_find_create_t;
55 
56 //**************************************************************************************************************************
57 // Create a new finder instance. This will return NULL if it fails.
58 PROCESSINGNDILIB_API
59 NDIlib_find_instance_t NDIlib_find_create_v2(const NDIlib_find_create_t* p_create_settings NDILIB_CPP_DEFAULT_VALUE(NULL));
60 
61 // This will destroy an existing finder instance.
62 PROCESSINGNDILIB_API
63 void NDIlib_find_destroy(NDIlib_find_instance_t p_instance);
64 
65 // This function will recover the current set of sources (i.e. the ones that exist right this second).
66 // The char* memory buffers returned in NDIlib_source_t are valid until the next call to NDIlib_find_get_current_sources or a call to NDIlib_find_destroy.
67 // For a given NDIlib_find_instance_t, do not call NDIlib_find_get_current_sources asynchronously.
68 PROCESSINGNDILIB_API
69 const NDIlib_source_t* NDIlib_find_get_current_sources(NDIlib_find_instance_t p_instance, uint32_t* p_no_sources);
70 
71 // This will allow you to wait until the number of online sources have changed.
72 PROCESSINGNDILIB_API
73 bool NDIlib_find_wait_for_sources(NDIlib_find_instance_t p_instance, uint32_t timeout_in_ms);
74