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 // Has this receiver got PTZ control. Note that it might take a second or two after the connection for this value to be set. 27 // To avoid the need to poll this function, you can know when the value of this function might have changed when the 28 // NDILib_recv_capture* call would return NDIlib_frame_type_status_change 29 PROCESSINGNDILIB_API 30 bool NDIlib_recv_ptz_is_supported(NDIlib_recv_instance_t p_instance); 31 32 // Has this receiver got recording control. Note that it might take a second or two after the connection for this value to be set. 33 // To avoid the need to poll this function, you can know when the value of this function might have changed when the 34 // NDILib_recv_capture* call would return NDIlib_frame_type_status_change 35 // 36 // Note on deprecation of this function : 37 // NDI version 4 includes the native ability to record all NDI streams using an external application that is provided with the 38 // SDK. This is better in many ways than the internal recording support which only ever supported remotely recording systems 39 // and NDI|HX. This functionality will be supported in the SDK for some time although we are recommending that you use the 40 // newer support which is more feature rich and supports the recording of all stream types, does not take CPU time to record 41 // NDI sources (it does not require any type of re-compression since it can just store the data in the file), it will synchronize 42 // all recorders on a system (and cross systems if NTP clock locking is used). 43 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 44 bool NDIlib_recv_recording_is_supported(NDIlib_recv_instance_t p_instance); 45 46 // PTZ Controls 47 // Zoom to an absolute value. 48 // zoom_value = 0.0 (zoomed in) ... 1.0 (zoomed out) 49 PROCESSINGNDILIB_API 50 bool NDIlib_recv_ptz_zoom(NDIlib_recv_instance_t p_instance, const float zoom_value); 51 52 // Zoom at a particular speed 53 // zoom_speed = -1.0 (zoom outwards) ... +1.0 (zoom inwards) 54 PROCESSINGNDILIB_API 55 bool NDIlib_recv_ptz_zoom_speed(NDIlib_recv_instance_t p_instance, const float zoom_speed); 56 57 // Set the pan and tilt to an absolute value 58 // pan_value = -1.0 (left) ... 0.0 (centered) ... +1.0 (right) 59 // tilt_value = -1.0 (bottom) ... 0.0 (centered) ... +1.0 (top) 60 PROCESSINGNDILIB_API 61 bool NDIlib_recv_ptz_pan_tilt(NDIlib_recv_instance_t p_instance, const float pan_value, const float tilt_value); 62 63 // Set the pan and tilt direction and speed 64 // pan_speed = -1.0 (moving right) ... 0.0 (stopped) ... +1.0 (moving left) 65 // tilt_speed = -1.0 (down) ... 0.0 (stopped) ... +1.0 (moving up) 66 PROCESSINGNDILIB_API 67 bool NDIlib_recv_ptz_pan_tilt_speed(NDIlib_recv_instance_t p_instance, const float pan_speed, const float tilt_speed); 68 69 // Store the current position, focus, etc... as a preset. 70 // preset_no = 0 ... 99 71 PROCESSINGNDILIB_API 72 bool NDIlib_recv_ptz_store_preset(NDIlib_recv_instance_t p_instance, const int preset_no); 73 74 // Recall a preset, including position, focus, etc... 75 // preset_no = 0 ... 99 76 // speed = 0.0(as slow as possible) ... 1.0(as fast as possible) The speed at which to move to the new preset 77 PROCESSINGNDILIB_API 78 bool NDIlib_recv_ptz_recall_preset(NDIlib_recv_instance_t p_instance, const int preset_no, const float speed); 79 80 // Put the camera in auto-focus 81 PROCESSINGNDILIB_API 82 bool NDIlib_recv_ptz_auto_focus(NDIlib_recv_instance_t p_instance); 83 84 // Focus to an absolute value. 85 // focus_value = 0.0 (focused to infinity) ... 1.0 (focused as close as possible) 86 PROCESSINGNDILIB_API 87 bool NDIlib_recv_ptz_focus(NDIlib_recv_instance_t p_instance, const float focus_value); 88 89 // Focus at a particular speed 90 // focus_speed = -1.0 (focus outwards) ... +1.0 (focus inwards) 91 PROCESSINGNDILIB_API 92 bool NDIlib_recv_ptz_focus_speed(NDIlib_recv_instance_t p_instance, const float focus_speed); 93 94 // Put the camera in auto white balance mode 95 PROCESSINGNDILIB_API 96 bool NDIlib_recv_ptz_white_balance_auto(NDIlib_recv_instance_t p_instance); 97 98 // Put the camera in indoor white balance 99 PROCESSINGNDILIB_API 100 bool NDIlib_recv_ptz_white_balance_indoor(NDIlib_recv_instance_t p_instance); 101 102 // Put the camera in indoor white balance 103 PROCESSINGNDILIB_API 104 bool NDIlib_recv_ptz_white_balance_outdoor(NDIlib_recv_instance_t p_instance); 105 106 // Use the current brightness to automatically set the current white balance 107 PROCESSINGNDILIB_API 108 bool NDIlib_recv_ptz_white_balance_oneshot(NDIlib_recv_instance_t p_instance); 109 110 // Set the manual camera white balance using the R, B values 111 // red = 0.0(not red) ... 1.0(very red) 112 // blue = 0.0(not blue) ... 1.0(very blue) 113 PROCESSINGNDILIB_API 114 bool NDIlib_recv_ptz_white_balance_manual(NDIlib_recv_instance_t p_instance, const float red, const float blue); 115 116 // Put the camera in auto-exposure mode 117 PROCESSINGNDILIB_API 118 bool NDIlib_recv_ptz_exposure_auto(NDIlib_recv_instance_t p_instance); 119 120 // Manually set the camera exposure 121 // exposure_level = 0.0(dark) ... 1.0(light) 122 PROCESSINGNDILIB_API 123 bool NDIlib_recv_ptz_exposure_manual(NDIlib_recv_instance_t p_instance, const float exposure_level); 124 125 // Recording control 126 // This will start recording.If the recorder was already recording then the message is ignored.A filename is passed in as a "hint".Since the recorder might 127 // already be recording(or might not allow complete flexibility over its filename), the filename might or might not be used.If the filename is empty, or 128 // not present, a name will be chosen automatically. If you do not with to provide a filename hint you can simply pass NULL. 129 // 130 // See note above on depreciation and why this is, and how to replace this functionality. 131 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 132 bool NDIlib_recv_recording_start(NDIlib_recv_instance_t p_instance, const char* p_filename_hint); 133 134 // Stop recording. 135 // 136 // See note above on depreciation and why this is, and how to replace this functionality. 137 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 138 bool NDIlib_recv_recording_stop(NDIlib_recv_instance_t p_instance); 139 140 // This will control the audio level for the recording.dB is specified in decibels relative to the reference level of the source. Not all recording sources support 141 // controlling audio levels.For instance, a digital audio device would not be able to avoid clipping on sources already at the wrong level, thus 142 // might not support this message. 143 // 144 // See note above on depreciation and why this is, and how to replace this functionality. 145 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 146 bool NDIlib_recv_recording_set_audio_level(NDIlib_recv_instance_t p_instance, const float level_dB); 147 148 // This will determine if the source is currently recording. It will return true while recording is in progress and false when it is not. Because there is 149 // one recorded and multiple people might be connected to it, there is a chance that it is recording which was initiated by someone else. 150 // 151 // See note above on depreciation and why this is, and how to replace this functionality. 152 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 153 bool NDIlib_recv_recording_is_recording(NDIlib_recv_instance_t p_instance); 154 155 // Get the current filename for recording. When this is set it will return a non-NULL value which is owned by you and freed using NDIlib_recv_free_string. 156 // If a file was already being recorded by another client, the massage will contain the name of that file. The filename contains a UNC path (when one is available) 157 // to the recorded file, and can be used to access the file on your local machine for playback. If a UNC path is not available, then this will represent the local 158 // filename. This will remain valid even after the file has stopped being recorded until the next file is started. 159 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 160 const char* NDIlib_recv_recording_get_filename(NDIlib_recv_instance_t p_instance); 161 162 // This will tell you whether there was a recording error and what that string is. When this is set it will return a non-NULL value which is owned by you and 163 // freed using NDIlib_recv_free_string. When there is no error it will return NULL. 164 // 165 // See note above on depreciation and why this is, and how to replace this functionality. 166 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 167 const char* NDIlib_recv_recording_get_error(NDIlib_recv_instance_t p_instance); 168 169 // In order to get the duration 170 typedef struct NDIlib_recv_recording_time_t 171 { // The number of actual video frames recorded. 172 int64_t no_frames; 173 174 // The starting time and current largest time of the record, in UTC time, at 100ns unit intervals. This allows you to know the record 175 // time irrespective of frame-rate. For instance, last_time - start_time would give you the recording length in 100ns intervals. 176 int64_t start_time, last_time; 177 178 #if NDILIB_CPP_DEFAULT_CONSTRUCTORS 179 NDIlib_recv_recording_time_t(void); 180 #endif // NDILIB_CPP_DEFAULT_CONSTRUCTORS 181 182 } NDIlib_recv_recording_time_t; 183 184 // Get the current recording times. 185 // 186 // See note above on depreciation and why this is, and how to replace this functionality. 187 PROCESSINGNDILIB_API PROCESSINGNDILIB_DEPRECATED 188 bool NDIlib_recv_recording_get_times(NDIlib_recv_instance_t p_instance, NDIlib_recv_recording_time_t* p_times); 189