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,64 @@
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 "../util/bmem.h"
21
+ #include "video-io.h"
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ struct video_frame {
28
+ uint8_t *data[MAX_AV_PLANES];
29
+ uint32_t linesize[MAX_AV_PLANES];
30
+ };
31
+
32
+ EXPORT void video_frame_init(struct video_frame *frame, enum video_format format, uint32_t width, uint32_t height);
33
+
34
+ static inline void video_frame_free(struct video_frame *frame)
35
+ {
36
+ if (frame) {
37
+ bfree(frame->data[0]);
38
+ memset(frame, 0, sizeof(struct video_frame));
39
+ }
40
+ }
41
+
42
+ static inline struct video_frame *video_frame_create(enum video_format format, uint32_t width, uint32_t height)
43
+ {
44
+ struct video_frame *frame;
45
+
46
+ frame = (struct video_frame *)bzalloc(sizeof(struct video_frame));
47
+ video_frame_init(frame, format, width, height);
48
+ return frame;
49
+ }
50
+
51
+ static inline void video_frame_destroy(struct video_frame *frame)
52
+ {
53
+ if (frame) {
54
+ bfree(frame->data[0]);
55
+ bfree(frame);
56
+ }
57
+ }
58
+
59
+ EXPORT void video_frame_copy(struct video_frame *dst, const struct video_frame *src, enum video_format format,
60
+ uint32_t height);
61
+
62
+ #ifdef __cplusplus
63
+ }
64
+ #endif
@@ -0,0 +1,338 @@
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 "media-io-defs.h"
21
+ #include "../util/c99defs.h"
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ struct video_frame;
28
+
29
+ /* Base video output component. Use this to create a video output track. */
30
+
31
+ struct video_output;
32
+ typedef struct video_output video_t;
33
+
34
+ enum video_format {
35
+ VIDEO_FORMAT_NONE,
36
+
37
+ /* planar 4:2:0 formats */
38
+ VIDEO_FORMAT_I420, /* three-plane */
39
+ VIDEO_FORMAT_NV12, /* two-plane, luma and packed chroma */
40
+
41
+ /* packed 4:2:2 formats */
42
+ VIDEO_FORMAT_YVYU,
43
+ VIDEO_FORMAT_YUY2, /* YUYV */
44
+ VIDEO_FORMAT_UYVY,
45
+
46
+ /* packed uncompressed formats */
47
+ VIDEO_FORMAT_RGBA,
48
+ VIDEO_FORMAT_BGRA,
49
+ VIDEO_FORMAT_BGRX,
50
+ VIDEO_FORMAT_Y800, /* grayscale */
51
+
52
+ /* planar 4:4:4 */
53
+ VIDEO_FORMAT_I444,
54
+
55
+ /* more packed uncompressed formats */
56
+ VIDEO_FORMAT_BGR3,
57
+
58
+ /* planar 4:2:2 */
59
+ VIDEO_FORMAT_I422,
60
+
61
+ /* planar 4:2:0 with alpha */
62
+ VIDEO_FORMAT_I40A,
63
+
64
+ /* planar 4:2:2 with alpha */
65
+ VIDEO_FORMAT_I42A,
66
+
67
+ /* planar 4:4:4 with alpha */
68
+ VIDEO_FORMAT_YUVA,
69
+
70
+ /* packed 4:4:4 with alpha */
71
+ VIDEO_FORMAT_AYUV,
72
+
73
+ /* planar 4:2:0 format, 10 bpp */
74
+ VIDEO_FORMAT_I010, /* three-plane */
75
+ VIDEO_FORMAT_P010, /* two-plane, luma and packed chroma */
76
+
77
+ /* planar 4:2:2 format, 10 bpp */
78
+ VIDEO_FORMAT_I210,
79
+
80
+ /* planar 4:4:4 format, 12 bpp */
81
+ VIDEO_FORMAT_I412,
82
+
83
+ /* planar 4:4:4:4 format, 12 bpp */
84
+ VIDEO_FORMAT_YA2L,
85
+
86
+ /* planar 4:2:2 format, 16 bpp */
87
+ VIDEO_FORMAT_P216, /* two-plane, luma and packed chroma */
88
+
89
+ /* planar 4:4:4 format, 16 bpp */
90
+ VIDEO_FORMAT_P416, /* two-plane, luma and packed chroma */
91
+
92
+ /* packed 4:2:2 format, 10 bpp */
93
+ VIDEO_FORMAT_V210,
94
+
95
+ /* packed uncompressed 10-bit format */
96
+ VIDEO_FORMAT_R10L,
97
+ };
98
+
99
+ enum video_trc {
100
+ VIDEO_TRC_DEFAULT,
101
+ VIDEO_TRC_SRGB,
102
+ VIDEO_TRC_PQ,
103
+ VIDEO_TRC_HLG,
104
+ };
105
+
106
+ enum video_colorspace {
107
+ VIDEO_CS_DEFAULT,
108
+ VIDEO_CS_601,
109
+ VIDEO_CS_709,
110
+ VIDEO_CS_SRGB,
111
+ VIDEO_CS_2100_PQ,
112
+ VIDEO_CS_2100_HLG,
113
+ };
114
+
115
+ enum video_range_type {
116
+ VIDEO_RANGE_DEFAULT,
117
+ VIDEO_RANGE_PARTIAL,
118
+ VIDEO_RANGE_FULL,
119
+ };
120
+
121
+ struct video_data {
122
+ uint8_t *data[MAX_AV_PLANES];
123
+ uint32_t linesize[MAX_AV_PLANES];
124
+ uint64_t timestamp;
125
+ };
126
+
127
+ struct video_output_info {
128
+ const char *name;
129
+
130
+ enum video_format format;
131
+ uint32_t fps_num;
132
+ uint32_t fps_den;
133
+ uint32_t width;
134
+ uint32_t height;
135
+ size_t cache_size;
136
+
137
+ enum video_colorspace colorspace;
138
+ enum video_range_type range;
139
+ };
140
+
141
+ static inline bool format_is_yuv(enum video_format format)
142
+ {
143
+ switch (format) {
144
+ case VIDEO_FORMAT_I420:
145
+ case VIDEO_FORMAT_NV12:
146
+ case VIDEO_FORMAT_I422:
147
+ case VIDEO_FORMAT_I210:
148
+ case VIDEO_FORMAT_YVYU:
149
+ case VIDEO_FORMAT_YUY2:
150
+ case VIDEO_FORMAT_UYVY:
151
+ case VIDEO_FORMAT_I444:
152
+ case VIDEO_FORMAT_I412:
153
+ case VIDEO_FORMAT_I40A:
154
+ case VIDEO_FORMAT_I42A:
155
+ case VIDEO_FORMAT_YUVA:
156
+ case VIDEO_FORMAT_YA2L:
157
+ case VIDEO_FORMAT_AYUV:
158
+ case VIDEO_FORMAT_I010:
159
+ case VIDEO_FORMAT_P010:
160
+ case VIDEO_FORMAT_P216:
161
+ case VIDEO_FORMAT_P416:
162
+ case VIDEO_FORMAT_V210:
163
+ return true;
164
+ case VIDEO_FORMAT_NONE:
165
+ case VIDEO_FORMAT_RGBA:
166
+ case VIDEO_FORMAT_BGRA:
167
+ case VIDEO_FORMAT_BGRX:
168
+ case VIDEO_FORMAT_Y800:
169
+ case VIDEO_FORMAT_BGR3:
170
+ case VIDEO_FORMAT_R10L:
171
+ return false;
172
+ }
173
+
174
+ return false;
175
+ }
176
+
177
+ static inline const char *get_video_format_name(enum video_format format)
178
+ {
179
+ switch (format) {
180
+ case VIDEO_FORMAT_I420:
181
+ return "I420";
182
+ case VIDEO_FORMAT_NV12:
183
+ return "NV12";
184
+ case VIDEO_FORMAT_I422:
185
+ return "I422";
186
+ case VIDEO_FORMAT_I210:
187
+ return "I210";
188
+ case VIDEO_FORMAT_YVYU:
189
+ return "YVYU";
190
+ case VIDEO_FORMAT_YUY2:
191
+ return "YUY2";
192
+ case VIDEO_FORMAT_UYVY:
193
+ return "UYVY";
194
+ case VIDEO_FORMAT_RGBA:
195
+ return "RGBA";
196
+ case VIDEO_FORMAT_BGRA:
197
+ return "BGRA";
198
+ case VIDEO_FORMAT_BGRX:
199
+ return "BGRX";
200
+ case VIDEO_FORMAT_I444:
201
+ return "I444";
202
+ case VIDEO_FORMAT_I412:
203
+ return "I412";
204
+ case VIDEO_FORMAT_Y800:
205
+ return "Y800";
206
+ case VIDEO_FORMAT_BGR3:
207
+ return "BGR3";
208
+ case VIDEO_FORMAT_I40A:
209
+ return "I40A";
210
+ case VIDEO_FORMAT_I42A:
211
+ return "I42A";
212
+ case VIDEO_FORMAT_YUVA:
213
+ return "YUVA";
214
+ case VIDEO_FORMAT_YA2L:
215
+ return "YA2L";
216
+ case VIDEO_FORMAT_AYUV:
217
+ return "AYUV";
218
+ case VIDEO_FORMAT_I010:
219
+ return "I010";
220
+ case VIDEO_FORMAT_P010:
221
+ return "P010";
222
+ case VIDEO_FORMAT_P216:
223
+ return "P216";
224
+ case VIDEO_FORMAT_P416:
225
+ return "P416";
226
+ case VIDEO_FORMAT_V210:
227
+ return "v210";
228
+ case VIDEO_FORMAT_R10L:
229
+ return "R10l";
230
+ case VIDEO_FORMAT_NONE:;
231
+ }
232
+
233
+ return "None";
234
+ }
235
+
236
+ static inline const char *get_video_colorspace_name(enum video_colorspace cs)
237
+ {
238
+ switch (cs) {
239
+ case VIDEO_CS_DEFAULT:
240
+ case VIDEO_CS_709:
241
+ return "Rec. 709";
242
+ case VIDEO_CS_SRGB:
243
+ return "sRGB";
244
+ case VIDEO_CS_601:
245
+ return "Rec. 601";
246
+ case VIDEO_CS_2100_PQ:
247
+ return "Rec. 2100 (PQ)";
248
+ case VIDEO_CS_2100_HLG:
249
+ return "Rec. 2100 (HLG)";
250
+ }
251
+
252
+ return "Unknown";
253
+ }
254
+
255
+ static inline enum video_range_type resolve_video_range(enum video_format format, enum video_range_type range)
256
+ {
257
+ if (range == VIDEO_RANGE_DEFAULT) {
258
+ range = format_is_yuv(format) ? VIDEO_RANGE_PARTIAL : VIDEO_RANGE_FULL;
259
+ }
260
+
261
+ return range;
262
+ }
263
+
264
+ static inline const char *get_video_range_name(enum video_format format, enum video_range_type range)
265
+ {
266
+ range = resolve_video_range(format, range);
267
+ return range == VIDEO_RANGE_FULL ? "Full" : "Partial";
268
+ }
269
+
270
+ enum video_scale_type {
271
+ VIDEO_SCALE_DEFAULT,
272
+ VIDEO_SCALE_POINT,
273
+ VIDEO_SCALE_FAST_BILINEAR,
274
+ VIDEO_SCALE_BILINEAR,
275
+ VIDEO_SCALE_BICUBIC,
276
+ };
277
+
278
+ struct video_scale_info {
279
+ enum video_format format;
280
+ uint32_t width;
281
+ uint32_t height;
282
+ enum video_range_type range;
283
+ enum video_colorspace colorspace;
284
+ };
285
+
286
+ EXPORT enum video_format video_format_from_fourcc(uint32_t fourcc);
287
+
288
+ EXPORT bool video_format_get_parameters(enum video_colorspace color_space, enum video_range_type range,
289
+ float matrix[16], float min_range[3], float max_range[3]);
290
+ EXPORT bool video_format_get_parameters_for_format(enum video_colorspace color_space, enum video_range_type range,
291
+ enum video_format format, float matrix[16], float min_range[3],
292
+ float max_range[3]);
293
+
294
+ #define VIDEO_OUTPUT_SUCCESS 0
295
+ #define VIDEO_OUTPUT_INVALIDPARAM -1
296
+ #define VIDEO_OUTPUT_FAIL -2
297
+
298
+ EXPORT int video_output_open(video_t **video, struct video_output_info *info);
299
+ EXPORT void video_output_close(video_t *video);
300
+
301
+ EXPORT bool video_output_connect(video_t *video, const struct video_scale_info *conversion,
302
+ void (*callback)(void *param, struct video_data *frame), void *param);
303
+ EXPORT bool video_output_connect2(video_t *video, const struct video_scale_info *conversion,
304
+ uint32_t frame_rate_divisor, void (*callback)(void *param, struct video_data *frame),
305
+ void *param);
306
+ EXPORT void video_output_disconnect(video_t *video, void (*callback)(void *param, struct video_data *frame),
307
+ void *param);
308
+ EXPORT bool video_output_disconnect2(video_t *video, void (*callback)(void *param, struct video_data *frame),
309
+ void *param);
310
+
311
+ EXPORT bool video_output_active(const video_t *video);
312
+
313
+ EXPORT const struct video_output_info *video_output_get_info(const video_t *video);
314
+ EXPORT bool video_output_lock_frame(video_t *video, struct video_frame *frame, int count, uint64_t timestamp);
315
+ EXPORT void video_output_unlock_frame(video_t *video);
316
+ EXPORT uint64_t video_output_get_frame_time(const video_t *video);
317
+ EXPORT void video_output_stop(video_t *video);
318
+ EXPORT bool video_output_stopped(video_t *video);
319
+
320
+ EXPORT enum video_format video_output_get_format(const video_t *video);
321
+ EXPORT uint32_t video_output_get_width(const video_t *video);
322
+ EXPORT uint32_t video_output_get_height(const video_t *video);
323
+ EXPORT double video_output_get_frame_rate(const video_t *video);
324
+
325
+ EXPORT uint32_t video_output_get_skipped_frames(const video_t *video);
326
+ EXPORT uint32_t video_output_get_total_frames(const video_t *video);
327
+
328
+ extern void video_output_inc_texture_encoders(video_t *video);
329
+ extern void video_output_dec_texture_encoders(video_t *video);
330
+ extern void video_output_inc_texture_frames(video_t *video);
331
+ extern void video_output_inc_texture_skipped_frames(video_t *video);
332
+
333
+ extern video_t *video_output_create_with_frame_rate_divisor(video_t *video, uint32_t divisor);
334
+ extern void video_output_free_frame_rate_divisor(video_t *video);
335
+
336
+ #ifdef __cplusplus
337
+ }
338
+ #endif
@@ -0,0 +1,43 @@
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 "../util/c99defs.h"
21
+ #include "video-io.h"
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ struct video_scaler;
28
+ typedef struct video_scaler video_scaler_t;
29
+
30
+ #define VIDEO_SCALER_SUCCESS 0
31
+ #define VIDEO_SCALER_BAD_CONVERSION -1
32
+ #define VIDEO_SCALER_FAILED -2
33
+
34
+ EXPORT int video_scaler_create(video_scaler_t **scaler, const struct video_scale_info *dst,
35
+ const struct video_scale_info *src, enum video_scale_type type);
36
+ EXPORT void video_scaler_destroy(video_scaler_t *scaler);
37
+
38
+ EXPORT bool video_scaler_scale(video_scaler_t *scaler, uint8_t *output[], const uint32_t out_linesize[],
39
+ const uint8_t *const input[], const uint32_t in_linesize[]);
40
+
41
+ #ifdef __cplusplus
42
+ }
43
+ #endif
@@ -0,0 +1,250 @@
1
+ /*
2
+ Copyright (C) 2014 by Leonhard Oelke <leonhard@in-verted.de>
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 audio controls
25
+ *
26
+ * @brief Audio controls for use in GUIs
27
+ */
28
+
29
+ #ifdef __cplusplus
30
+ extern "C" {
31
+ #endif
32
+
33
+ /**
34
+ * @brief Fader types
35
+ */
36
+ enum obs_fader_type {
37
+ /**
38
+ * @brief A simple cubic fader for controlling audio levels
39
+ *
40
+ * This is a very common type of software fader since it yields good
41
+ * results while being quite performant.
42
+ * The input value is mapped to mul values with the simple formula x^3.
43
+ */
44
+ OBS_FADER_CUBIC,
45
+ /**
46
+ * @brief A fader compliant to IEC 60-268-18
47
+ *
48
+ * This type of fader has several segments with different slopes that
49
+ * map deflection linearly to dB values. The segments are defined as
50
+ * in the following table:
51
+ *
52
+ @code
53
+ Deflection | Volume
54
+ ------------------------------------------
55
+ [ 100 %, 75 % ] | [ 0 dB, -9 dB ]
56
+ [ 75 %, 50 % ] | [ -9 dB, -20 dB ]
57
+ [ 50 %, 30 % ] | [ -20 dB, -30 dB ]
58
+ [ 30 %, 15 % ] | [ -30 dB, -40 dB ]
59
+ [ 15 %, 7.5 % ] | [ -40 dB, -50 dB ]
60
+ [ 7.5 %, 2.5 % ] | [ -50 dB, -60 dB ]
61
+ [ 2.5 %, 0 % ] | [ -60 dB, -inf dB ]
62
+ @endcode
63
+ */
64
+ OBS_FADER_IEC,
65
+ /**
66
+ * @brief Logarithmic fader
67
+ */
68
+ OBS_FADER_LOG
69
+ };
70
+
71
+ /**
72
+ * @brief Peak meter types
73
+ */
74
+ enum obs_peak_meter_type {
75
+ /**
76
+ * @brief A simple peak meter measuring the maximum of all samples.
77
+ *
78
+ * This was a very common type of peak meter used for audio, but
79
+ * is not very accurate with regards to further audio processing.
80
+ */
81
+ SAMPLE_PEAK_METER,
82
+
83
+ /**
84
+ * @brief An accurate peak meter measure the maximum of inter-samples.
85
+ *
86
+ * This meter is more computational intensive due to 4x oversampling
87
+ * to determine the true peak to an accuracy of +/- 0.5 dB.
88
+ */
89
+ TRUE_PEAK_METER
90
+ };
91
+
92
+ /**
93
+ * @brief Create a fader
94
+ * @param type the type of the fader
95
+ * @return pointer to the fader object
96
+ *
97
+ * A fader object is used to map input values from a gui element to dB and
98
+ * subsequently multiplier values used by libobs to mix audio.
99
+ * The current "position" of the fader is internally stored as dB value.
100
+ */
101
+ EXPORT obs_fader_t *obs_fader_create(enum obs_fader_type type);
102
+
103
+ /**
104
+ * @brief Destroy a fader
105
+ * @param fader pointer to the fader object
106
+ *
107
+ * Destroy the fader and free all related data
108
+ */
109
+ EXPORT void obs_fader_destroy(obs_fader_t *fader);
110
+
111
+ /**
112
+ * @brief Set the fader dB value
113
+ * @param fader pointer to the fader object
114
+ * @param db new dB value
115
+ * @return true if value was set without clamping
116
+ */
117
+ EXPORT bool obs_fader_set_db(obs_fader_t *fader, const float db);
118
+
119
+ /**
120
+ * @brief Get the current fader dB value
121
+ * @param fader pointer to the fader object
122
+ * @return current fader dB value
123
+ */
124
+ EXPORT float obs_fader_get_db(obs_fader_t *fader);
125
+
126
+ /**
127
+ * @brief Set the fader value from deflection
128
+ * @param fader pointer to the fader object
129
+ * @param def new deflection
130
+ * @return true if value was set without clamping
131
+ *
132
+ * This sets the new fader value from the supplied deflection, in case the
133
+ * resulting value was clamped due to limits this function will return false.
134
+ * The deflection is typically in the range [0.0, 1.0] but may be higher in
135
+ * order to provide some amplification. In order for this to work the high dB
136
+ * limit has to be set.
137
+ */
138
+ EXPORT bool obs_fader_set_deflection(obs_fader_t *fader, const float def);
139
+
140
+ /**
141
+ * @brief Get the current fader deflection
142
+ * @param fader pointer to the fader object
143
+ * @return current fader deflection
144
+ */
145
+ EXPORT float obs_fader_get_deflection(obs_fader_t *fader);
146
+
147
+ /**
148
+ * @brief Set the fader value from multiplier
149
+ * @param fader pointer to the fader object
150
+ * @return true if the value was set without clamping
151
+ */
152
+ EXPORT bool obs_fader_set_mul(obs_fader_t *fader, const float mul);
153
+
154
+ /**
155
+ * @brief Get the current fader multiplier value
156
+ * @param fader pointer to the fader object
157
+ * @return current fader multiplier
158
+ */
159
+ EXPORT float obs_fader_get_mul(obs_fader_t *fader);
160
+
161
+ /**
162
+ * @brief Attach the fader to a source
163
+ * @param fader pointer to the fader object
164
+ * @param source pointer to the source object
165
+ * @return true on success
166
+ *
167
+ * When the fader is attached to a source it will automatically sync it's state
168
+ * to the volume of the source.
169
+ */
170
+ EXPORT bool obs_fader_attach_source(obs_fader_t *fader, obs_source_t *source);
171
+
172
+ /**
173
+ * @brief Detach the fader from the currently attached source
174
+ * @param fader pointer to the fader object
175
+ */
176
+ EXPORT void obs_fader_detach_source(obs_fader_t *fader);
177
+
178
+ typedef void (*obs_fader_changed_t)(void *param, float db);
179
+
180
+ EXPORT void obs_fader_add_callback(obs_fader_t *fader, obs_fader_changed_t callback, void *param);
181
+ EXPORT void obs_fader_remove_callback(obs_fader_t *fader, obs_fader_changed_t callback, void *param);
182
+
183
+ /**
184
+ * @brief Create a volume meter
185
+ * @param type the mapping type to use for the volume meter
186
+ * @return pointer to the volume meter object
187
+ *
188
+ * A volume meter object is used to prepare the sound levels reported by audio
189
+ * sources for display in a GUI.
190
+ * It will automatically take source volume into account and map the levels
191
+ * to a range [0.0f, 1.0f].
192
+ */
193
+ EXPORT obs_volmeter_t *obs_volmeter_create(enum obs_fader_type type);
194
+
195
+ /**
196
+ * @brief Destroy a volume meter
197
+ * @param volmeter pointer to the volmeter object
198
+ *
199
+ * Destroy the volume meter and free all related data
200
+ */
201
+ EXPORT void obs_volmeter_destroy(obs_volmeter_t *volmeter);
202
+
203
+ /**
204
+ * @brief Attach the volume meter to a source
205
+ * @param volmeter pointer to the volume meter object
206
+ * @param source pointer to the source object
207
+ * @return true on success
208
+ *
209
+ * When the volume meter is attached to a source it will start to listen to
210
+ * volume updates on the source and after preparing the data emit its own
211
+ * signal.
212
+ */
213
+ EXPORT bool obs_volmeter_attach_source(obs_volmeter_t *volmeter, obs_source_t *source);
214
+
215
+ /**
216
+ * @brief Detach the volume meter from the currently attached source
217
+ * @param volmeter pointer to the volume meter object
218
+ */
219
+ EXPORT void obs_volmeter_detach_source(obs_volmeter_t *volmeter);
220
+
221
+ /**
222
+ * @brief Set the peak meter type for the volume meter
223
+ * @param volmeter pointer to the volume meter object
224
+ * @param peak_meter_type set if true-peak needs to be measured.
225
+ */
226
+ EXPORT void obs_volmeter_set_peak_meter_type(obs_volmeter_t *volmeter, enum obs_peak_meter_type peak_meter_type);
227
+
228
+ /**
229
+ * @brief Get the number of channels which are configured for this source.
230
+ * @param volmeter pointer to the volume meter object
231
+ */
232
+ EXPORT int obs_volmeter_get_nr_channels(obs_volmeter_t *volmeter);
233
+
234
+ typedef void (*obs_volmeter_updated_t)(void *param, const float magnitude[MAX_AUDIO_CHANNELS],
235
+ const float peak[MAX_AUDIO_CHANNELS],
236
+ const float input_peak[MAX_AUDIO_CHANNELS]);
237
+
238
+ EXPORT void obs_volmeter_add_callback(obs_volmeter_t *volmeter, obs_volmeter_updated_t callback, void *param);
239
+ EXPORT void obs_volmeter_remove_callback(obs_volmeter_t *volmeter, obs_volmeter_updated_t callback, void *param);
240
+
241
+ EXPORT float obs_mul_to_db(float mul);
242
+ EXPORT float obs_db_to_mul(float db);
243
+
244
+ typedef float (*obs_fader_conversion_t)(const float val);
245
+
246
+ EXPORT obs_fader_conversion_t obs_fader_db_to_def(obs_fader_t *fader);
247
+
248
+ #ifdef __cplusplus
249
+ }
250
+ #endif