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,361 @@
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
+ /**
21
+ * @file
22
+ * @brief header for modules implementing encoders.
23
+ *
24
+ * Encoders are modules that implement some codec that can be used by libobs
25
+ * to process output data.
26
+ */
27
+
28
+ #ifdef __cplusplus
29
+ extern "C" {
30
+ #endif
31
+
32
+ struct obs_encoder;
33
+ typedef struct obs_encoder obs_encoder_t;
34
+
35
+ #define OBS_ENCODER_CAP_DEPRECATED (1 << 0)
36
+ #define OBS_ENCODER_CAP_PASS_TEXTURE (1 << 1)
37
+ #define OBS_ENCODER_CAP_DYN_BITRATE (1 << 2)
38
+ #define OBS_ENCODER_CAP_INTERNAL (1 << 3)
39
+ #define OBS_ENCODER_CAP_ROI (1 << 4)
40
+ #define OBS_ENCODER_CAP_SCALING (1 << 5)
41
+
42
+ /** Specifies the encoder type */
43
+ enum obs_encoder_type {
44
+ OBS_ENCODER_AUDIO, /**< The encoder provides an audio codec */
45
+ OBS_ENCODER_VIDEO /**< The encoder provides a video codec */
46
+ };
47
+
48
+ /* encoder_packet_time is used for timestamping events associated
49
+ * with each video frame. This is useful for deriving absolute
50
+ * timestamps (i.e. wall-clock based formats) and measuring latency.
51
+ *
52
+ * For each frame, there are four events of interest, described in
53
+ * the encoder_packet_time struct, namely cts, fer, ferc, and pir.
54
+ * The timebase of these four events is os_gettime_ns(), which provides
55
+ * very high resolution timestamping, and the ability to convert the
56
+ * timing to any other time format.
57
+ *
58
+ * Each frame follows a timeline in the following temporal order:
59
+ * CTS, FER, FERC, PIR
60
+ *
61
+ * PTS is the integer-based monotonically increasing value that is used
62
+ * to associate an encoder_packet_time entry with a specific encoder_packet.
63
+ */
64
+ struct encoder_packet_time {
65
+ /* PTS used to associate uncompressed frames with encoded packets. */
66
+ int64_t pts;
67
+
68
+ /* Composition timestamp is when the frame was rendered,
69
+ * captured via os_gettime_ns().
70
+ */
71
+ uint64_t cts;
72
+
73
+ /* FERC (Frame Encode Request) is when the frame was
74
+ * submitted to the encoder for encoding via the encode
75
+ * callback (e.g. encode_texture2()), captured via os_gettime_ns().
76
+ */
77
+ uint64_t fer;
78
+
79
+ /* FERC (Frame Encode Request Complete) is when
80
+ * the associated FER event completed. If the encode
81
+ * is synchronous with the call, this means FERC - FEC
82
+ * measures the actual encode time, otherwise if the
83
+ * encode is asynchronous, it measures the pipeline
84
+ * delay between encode request and encode complete.
85
+ * FERC is also captured via os_gettime_ns().
86
+ */
87
+ uint64_t ferc;
88
+
89
+ /* PIR (Packet Interleave Request) is when the encoded packet
90
+ * is interleaved with the stream. PIR is captured via
91
+ * os_gettime_ns(). The difference between PIR and CTS gives
92
+ * the total latency between frame rendering
93
+ * and packet interleaving.
94
+ */
95
+ uint64_t pir;
96
+ };
97
+
98
+ /** Encoder output packet */
99
+ struct encoder_packet {
100
+ uint8_t *data; /**< Packet data */
101
+ size_t size; /**< Packet size */
102
+
103
+ int64_t pts; /**< Presentation timestamp */
104
+ int64_t dts; /**< Decode timestamp */
105
+
106
+ int32_t timebase_num; /**< Timebase numerator */
107
+ int32_t timebase_den; /**< Timebase denominator */
108
+
109
+ enum obs_encoder_type type; /**< Encoder type */
110
+
111
+ bool keyframe; /**< Is a keyframe */
112
+
113
+ /* ---------------------------------------------------------------- */
114
+ /* Internal video variables (will be parsed automatically) */
115
+
116
+ /* DTS in microseconds */
117
+ int64_t dts_usec;
118
+
119
+ /* System DTS in microseconds */
120
+ int64_t sys_dts_usec;
121
+
122
+ /**
123
+ * Packet priority
124
+ *
125
+ * This is generally use by video encoders to specify the priority
126
+ * of the packet.
127
+ */
128
+ int priority;
129
+
130
+ /**
131
+ * Dropped packet priority
132
+ *
133
+ * If this packet needs to be dropped, the next packet must be of this
134
+ * priority or higher to continue transmission.
135
+ */
136
+ int drop_priority;
137
+
138
+ /** Audio track index (used with outputs) */
139
+ size_t track_idx;
140
+
141
+ /** Encoder from which the track originated from */
142
+ obs_encoder_t *encoder;
143
+ };
144
+
145
+ /** Encoder input frame */
146
+ struct encoder_frame {
147
+ /** Data for the frame/audio */
148
+ uint8_t *data[MAX_AV_PLANES];
149
+
150
+ /** size of each plane */
151
+ uint32_t linesize[MAX_AV_PLANES];
152
+
153
+ /** Number of frames (audio only) */
154
+ uint32_t frames;
155
+
156
+ /** Presentation timestamp */
157
+ int64_t pts;
158
+ };
159
+
160
+ /** Encoder region of interest */
161
+ struct obs_encoder_roi {
162
+ /* The rectangle edges of the region are specified as number of pixels
163
+ * from the input video's top and left edges (i.e. row/column 0). */
164
+ uint32_t top;
165
+ uint32_t bottom;
166
+ uint32_t left;
167
+ uint32_t right;
168
+
169
+ /* Priority is specified as a float value between -1 and 1.
170
+ * These are converted to encoder-specific values by the encoder.
171
+ * Values above 0 tell the encoder to increase quality for that region,
172
+ * values below tell it to worsen it.
173
+ * Not all encoders support negative values and they may be ignored. */
174
+ float priority;
175
+ };
176
+
177
+ struct gs_texture;
178
+
179
+ /** Encoder input texture */
180
+ struct encoder_texture {
181
+ /** Shared texture handle, only set on Windows */
182
+ uint32_t handle;
183
+ /** Textures, length determined by format */
184
+ struct gs_texture *tex[4];
185
+ };
186
+
187
+ /**
188
+ * Encoder interface
189
+ *
190
+ * Encoders have a limited usage with OBS. You are not generally supposed to
191
+ * implement every encoder out there. Generally, these are limited or specific
192
+ * encoders for h264/aac for streaming and recording. It doesn't have to be
193
+ * *just* h264 or aac of course, but generally those are the expected encoders.
194
+ *
195
+ * That being said, other encoders will be kept in mind for future use.
196
+ */
197
+ struct obs_encoder_info {
198
+ /* ----------------------------------------------------------------- */
199
+ /* Required implementation*/
200
+
201
+ /** Specifies the named identifier of this encoder */
202
+ const char *id;
203
+
204
+ /** Specifies the encoder type (video or audio) */
205
+ enum obs_encoder_type type;
206
+
207
+ /** Specifies the codec */
208
+ const char *codec;
209
+
210
+ /**
211
+ * Gets the full translated name of this encoder
212
+ *
213
+ * @param type_data The type_data variable of this structure
214
+ * @return Translated name of the encoder
215
+ */
216
+ const char *(*get_name)(void *type_data);
217
+
218
+ /**
219
+ * Creates the encoder with the specified settings
220
+ *
221
+ * @param settings Settings for the encoder
222
+ * @param encoder OBS encoder context
223
+ * @return Data associated with this encoder context, or
224
+ * NULL if initialization failed.
225
+ */
226
+ void *(*create)(obs_data_t *settings, obs_encoder_t *encoder);
227
+
228
+ /**
229
+ * Destroys the encoder data
230
+ *
231
+ * @param data Data associated with this encoder context
232
+ */
233
+ void (*destroy)(void *data);
234
+
235
+ /**
236
+ * Encodes frame(s), and outputs encoded packets as they become
237
+ * available.
238
+ *
239
+ * @param data Data associated with this encoder
240
+ * context
241
+ * @param[in] frame Raw audio/video data to encode
242
+ * @param[out] packet Encoder packet output, if any
243
+ * @param[out] received_packet Set to true if a packet was received,
244
+ * false otherwise
245
+ * @return true if successful, false otherwise.
246
+ */
247
+ bool (*encode)(void *data, struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet);
248
+
249
+ /** Audio encoder only: Returns the frame size for this encoder */
250
+ size_t (*get_frame_size)(void *data);
251
+
252
+ /* ----------------------------------------------------------------- */
253
+ /* Optional implementation */
254
+
255
+ /**
256
+ * Gets the default settings for this encoder
257
+ *
258
+ * @param[out] settings Data to assign default settings to
259
+ */
260
+ void (*get_defaults)(obs_data_t *settings);
261
+
262
+ /**
263
+ * Gets the property information of this encoder
264
+ *
265
+ * @return The properties data
266
+ */
267
+ obs_properties_t *(*get_properties)(void *data);
268
+
269
+ /**
270
+ * Updates the settings for this encoder (usually used for things like
271
+ * changing bitrate while active)
272
+ *
273
+ * @param data Data associated with this encoder context
274
+ * @param settings New settings for this encoder
275
+ * @return true if successful, false otherwise
276
+ */
277
+ bool (*update)(void *data, obs_data_t *settings);
278
+
279
+ /**
280
+ * Returns extra data associated with this encoder (usually header)
281
+ *
282
+ * @param data Data associated with this encoder context
283
+ * @param[out] extra_data Pointer to receive the extra data
284
+ * @param[out] size Pointer to receive the size of the extra
285
+ * data
286
+ * @return true if extra data available, false
287
+ * otherwise
288
+ */
289
+ bool (*get_extra_data)(void *data, uint8_t **extra_data, size_t *size);
290
+
291
+ /**
292
+ * Gets the SEI data, if any
293
+ *
294
+ * @param data Data associated with this encoder context
295
+ * @param[out] sei_data Pointer to receive the SEI data
296
+ * @param[out] size Pointer to receive the SEI data size
297
+ * @return true if SEI data available, false otherwise
298
+ */
299
+ bool (*get_sei_data)(void *data, uint8_t **sei_data, size_t *size);
300
+
301
+ /**
302
+ * Returns desired audio format and sample information
303
+ *
304
+ * @param data Data associated with this encoder context
305
+ * @param[in/out] info Audio format information
306
+ */
307
+ void (*get_audio_info)(void *data, struct audio_convert_info *info);
308
+
309
+ /**
310
+ * Returns desired video format information
311
+ *
312
+ * @param data Data associated with this encoder context
313
+ * @param[in/out] info Video format information
314
+ */
315
+ void (*get_video_info)(void *data, struct video_scale_info *info);
316
+
317
+ void *type_data;
318
+ void (*free_type_data)(void *type_data);
319
+
320
+ uint32_t caps;
321
+
322
+ /**
323
+ * Gets the default settings for this encoder
324
+ *
325
+ * If get_defaults is also defined both will be called, and the first
326
+ * call will be to get_defaults, then to get_defaults2.
327
+ *
328
+ * @param[out] settings Data to assign default settings to
329
+ * @param[in] typedata Type Data
330
+ */
331
+ void (*get_defaults2)(obs_data_t *settings, void *type_data);
332
+
333
+ /**
334
+ * Gets the property information of this encoder
335
+ *
336
+ * @param[in] data Pointer from create (or null)
337
+ * @param[in] typedata Type Data
338
+ * @return The properties data
339
+ */
340
+ obs_properties_t *(*get_properties2)(void *data, void *type_data);
341
+
342
+ bool (*encode_texture)(void *data, uint32_t handle, int64_t pts, uint64_t lock_key, uint64_t *next_key,
343
+ struct encoder_packet *packet, bool *received_packet);
344
+
345
+ bool (*encode_texture2)(void *data, struct encoder_texture *texture, int64_t pts, uint64_t lock_key,
346
+ uint64_t *next_key, struct encoder_packet *packet, bool *received_packet);
347
+ };
348
+
349
+ EXPORT void obs_register_encoder_s(const struct obs_encoder_info *info, size_t size);
350
+
351
+ /**
352
+ * Register an encoder definition to the current obs context. This should be
353
+ * used in obs_module_load.
354
+ *
355
+ * @param info Pointer to the source definition structure.
356
+ */
357
+ #define obs_register_encoder(info) obs_register_encoder_s(info, sizeof(struct obs_encoder_info))
358
+
359
+ #ifdef __cplusplus
360
+ }
361
+ #endif
@@ -0,0 +1,13 @@
1
+ #pragma once
2
+
3
+ #include <libavcodec/avcodec.h>
4
+
5
+ /* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
6
+ * a is the major version
7
+ * b and c the minor and micro versions of libav
8
+ * d and e the minor and micro versions of FFmpeg */
9
+ #define LIBAVCODEC_VERSION_CHECK(a, b, c, d, e) \
10
+ ((LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(a, b, c)) || \
11
+ (LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(a, d, e)))
12
+
13
+ #define INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
@@ -0,0 +1,81 @@
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
+
22
+ #ifdef __cplusplus
23
+ extern "C" {
24
+ #endif
25
+
26
+ struct encoder_packet;
27
+
28
+ enum {
29
+ OBS_HEVC_NAL_TRAIL_N = 0,
30
+ OBS_HEVC_NAL_TRAIL_R = 1,
31
+ OBS_HEVC_NAL_TSA_N = 2,
32
+ OBS_HEVC_NAL_TSA_R = 3,
33
+ OBS_HEVC_NAL_STSA_N = 4,
34
+ OBS_HEVC_NAL_STSA_R = 5,
35
+ OBS_HEVC_NAL_RADL_N = 6,
36
+ OBS_HEVC_NAL_RADL_R = 7,
37
+ OBS_HEVC_NAL_RASL_N = 8,
38
+ OBS_HEVC_NAL_RASL_R = 9,
39
+ OBS_HEVC_NAL_VCL_N10 = 10,
40
+ OBS_HEVC_NAL_VCL_R11 = 11,
41
+ OBS_HEVC_NAL_VCL_N12 = 12,
42
+ OBS_HEVC_NAL_VCL_R13 = 13,
43
+ OBS_HEVC_NAL_VCL_N14 = 14,
44
+ OBS_HEVC_NAL_VCL_R15 = 15,
45
+ OBS_HEVC_NAL_BLA_W_LP = 16,
46
+ OBS_HEVC_NAL_BLA_W_RADL = 17,
47
+ OBS_HEVC_NAL_BLA_N_LP = 18,
48
+ OBS_HEVC_NAL_IDR_W_RADL = 19,
49
+ OBS_HEVC_NAL_IDR_N_LP = 20,
50
+ OBS_HEVC_NAL_CRA_NUT = 21,
51
+ OBS_HEVC_NAL_RSV_IRAP_VCL22 = 22,
52
+ OBS_HEVC_NAL_RSV_IRAP_VCL23 = 23,
53
+ OBS_HEVC_NAL_RSV_VCL24 = 24,
54
+ OBS_HEVC_NAL_RSV_VCL25 = 25,
55
+ OBS_HEVC_NAL_RSV_VCL26 = 26,
56
+ OBS_HEVC_NAL_RSV_VCL27 = 27,
57
+ OBS_HEVC_NAL_RSV_VCL28 = 28,
58
+ OBS_HEVC_NAL_RSV_VCL29 = 29,
59
+ OBS_HEVC_NAL_RSV_VCL30 = 30,
60
+ OBS_HEVC_NAL_RSV_VCL31 = 31,
61
+ OBS_HEVC_NAL_VPS = 32,
62
+ OBS_HEVC_NAL_SPS = 33,
63
+ OBS_HEVC_NAL_PPS = 34,
64
+ OBS_HEVC_NAL_AUD = 35,
65
+ OBS_HEVC_NAL_EOS_NUT = 36,
66
+ OBS_HEVC_NAL_EOB_NUT = 37,
67
+ OBS_HEVC_NAL_FD_NUT = 38,
68
+ OBS_HEVC_NAL_SEI_PREFIX = 39,
69
+ OBS_HEVC_NAL_SEI_SUFFIX = 40,
70
+ };
71
+
72
+ EXPORT bool obs_hevc_keyframe(const uint8_t *data, size_t size);
73
+ EXPORT void obs_parse_hevc_packet(struct encoder_packet *hevc_packet, const struct encoder_packet *src);
74
+ EXPORT int obs_parse_hevc_packet_priority(const struct encoder_packet *packet);
75
+ EXPORT void obs_extract_hevc_headers(const uint8_t *packet, size_t size, uint8_t **new_packet_data,
76
+ size_t *new_packet_size, uint8_t **header_data, size_t *header_size,
77
+ uint8_t **sei_data, size_t *sei_size);
78
+
79
+ #ifdef __cplusplus
80
+ }
81
+ #endif