noobs 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/COPYING +339 -0
  2. package/README.md +46 -0
  3. package/bin/64bit/obs.lib +0 -0
  4. package/binding.gyp +23 -0
  5. package/dist/bin/Qt6Core.dll +0 -0
  6. package/dist/bin/Qt6Gui.dll +0 -0
  7. package/dist/bin/Qt6Network.dll +0 -0
  8. package/dist/bin/Qt6Svg.dll +0 -0
  9. package/dist/bin/Qt6Widgets.dll +0 -0
  10. package/dist/bin/Qt6Xml.dll +0 -0
  11. package/dist/bin/avcodec-61.dll +0 -0
  12. package/dist/bin/avdevice-61.dll +0 -0
  13. package/dist/bin/avfilter-10.dll +0 -0
  14. package/dist/bin/avformat-61.dll +0 -0
  15. package/dist/bin/avutil-59.dll +0 -0
  16. package/dist/bin/datachannel.dll +0 -0
  17. package/dist/bin/libcurl.dll +0 -0
  18. package/dist/bin/libobs-d3d11.dll +0 -0
  19. package/dist/bin/libobs-opengl.dll +0 -0
  20. package/dist/bin/libobs-winrt.dll +0 -0
  21. package/dist/bin/librist.dll +0 -0
  22. package/dist/bin/libx264-164.dll +0 -0
  23. package/dist/bin/lua51.dll +0 -0
  24. package/dist/bin/obs-amf-test.exe +0 -0
  25. package/dist/bin/obs-ffmpeg-mux.exe +0 -0
  26. package/dist/bin/obs-frontend-api.dll +0 -0
  27. package/dist/bin/obs-scripting.dll +0 -0
  28. package/dist/bin/obs.dll +0 -0
  29. package/dist/bin/srt.dll +0 -0
  30. package/dist/bin/swresample-5.dll +0 -0
  31. package/dist/bin/swscale-8.dll +0 -0
  32. package/dist/bin/w32-pthreads.dll +0 -0
  33. package/dist/bin/zlib.dll +0 -0
  34. package/dist/effects/area.effect +250 -0
  35. package/dist/effects/bicubic_scale.effect +236 -0
  36. package/dist/effects/bilinear_lowres_scale.effect +123 -0
  37. package/dist/effects/color.effect +172 -0
  38. package/dist/effects/default.effect +254 -0
  39. package/dist/effects/default_rect.effect +84 -0
  40. package/dist/effects/deinterlace_base.effect +325 -0
  41. package/dist/effects/deinterlace_blend.effect +21 -0
  42. package/dist/effects/deinterlace_blend_2x.effect +21 -0
  43. package/dist/effects/deinterlace_discard.effect +21 -0
  44. package/dist/effects/deinterlace_discard_2x.effect +21 -0
  45. package/dist/effects/deinterlace_linear.effect +21 -0
  46. package/dist/effects/deinterlace_linear_2x.effect +21 -0
  47. package/dist/effects/deinterlace_yadif.effect +21 -0
  48. package/dist/effects/deinterlace_yadif_2x.effect +21 -0
  49. package/dist/effects/format_conversion.effect +1823 -0
  50. package/dist/effects/lanczos_scale.effect +292 -0
  51. package/dist/effects/opaque.effect +159 -0
  52. package/dist/effects/premultiplied_alpha.effect +38 -0
  53. package/dist/effects/repeat.effect +36 -0
  54. package/dist/effects/solid.effect +80 -0
  55. package/dist/noobs.node +0 -0
  56. package/dist/plugins/obs-ffmpeg.dll +0 -0
  57. package/dist/plugins/obs-x264.dll +0 -0
  58. package/dist/plugins/win-capture.dll +0 -0
  59. package/include/audio-monitoring/osx/mac-helpers.h +13 -0
  60. package/include/audio-monitoring/pulse/pulseaudio-wrapper.h +212 -0
  61. package/include/audio-monitoring/win32/wasapi-output.h +22 -0
  62. package/include/callback/calldata.h +195 -0
  63. package/include/callback/decl.h +61 -0
  64. package/include/callback/proc.h +52 -0
  65. package/include/callback/signal.h +73 -0
  66. package/include/graphics/axisang.h +65 -0
  67. package/include/graphics/bounds.h +108 -0
  68. package/include/graphics/device-exports.h +177 -0
  69. package/include/graphics/effect-parser.h +290 -0
  70. package/include/graphics/effect.h +190 -0
  71. package/include/graphics/graphics-internal.h +335 -0
  72. package/include/graphics/graphics.h +1024 -0
  73. package/include/graphics/half.h +100 -0
  74. package/include/graphics/image-file.h +124 -0
  75. package/include/graphics/input.h +34 -0
  76. package/include/graphics/libnsgif/libnsgif.h +142 -0
  77. package/include/graphics/math-defs.h +45 -0
  78. package/include/graphics/math-extra.h +61 -0
  79. package/include/graphics/matrix3.h +98 -0
  80. package/include/graphics/matrix4.h +102 -0
  81. package/include/graphics/plane.h +85 -0
  82. package/include/graphics/quat.h +170 -0
  83. package/include/graphics/shader-parser.h +273 -0
  84. package/include/graphics/srgb.h +177 -0
  85. package/include/graphics/vec2.h +148 -0
  86. package/include/graphics/vec3.h +224 -0
  87. package/include/graphics/vec4.h +241 -0
  88. package/include/media-io/audio-io.h +228 -0
  89. package/include/media-io/audio-math.h +43 -0
  90. package/include/media-io/audio-resampler.h +44 -0
  91. package/include/media-io/format-conversion.h +50 -0
  92. package/include/media-io/frame-rate.h +29 -0
  93. package/include/media-io/media-io-defs.h +20 -0
  94. package/include/media-io/media-remux.h +37 -0
  95. package/include/media-io/video-frame.h +64 -0
  96. package/include/media-io/video-io.h +338 -0
  97. package/include/media-io/video-scaler.h +43 -0
  98. package/include/obs-audio-controls.h +250 -0
  99. package/include/obs-av1.h +47 -0
  100. package/include/obs-avc.h +55 -0
  101. package/include/obs-config.h +52 -0
  102. package/include/obs-data.h +311 -0
  103. package/include/obs-defs.h +52 -0
  104. package/include/obs-encoder.h +361 -0
  105. package/include/obs-ffmpeg-compat.h +13 -0
  106. package/include/obs-hevc.h +81 -0
  107. package/include/obs-hotkey.h +271 -0
  108. package/include/obs-hotkeys.h +653 -0
  109. package/include/obs-interaction.h +56 -0
  110. package/include/obs-internal.h +1459 -0
  111. package/include/obs-missing-files.h +53 -0
  112. package/include/obs-module.h +181 -0
  113. package/include/obs-nal.h +37 -0
  114. package/include/obs-nix-platform.h +53 -0
  115. package/include/obs-nix-wayland.h +24 -0
  116. package/include/obs-nix-x11.h +22 -0
  117. package/include/obs-nix.h +42 -0
  118. package/include/obs-output.h +96 -0
  119. package/include/obs-properties.h +364 -0
  120. package/include/obs-scene.h +127 -0
  121. package/include/obs-service.h +115 -0
  122. package/include/obs-source.h +568 -0
  123. package/include/obs.h +2608 -0
  124. package/include/obsconfig.h +13 -0
  125. package/include/obsversion.h +5 -0
  126. package/include/util/apple/cfstring-utils.h +16 -0
  127. package/include/util/array-serializer.h +37 -0
  128. package/include/util/base.h +97 -0
  129. package/include/util/bitstream.h +28 -0
  130. package/include/util/bmem.h +94 -0
  131. package/include/util/buffered-file-serializer.h +32 -0
  132. package/include/util/c99defs.h +75 -0
  133. package/include/util/cf-lexer.h +199 -0
  134. package/include/util/cf-parser.h +281 -0
  135. package/include/util/circlebuf.h +319 -0
  136. package/include/util/config-file.h +103 -0
  137. package/include/util/crc32.h +29 -0
  138. package/include/util/curl/curl-helper.h +35 -0
  139. package/include/util/darray.h +606 -0
  140. package/include/util/deque.h +319 -0
  141. package/include/util/dstr.h +320 -0
  142. package/include/util/file-serializer.h +34 -0
  143. package/include/util/lexer.h +273 -0
  144. package/include/util/pipe.h +52 -0
  145. package/include/util/platform.h +223 -0
  146. package/include/util/profiler.h +97 -0
  147. package/include/util/serializer.h +158 -0
  148. package/include/util/simde/check.h +285 -0
  149. package/include/util/simde/debug-trap.h +117 -0
  150. package/include/util/simde/hedley.h +2123 -0
  151. package/include/util/simde/simde-align.h +481 -0
  152. package/include/util/simde/simde-arch.h +537 -0
  153. package/include/util/simde/simde-common.h +918 -0
  154. package/include/util/simde/simde-constify.h +925 -0
  155. package/include/util/simde/simde-detect-clang.h +114 -0
  156. package/include/util/simde/simde-diagnostic.h +447 -0
  157. package/include/util/simde/simde-features.h +550 -0
  158. package/include/util/simde/simde-math.h +1858 -0
  159. package/include/util/simde/x86/mmx.h +2456 -0
  160. package/include/util/simde/x86/sse.h +4479 -0
  161. package/include/util/simde/x86/sse2.h +7549 -0
  162. package/include/util/source-profiler.h +66 -0
  163. package/include/util/sse-intrin.h +32 -0
  164. package/include/util/task.h +22 -0
  165. package/include/util/text-lookup.h +45 -0
  166. package/include/util/threading-posix.h +77 -0
  167. package/include/util/threading-windows.h +142 -0
  168. package/include/util/threading.h +103 -0
  169. package/include/util/utf8.h +35 -0
  170. package/include/util/uthash.h +34 -0
  171. package/include/util/util_uint128.h +108 -0
  172. package/include/util/util_uint64.h +34 -0
  173. package/include/util/windows/device-enum.h +14 -0
  174. package/include/util/windows/obfuscate.h +16 -0
  175. package/include/util/windows/win-registry.h +37 -0
  176. package/include/util/windows/win-version.h +57 -0
  177. package/include/util/windows/window-helpers.h +47 -0
  178. package/index.d.ts +38 -0
  179. package/index.js +8 -0
  180. package/package.json +31 -0
  181. package/src/main.cpp +321 -0
  182. package/src/obs_interface.cpp +605 -0
  183. package/src/obs_interface.h +74 -0
  184. package/src/utils.cpp +80 -0
  185. package/src/utils.h +3 -0
@@ -0,0 +1,568 @@
1
+ /******************************************************************************
2
+ Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU General Public License as published by
6
+ the Free Software Foundation, either version 2 of the License, or
7
+ (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU General Public License for more details.
13
+
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ ******************************************************************************/
17
+
18
+ #pragma once
19
+
20
+ #include "obs.h"
21
+
22
+ /**
23
+ * @file
24
+ * @brief header for modules implementing sources.
25
+ *
26
+ * Sources are modules that either feed data to libobs or modify it.
27
+ */
28
+
29
+ #ifdef __cplusplus
30
+ extern "C" {
31
+ #endif
32
+
33
+ enum obs_source_type {
34
+ OBS_SOURCE_TYPE_INPUT,
35
+ OBS_SOURCE_TYPE_FILTER,
36
+ OBS_SOURCE_TYPE_TRANSITION,
37
+ OBS_SOURCE_TYPE_SCENE,
38
+ };
39
+
40
+ enum obs_balance_type {
41
+ OBS_BALANCE_TYPE_SINE_LAW,
42
+ OBS_BALANCE_TYPE_SQUARE_LAW,
43
+ OBS_BALANCE_TYPE_LINEAR,
44
+ };
45
+
46
+ enum obs_icon_type {
47
+ OBS_ICON_TYPE_UNKNOWN,
48
+ OBS_ICON_TYPE_IMAGE,
49
+ OBS_ICON_TYPE_COLOR,
50
+ OBS_ICON_TYPE_SLIDESHOW,
51
+ OBS_ICON_TYPE_AUDIO_INPUT,
52
+ OBS_ICON_TYPE_AUDIO_OUTPUT,
53
+ OBS_ICON_TYPE_DESKTOP_CAPTURE,
54
+ OBS_ICON_TYPE_WINDOW_CAPTURE,
55
+ OBS_ICON_TYPE_GAME_CAPTURE,
56
+ OBS_ICON_TYPE_CAMERA,
57
+ OBS_ICON_TYPE_TEXT,
58
+ OBS_ICON_TYPE_MEDIA,
59
+ OBS_ICON_TYPE_BROWSER,
60
+ OBS_ICON_TYPE_CUSTOM,
61
+ OBS_ICON_TYPE_PROCESS_AUDIO_OUTPUT,
62
+ };
63
+
64
+ enum obs_media_state {
65
+ OBS_MEDIA_STATE_NONE,
66
+ OBS_MEDIA_STATE_PLAYING,
67
+ OBS_MEDIA_STATE_OPENING,
68
+ OBS_MEDIA_STATE_BUFFERING,
69
+ OBS_MEDIA_STATE_PAUSED,
70
+ OBS_MEDIA_STATE_STOPPED,
71
+ OBS_MEDIA_STATE_ENDED,
72
+ OBS_MEDIA_STATE_ERROR,
73
+ };
74
+
75
+ /**
76
+ * @name Source output flags
77
+ *
78
+ * These flags determine what type of data the source outputs and expects.
79
+ * @{
80
+ */
81
+
82
+ /**
83
+ * Source has video.
84
+ *
85
+ * Unless SOURCE_ASYNC_VIDEO is specified, the source must include the
86
+ * video_render callback in the source definition structure.
87
+ */
88
+ #define OBS_SOURCE_VIDEO (1 << 0)
89
+
90
+ /**
91
+ * Source has audio.
92
+ *
93
+ * Use the obs_source_output_audio function to pass raw audio data, which will
94
+ * be automatically converted and uploaded. If used with SOURCE_ASYNC_VIDEO,
95
+ * audio will automatically be synced up to the video output.
96
+ */
97
+ #define OBS_SOURCE_AUDIO (1 << 1)
98
+
99
+ /** Async video flag (use OBS_SOURCE_ASYNC_VIDEO) */
100
+ #define OBS_SOURCE_ASYNC (1 << 2)
101
+
102
+ /**
103
+ * Source passes raw video data via RAM.
104
+ *
105
+ * Use the obs_source_output_video function to pass raw video data, which will
106
+ * be automatically uploaded at the specified timestamp.
107
+ *
108
+ * If this flag is specified, it is not necessary to include the video_render
109
+ * callback. However, if you wish to use that function as well, you must call
110
+ * obs_source_getframe to get the current frame data, and
111
+ * obs_source_releaseframe to release the data when complete.
112
+ */
113
+ #define OBS_SOURCE_ASYNC_VIDEO (OBS_SOURCE_ASYNC | OBS_SOURCE_VIDEO)
114
+
115
+ /**
116
+ * Source uses custom drawing, rather than a default effect.
117
+ *
118
+ * If this flag is specified, the video_render callback will pass a NULL
119
+ * effect, and effect-based filters will not use direct rendering.
120
+ */
121
+ #define OBS_SOURCE_CUSTOM_DRAW (1 << 3)
122
+
123
+ /**
124
+ * Source supports interaction.
125
+ *
126
+ * When this is used, the source will receive interaction events
127
+ * if they provide the necessary callbacks in the source definition structure.
128
+ */
129
+ #define OBS_SOURCE_INTERACTION (1 << 5)
130
+
131
+ /**
132
+ * Source composites sub-sources
133
+ *
134
+ * When used specifies that the source composites one or more sub-sources.
135
+ * Sources that render sub-sources must implement the audio_render callback
136
+ * in order to perform custom mixing of sub-sources.
137
+ *
138
+ * This capability flag is always set for transitions.
139
+ */
140
+ #define OBS_SOURCE_COMPOSITE (1 << 6)
141
+
142
+ /**
143
+ * Source should not be fully duplicated
144
+ *
145
+ * When this is used, specifies that the source should not be fully duplicated,
146
+ * and should prefer to duplicate via holding references rather than full
147
+ * duplication.
148
+ */
149
+ #define OBS_SOURCE_DO_NOT_DUPLICATE (1 << 7)
150
+
151
+ /**
152
+ * Source is deprecated and should not be used
153
+ */
154
+ #define OBS_SOURCE_DEPRECATED (1 << 8)
155
+
156
+ /**
157
+ * Source cannot have its audio monitored
158
+ *
159
+ * Specifies that this source may cause a feedback loop if audio is monitored
160
+ * with a device selected as desktop audio.
161
+ *
162
+ * This is used primarily with desktop audio capture sources.
163
+ */
164
+ #define OBS_SOURCE_DO_NOT_SELF_MONITOR (1 << 9)
165
+
166
+ /**
167
+ * Source type is currently disabled and should not be shown to the user
168
+ */
169
+ #define OBS_SOURCE_CAP_DISABLED (1 << 10)
170
+
171
+ /**
172
+ * Source type is obsolete (has been updated with new defaults/properties/etc)
173
+ */
174
+ #define OBS_SOURCE_CAP_OBSOLETE OBS_SOURCE_CAP_DISABLED
175
+
176
+ /**
177
+ * Source should enable monitoring by default. Monitoring should be set by the
178
+ * frontend if this flag is set.
179
+ */
180
+ #define OBS_SOURCE_MONITOR_BY_DEFAULT (1 << 11)
181
+
182
+ /** Used internally for audio submixing */
183
+ #define OBS_SOURCE_SUBMIX (1 << 12)
184
+
185
+ /**
186
+ * Source type can be controlled by media controls
187
+ */
188
+ #define OBS_SOURCE_CONTROLLABLE_MEDIA (1 << 13)
189
+
190
+ /**
191
+ * Source type provides cea708 data
192
+ */
193
+ #define OBS_SOURCE_CEA_708 (1 << 14)
194
+
195
+ /**
196
+ * Source understands SRGB rendering
197
+ */
198
+ #define OBS_SOURCE_SRGB (1 << 15)
199
+
200
+ /**
201
+ * Source type prefers not to have its properties shown on creation
202
+ * (prefers to rely on defaults first)
203
+ */
204
+ #define OBS_SOURCE_CAP_DONT_SHOW_PROPERTIES (1 << 16)
205
+
206
+ /**
207
+ * Source requires a canvas to operate
208
+ */
209
+ #define OBS_SOURCE_REQUIRES_CANVAS (1 << 17)
210
+
211
+ /** @} */
212
+
213
+ typedef void (*obs_source_enum_proc_t)(obs_source_t *parent, obs_source_t *child, void *param);
214
+
215
+ struct obs_source_audio_mix {
216
+ struct audio_output_data output[MAX_AUDIO_MIXES];
217
+ };
218
+
219
+ /**
220
+ * Source definition structure
221
+ */
222
+ struct obs_source_info {
223
+ /* ----------------------------------------------------------------- */
224
+ /* Required implementation*/
225
+
226
+ /** Unique string identifier for the source */
227
+ const char *id;
228
+
229
+ /**
230
+ * Type of source.
231
+ *
232
+ * OBS_SOURCE_TYPE_INPUT for input sources,
233
+ * OBS_SOURCE_TYPE_FILTER for filter sources, and
234
+ * OBS_SOURCE_TYPE_TRANSITION for transition sources.
235
+ */
236
+ enum obs_source_type type;
237
+
238
+ /** Source output flags */
239
+ uint32_t output_flags;
240
+
241
+ /**
242
+ * Get the translated name of the source type
243
+ *
244
+ * @param type_data The type_data variable of this structure
245
+ * @return The translated name of the source type
246
+ */
247
+ const char *(*get_name)(void *type_data);
248
+
249
+ /**
250
+ * Creates the source data for the source
251
+ *
252
+ * @param settings Settings to initialize the source with
253
+ * @param source Source that this data is associated with
254
+ * @return The data associated with this source
255
+ */
256
+ void *(*create)(obs_data_t *settings, obs_source_t *source);
257
+
258
+ /**
259
+ * Destroys the private data for the source
260
+ *
261
+ * Async sources must not call obs_source_output_video after returning
262
+ * from destroy
263
+ */
264
+ void (*destroy)(void *data);
265
+
266
+ /** Returns the width of the source. Required if this is an input
267
+ * source and has non-async video */
268
+ uint32_t (*get_width)(void *data);
269
+
270
+ /** Returns the height of the source. Required if this is an input
271
+ * source and has non-async video */
272
+ uint32_t (*get_height)(void *data);
273
+
274
+ /* ----------------------------------------------------------------- */
275
+ /* Optional implementation */
276
+
277
+ /**
278
+ * Gets the default settings for this source
279
+ *
280
+ * @param[out] settings Data to assign default settings to
281
+ * @deprecated Use get_defaults2 if type_data is needed
282
+ */
283
+ void (*get_defaults)(obs_data_t *settings);
284
+
285
+ /**
286
+ * Gets the property information of this source
287
+ *
288
+ * @return The properties data
289
+ * @deprecated Use get_properties2 if type_data is needed
290
+ */
291
+ obs_properties_t *(*get_properties)(void *data);
292
+
293
+ /**
294
+ * Updates the settings for this source
295
+ *
296
+ * @param data Source data
297
+ * @param settings New settings for this source
298
+ */
299
+ void (*update)(void *data, obs_data_t *settings);
300
+
301
+ /** Called when the source has been activated in the main view */
302
+ void (*activate)(void *data);
303
+
304
+ /**
305
+ * Called when the source has been deactivated from the main view
306
+ * (no longer being played/displayed)
307
+ */
308
+ void (*deactivate)(void *data);
309
+
310
+ /** Called when the source is visible */
311
+ void (*show)(void *data);
312
+
313
+ /** Called when the source is no longer visible */
314
+ void (*hide)(void *data);
315
+
316
+ /**
317
+ * Called each video frame with the time elapsed
318
+ *
319
+ * @param data Source data
320
+ * @param seconds Seconds elapsed since the last frame
321
+ */
322
+ void (*video_tick)(void *data, float seconds);
323
+
324
+ /**
325
+ * Called when rendering the source with the graphics subsystem.
326
+ *
327
+ * If this is an input/transition source, this is called to draw the
328
+ * source texture with the graphics subsystem using the specified
329
+ * effect.
330
+ *
331
+ * If this is a filter source, it wraps source draw calls (for
332
+ * example applying a custom effect with custom parameters to a
333
+ * source). In this case, it's highly recommended to use the
334
+ * obs_source_process_filter function to automatically handle
335
+ * effect-based filter processing. However, you can implement custom
336
+ * draw handling as desired as well.
337
+ *
338
+ * If the source output flags do not include SOURCE_CUSTOM_DRAW, all
339
+ * a source needs to do is set the "image" parameter of the effect to
340
+ * the desired texture, and then draw. If the output flags include
341
+ * SOURCE_COLOR_MATRIX, you may optionally set the "color_matrix"
342
+ * parameter of the effect to a custom 4x4 conversion matrix (by
343
+ * default it will be set to an YUV->RGB conversion matrix)
344
+ *
345
+ * @param data Source data
346
+ * @param effect Effect to be used with this source. If the source
347
+ * output flags include SOURCE_CUSTOM_DRAW, this will
348
+ * be NULL, and the source is expected to process with
349
+ * an effect manually.
350
+ */
351
+ void (*video_render)(void *data, gs_effect_t *effect);
352
+
353
+ /**
354
+ * Called to filter raw async video data.
355
+ *
356
+ * @note This function is only used with filter sources.
357
+ *
358
+ * @param data Filter data
359
+ * @param frame Video frame to filter
360
+ * @return New video frame data. This can defer video data to
361
+ * be drawn later if time is needed for processing
362
+ */
363
+ struct obs_source_frame *(*filter_video)(void *data, struct obs_source_frame *frame);
364
+
365
+ /**
366
+ * Called to filter raw audio data.
367
+ *
368
+ * @note This function is only used with filter sources.
369
+ *
370
+ * @param data Filter data
371
+ * @param audio Audio data to filter.
372
+ * @return Modified or new audio data. You can directly modify
373
+ * the data passed and return it, or you can defer audio
374
+ * data for later if time is needed for processing. If
375
+ * you are returning new data, that data must exist
376
+ * until the next call to the filter_audio callback or
377
+ * until the filter is removed/destroyed.
378
+ */
379
+ struct obs_audio_data *(*filter_audio)(void *data, struct obs_audio_data *audio);
380
+
381
+ /**
382
+ * Called to enumerate all active sources being used within this
383
+ * source. If the source has children that render audio/video it must
384
+ * implement this callback.
385
+ *
386
+ * @param data Filter data
387
+ * @param enum_callback Enumeration callback
388
+ * @param param User data to pass to callback
389
+ */
390
+ void (*enum_active_sources)(void *data, obs_source_enum_proc_t enum_callback, void *param);
391
+
392
+ /**
393
+ * Called when saving a source. This is a separate function because
394
+ * sometimes a source needs to know when it is being saved so it
395
+ * doesn't always have to update the current settings until a certain
396
+ * point.
397
+ *
398
+ * @param data Source data
399
+ * @param settings Settings
400
+ */
401
+ void (*save)(void *data, obs_data_t *settings);
402
+
403
+ /**
404
+ * Called when loading a source from saved data. This should be called
405
+ * after all the loading sources have actually been created because
406
+ * sometimes there are sources that depend on each other.
407
+ *
408
+ * @param data Source data
409
+ * @param settings Settings
410
+ */
411
+ void (*load)(void *data, obs_data_t *settings);
412
+
413
+ /**
414
+ * Called when interacting with a source and a mouse-down or mouse-up
415
+ * occurs.
416
+ *
417
+ * @param data Source data
418
+ * @param event Mouse event properties
419
+ * @param type Mouse button pushed
420
+ * @param mouse_up Mouse event type (true if mouse-up)
421
+ * @param click_count Mouse click count (1 for single click, etc.)
422
+ */
423
+ void (*mouse_click)(void *data, const struct obs_mouse_event *event, int32_t type, bool mouse_up,
424
+ uint32_t click_count);
425
+ /**
426
+ * Called when interacting with a source and a mouse-move occurs.
427
+ *
428
+ * @param data Source data
429
+ * @param event Mouse event properties
430
+ * @param mouse_leave Mouse leave state (true if mouse left source)
431
+ */
432
+ void (*mouse_move)(void *data, const struct obs_mouse_event *event, bool mouse_leave);
433
+
434
+ /**
435
+ * Called when interacting with a source and a mouse-wheel occurs.
436
+ *
437
+ * @param data Source data
438
+ * @param event Mouse event properties
439
+ * @param x_delta Movement delta in the horizontal direction
440
+ * @param y_delta Movement delta in the vertical direction
441
+ */
442
+ void (*mouse_wheel)(void *data, const struct obs_mouse_event *event, int x_delta, int y_delta);
443
+ /**
444
+ * Called when interacting with a source and gain focus/lost focus event
445
+ * occurs.
446
+ *
447
+ * @param data Source data
448
+ * @param focus Focus state (true if focus gained)
449
+ */
450
+ void (*focus)(void *data, bool focus);
451
+
452
+ /**
453
+ * Called when interacting with a source and a key-up or key-down
454
+ * occurs.
455
+ *
456
+ * @param data Source data
457
+ * @param event Key event properties
458
+ * @param focus Key event type (true if mouse-up)
459
+ */
460
+ void (*key_click)(void *data, const struct obs_key_event *event, bool key_up);
461
+
462
+ /**
463
+ * Called when the filter is removed from a source
464
+ *
465
+ * @param data Filter data
466
+ * @param source Source that the filter being removed from
467
+ */
468
+ void (*filter_remove)(void *data, obs_source_t *source);
469
+
470
+ /**
471
+ * Private data associated with this entry
472
+ */
473
+ void *type_data;
474
+
475
+ /**
476
+ * If defined, called to free private data on shutdown
477
+ */
478
+ void (*free_type_data)(void *type_data);
479
+
480
+ bool (*audio_render)(void *data, uint64_t *ts_out, struct obs_source_audio_mix *audio_output, uint32_t mixers,
481
+ size_t channels, size_t sample_rate);
482
+
483
+ /**
484
+ * Called to enumerate all active and inactive sources being used
485
+ * within this source. If this callback isn't implemented,
486
+ * enum_active_sources will be called instead.
487
+ *
488
+ * This is typically used if a source can have inactive child sources.
489
+ *
490
+ * @param data Filter data
491
+ * @param enum_callback Enumeration callback
492
+ * @param param User data to pass to callback
493
+ */
494
+ void (*enum_all_sources)(void *data, obs_source_enum_proc_t enum_callback, void *param);
495
+
496
+ void (*transition_start)(void *data);
497
+ void (*transition_stop)(void *data);
498
+
499
+ /**
500
+ * Gets the default settings for this source
501
+ *
502
+ * If get_defaults is also defined both will be called, and the first
503
+ * call will be to get_defaults, then to get_defaults2.
504
+ *
505
+ * @param type_data The type_data variable of this structure
506
+ * @param[out] settings Data to assign default settings to
507
+ */
508
+ void (*get_defaults2)(void *type_data, obs_data_t *settings);
509
+
510
+ /**
511
+ * Gets the property information of this source
512
+ *
513
+ * @param data Source data
514
+ * @param type_data The type_data variable of this structure
515
+ * @return The properties data
516
+ */
517
+ obs_properties_t *(*get_properties2)(void *data, void *type_data);
518
+
519
+ bool (*audio_mix)(void *data, uint64_t *ts_out, struct audio_output_data *audio_output, size_t channels,
520
+ size_t sample_rate);
521
+
522
+ /** Icon type for the source */
523
+ enum obs_icon_type icon_type;
524
+
525
+ /** Media controls */
526
+ void (*media_play_pause)(void *data, bool pause);
527
+ void (*media_restart)(void *data);
528
+ void (*media_stop)(void *data);
529
+ void (*media_next)(void *data);
530
+ void (*media_previous)(void *data);
531
+ int64_t (*media_get_duration)(void *data);
532
+ int64_t (*media_get_time)(void *data);
533
+ void (*media_set_time)(void *data, int64_t miliseconds);
534
+ enum obs_media_state (*media_get_state)(void *data);
535
+
536
+ /* version-related stuff */
537
+ uint32_t version; /* increment if needed to specify a new version */
538
+ const char *unversioned_id; /* set internally, don't set manually */
539
+
540
+ /** Missing files **/
541
+ obs_missing_files_t *(*missing_files)(void *data);
542
+
543
+ /** Get color space **/
544
+ enum gs_color_space (*video_get_color_space)(void *data, size_t count,
545
+ const enum gs_color_space *preferred_spaces);
546
+
547
+ /**
548
+ * Called when the filter is added to a source
549
+ *
550
+ * @param data Filter data
551
+ * @param source Source that the filter is being added to
552
+ */
553
+ void (*filter_add)(void *data, obs_source_t *source);
554
+ };
555
+
556
+ EXPORT void obs_register_source_s(const struct obs_source_info *info, size_t size);
557
+
558
+ /**
559
+ * Registers a source definition to the current obs context. This should be
560
+ * used in obs_module_load.
561
+ *
562
+ * @param info Pointer to the source definition structure
563
+ */
564
+ #define obs_register_source(info) obs_register_source_s(info, sizeof(struct obs_source_info))
565
+
566
+ #ifdef __cplusplus
567
+ }
568
+ #endif