obs.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include "util/c99defs.h"
  16. #include "util/bmem.h"
  17. #include "graphics/graphics.h"
  18. #include "graphics/vec2.h"
  19. #include "media-io/audio-io.h"
  20. #include "media-io/video-io.h"
  21. #include "callback/signal.h"
  22. #include "callback/proc.h"
  23. #include "obs-defs.h"
  24. #include "obs-data.h"
  25. #include "obs-ui.h"
  26. #include "obs-properties.h"
  27. /* opaque types */
  28. struct obs_display;
  29. struct obs_source;
  30. struct obs_scene;
  31. struct obs_scene_item;
  32. struct obs_output;
  33. struct obs_encoder;
  34. struct obs_service;
  35. typedef struct obs_display *obs_display_t;
  36. typedef struct obs_source *obs_source_t;
  37. typedef struct obs_scene *obs_scene_t;
  38. typedef struct obs_scene_item *obs_sceneitem_t;
  39. typedef struct obs_output *obs_output_t;
  40. typedef struct obs_encoder *obs_encoder_t;
  41. typedef struct obs_service *obs_service_t;
  42. #include "obs-source.h"
  43. #include "obs-encoder.h"
  44. #include "obs-output.h"
  45. #include "obs-service.h"
  46. /*
  47. * @file
  48. *
  49. * Main libobs header used by applications.
  50. */
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54. /* LIBOBS_API_VER must be returned by module_version in each module */
  55. #define LIBOBS_API_MAJOR_VER 0 /* increment if major breaking changes */
  56. #define LIBOBS_API_MINOR_VER 1 /* increment if minor non-breaking additions */
  57. #define LIBOBS_API_VER ((LIBOBS_API_MAJOR_VER << 16) | \
  58. LIBOBS_API_MINOR_VER)
  59. /** Used for changing the order of items (for example, filters in a source,
  60. * or items in a scene) */
  61. enum order_movement {
  62. ORDER_MOVE_UP,
  63. ORDER_MOVE_DOWN,
  64. ORDER_MOVE_TOP,
  65. ORDER_MOVE_BOTTOM
  66. };
  67. /**
  68. * Used with obs_source_process_filter to specify whether the filter should
  69. * render the source directly with the specified effect, or whether it should
  70. * render it to a texture
  71. */
  72. enum allow_direct_render {
  73. NO_DIRECT_RENDERING,
  74. ALLOW_DIRECT_RENDERING,
  75. };
  76. /**
  77. * Video initialization structure
  78. */
  79. struct obs_video_info {
  80. /**
  81. * Graphics module to use (usually "libobs-opengl" or
  82. * "libobs-d3d11")
  83. */
  84. const char *graphics_module;
  85. uint32_t fps_num; /**< Output FPS numerator */
  86. uint32_t fps_den; /**< Output FPS denominator */
  87. uint32_t window_width; /**< Window width */
  88. uint32_t window_height; /**< Window height */
  89. uint32_t base_width; /**< Base compositing width */
  90. uint32_t base_height; /**< Base compositing height */
  91. uint32_t output_width; /**< Output width */
  92. uint32_t output_height; /**< Output height */
  93. enum video_format output_format; /**< Output format */
  94. /** Video adapter index to use (NOTE: avoid for optimus laptops) */
  95. uint32_t adapter;
  96. struct gs_window window; /**< Window to render to */
  97. };
  98. /**
  99. * Sent to source filters via the filter_audio callback to allow filtering of
  100. * audio data
  101. */
  102. struct filtered_audio {
  103. uint8_t *data[MAX_AUDIO_PLANES];
  104. uint32_t frames;
  105. uint64_t timestamp;
  106. };
  107. /**
  108. * Source audio output structure. Used with obs_source_output_audio to output
  109. * source audio. Audio is automatically resampled and remixed as necessary.
  110. */
  111. struct source_audio {
  112. const uint8_t *data[MAX_AUDIO_PLANES];
  113. uint32_t frames;
  114. enum speaker_layout speakers;
  115. enum audio_format format;
  116. uint32_t samples_per_sec;
  117. uint64_t timestamp;
  118. };
  119. /**
  120. * Source asynchronous video output structure. Used with
  121. * obs_source_output_video to output asynchronous video. Video is buffered as
  122. * necessary to play according to timestamps. When used with audio output,
  123. * audio is synced to video as it is played.
  124. *
  125. * If a YUV format is specified, it will be automatically upsampled and
  126. * converted to RGB via shader on the graphics processor.
  127. */
  128. struct source_frame {
  129. uint8_t *data[MAX_VIDEO_PLANES];
  130. uint32_t linesize[MAX_VIDEO_PLANES];
  131. uint32_t width;
  132. uint32_t height;
  133. uint64_t timestamp;
  134. enum video_format format;
  135. float color_matrix[16];
  136. bool flip;
  137. };
  138. enum packet_priority {
  139. PACKET_PRIORITY_DISPOSABLE,
  140. PACKET_PRIORITY_LOW,
  141. PACKET_PRIORITY_PFRAME,
  142. PACKET_PRIORITY_IFRAME,
  143. PACKET_PRIORITY_OTHER /* audio usually */
  144. };
  145. struct encoder_packet {
  146. int64_t dts;
  147. int64_t pts;
  148. void *data;
  149. size_t size;
  150. enum packet_priority priority;
  151. };
  152. /* ------------------------------------------------------------------------- */
  153. /* OBS context */
  154. /** Initializes OBS */
  155. EXPORT bool obs_startup(void);
  156. /** Releases all data associated with OBS and terminates the OBS context */
  157. EXPORT void obs_shutdown(void);
  158. /**
  159. * Sets base video ouput base resolution/fps/format
  160. *
  161. * @note Cannot set base video if an output is currently active.
  162. */
  163. EXPORT bool obs_reset_video(struct obs_video_info *ovi);
  164. /**
  165. * Sets base audio output format/channels/samples/etc
  166. *
  167. * @note Cannot reset base audio if an output is currently active.
  168. */
  169. EXPORT bool obs_reset_audio(struct audio_output_info *ai);
  170. /** Gets the current video settings, returns false if no video */
  171. EXPORT bool obs_get_video_info(struct obs_video_info *ovi);
  172. /** Gets the current audio settings, returns false if no audio */
  173. EXPORT bool obs_get_audio_info(struct audio_output_info *ai);
  174. /**
  175. * Loads a plugin module
  176. *
  177. * A plugin module contains exports for inputs/fitlers/transitions/outputs.
  178. * See obs-source.h and obs-output.h for more information on the exports to
  179. * use.
  180. */
  181. EXPORT int obs_load_module(const char *path);
  182. /**
  183. * Enumerates all available inputs source types.
  184. *
  185. * Inputs are general source inputs (such as capture sources, device sources,
  186. * etc).
  187. */
  188. EXPORT bool obs_enum_input_types(size_t idx, const char **id);
  189. /**
  190. * Enumerates all available filter source types.
  191. *
  192. * Filters are sources that are used to modify the video/audio output of
  193. * other sources.
  194. */
  195. EXPORT bool obs_enum_filter_types(size_t idx, const char **id);
  196. /**
  197. * Enumerates all available transition source types.
  198. *
  199. * Transitions are sources used to transition between two or more other
  200. * sources.
  201. */
  202. EXPORT bool obs_enum_transition_types(size_t idx, const char **id);
  203. /**
  204. * Enumerates all available ouput types.
  205. *
  206. * Outputs handle color space conversion, encoding, and output to file or
  207. * streams.
  208. */
  209. EXPORT bool obs_enum_output_types(size_t idx, const char **id);
  210. /** Gets the graphics context for this OBS context */
  211. EXPORT graphics_t obs_graphics(void);
  212. EXPORT audio_t obs_audio(void);
  213. EXPORT video_t obs_video(void);
  214. /**
  215. * Adds a source to the user source list and increments the reference counter
  216. * for that source.
  217. *
  218. * The user source list is the list of sources that are accessible by a user.
  219. * Typically when a transition is active, it is not meant to be accessible by
  220. * users, so there's no reason for a user to see such a source.
  221. */
  222. EXPORT bool obs_add_source(obs_source_t source);
  223. /** Sets the primary output source for a channel. */
  224. EXPORT void obs_set_output_source(uint32_t channel, obs_source_t source);
  225. /**
  226. * Gets the primary output source for a channel and increments the reference
  227. * counter for that source. Use obs_source_release to release.
  228. */
  229. EXPORT obs_source_t obs_get_output_source(uint32_t channel);
  230. /**
  231. * Enumerates user sources
  232. *
  233. * Callback function returns true to continue enumeration, or false to end
  234. * enumeration.
  235. */
  236. EXPORT void obs_enum_sources(bool (*enum_proc)(void*, obs_source_t),
  237. void *param);
  238. /** Enumerates outputs */
  239. EXPORT void obs_enum_outputs(bool (*enum_proc)(void*, obs_output_t),
  240. void *param);
  241. /** Enumerates encoders */
  242. EXPORT void obs_enum_encoders(bool (*enum_proc)(void*, obs_encoder_t),
  243. void *param);
  244. /**
  245. * Gets a source by its name.
  246. *
  247. * Increments the source reference counter, use obs_source_release to
  248. * release it when complete.
  249. */
  250. EXPORT obs_source_t obs_get_source_by_name(const char *name);
  251. /**
  252. * Returns the location of a plugin data file.
  253. *
  254. * file: Name of file to locate. For example, "myplugin/mydata.data"
  255. * returns: Path string, or NULL if not found. Use bfree to free string.
  256. */
  257. EXPORT char *obs_find_plugin_file(const char *file);
  258. /** Returns the default effect for generic RGB/YUV drawing */
  259. EXPORT effect_t obs_get_default_effect(void);
  260. /** Returns the primary obs signal handler */
  261. EXPORT signal_handler_t obs_signalhandler(void);
  262. /** Returns the primary obs procedure handler */
  263. EXPORT proc_handler_t obs_prochandler(void);
  264. /* ------------------------------------------------------------------------- */
  265. /* Display context */
  266. /**
  267. * Creates an extra display context.
  268. *
  269. * An extra display can be used for things like separate previews,
  270. * viewing sources independently, and other things. Creates a new swap chain
  271. * linked to a specific window to display a source.
  272. */
  273. EXPORT obs_display_t obs_display_create(struct gs_init_data *graphics_data);
  274. EXPORT void obs_display_destroy(obs_display_t display);
  275. /** Sets the source to be used for a display context. */
  276. EXPORT void obs_display_setsource(obs_display_t display, uint32_t channel,
  277. obs_source_t source);
  278. EXPORT obs_source_t obs_display_getsource(obs_display_t display,
  279. uint32_t channel);
  280. /* ------------------------------------------------------------------------- */
  281. /* Sources */
  282. /** Returns the translated display name of a source */
  283. EXPORT const char *obs_source_getdisplayname(enum obs_source_type type,
  284. const char *id, const char *locale);
  285. /**
  286. * Creates a source of the specified type with the specified settings.
  287. *
  288. * The "source" context is used for anything related to presenting
  289. * or modifying video/audio. Use obs_source_release to release it.
  290. */
  291. EXPORT obs_source_t obs_source_create(enum obs_source_type type,
  292. const char *id, const char *name, obs_data_t settings);
  293. /**
  294. * Adds/releases a reference to a source. When the last reference is
  295. * released, the source is destroyed.
  296. */
  297. EXPORT void obs_source_addref(obs_source_t source);
  298. EXPORT void obs_source_release(obs_source_t source);
  299. /** Notifies all references that the source should be released */
  300. EXPORT void obs_source_remove(obs_source_t source);
  301. /** Returns true if the source should be released */
  302. EXPORT bool obs_source_removed(obs_source_t source);
  303. /**
  304. * Retrieves flags that specify what type of data the source presents/modifies.
  305. *
  306. * SOURCE_VIDEO if it presents/modifies video_frame
  307. * SOURCE_ASYNC if the video is asynchronous.
  308. * SOURCE_AUDIO if it presents/modifies audio (always async)
  309. */
  310. EXPORT uint32_t obs_source_get_output_flags(obs_source_t source);
  311. /** Returns the property list, if any. Free with obs_properties_destroy */
  312. EXPORT obs_properties_t obs_source_properties(enum obs_source_type type,
  313. const char *id, const char *locale);
  314. /** Updates settings for this source */
  315. EXPORT void obs_source_update(obs_source_t source, obs_data_t settings);
  316. /** Renders a video source. */
  317. EXPORT void obs_source_video_render(obs_source_t source);
  318. /** Gets the width of a source (if it has video) */
  319. EXPORT uint32_t obs_source_getwidth(obs_source_t source);
  320. /** Gets the height of a source (if it has video) */
  321. EXPORT uint32_t obs_source_getheight(obs_source_t source);
  322. /** If the source is a filter, returns the parent source of the filter */
  323. EXPORT obs_source_t obs_filter_getparent(obs_source_t filter);
  324. /** If the source is a filter, returns the target source of the filter */
  325. EXPORT obs_source_t obs_filter_gettarget(obs_source_t filter);
  326. /** Adds a filter to the source (which is used whenever the source is used) */
  327. EXPORT void obs_source_filter_add(obs_source_t source, obs_source_t filter);
  328. /** Removes a filter from the source */
  329. EXPORT void obs_source_filter_remove(obs_source_t source, obs_source_t filter);
  330. /** Modifies the order of a specific filter */
  331. EXPORT void obs_source_filter_setorder(obs_source_t source, obs_source_t filter,
  332. enum order_movement movement);
  333. /** Gets the settings string for a source */
  334. EXPORT obs_data_t obs_source_getsettings(obs_source_t source);
  335. /** Gets the name of a source */
  336. EXPORT const char *obs_source_getname(obs_source_t source);
  337. /** Sets the name of a source */
  338. EXPORT void obs_source_setname(obs_source_t source, const char *name);
  339. /** Gets the source type and identifier */
  340. EXPORT void obs_source_gettype(obs_source_t source, enum obs_source_type *type,
  341. const char **id);
  342. /** Returns the signal handler for a source */
  343. EXPORT signal_handler_t obs_source_signalhandler(obs_source_t source);
  344. /** Returns the procedure handler for a source */
  345. EXPORT proc_handler_t obs_source_prochandler(obs_source_t source);
  346. /** Sets the volume for a source that has audio output */
  347. EXPORT void obs_source_setvolume(obs_source_t source, float volume);
  348. /** Gets the volume for a source that has audio output */
  349. EXPORT float obs_source_getvolume(obs_source_t source);
  350. /* ------------------------------------------------------------------------- */
  351. /* Functions used by sources */
  352. /** Outputs asynchronous video data */
  353. EXPORT void obs_source_output_video(obs_source_t source,
  354. const struct source_frame *frame);
  355. /** Outputs audio data (always asynchronous) */
  356. EXPORT void obs_source_output_audio(obs_source_t source,
  357. const struct source_audio *audio);
  358. /** Gets the current async video frame */
  359. EXPORT struct source_frame *obs_source_getframe(obs_source_t source);
  360. /** Releases the current async video frame */
  361. EXPORT void obs_source_releaseframe(obs_source_t source,
  362. struct source_frame *frame);
  363. /** Default RGB filter handler for generic effect filters */
  364. EXPORT void obs_source_process_filter(obs_source_t filter, effect_t effect,
  365. uint32_t width, uint32_t height, enum gs_color_format format,
  366. enum allow_direct_render allow_direct);
  367. /* ------------------------------------------------------------------------- */
  368. /* Scenes */
  369. /**
  370. * Creates a scene.
  371. *
  372. * A scene is a source which is a container of other sources with specific
  373. * display oriantations. Scenes can also be used like any other source.
  374. */
  375. EXPORT obs_scene_t obs_scene_create(const char *name);
  376. EXPORT void obs_scene_addref(obs_scene_t scene);
  377. EXPORT void obs_scene_release(obs_scene_t scene);
  378. /** Gets the scene's source context */
  379. EXPORT obs_source_t obs_scene_getsource(obs_scene_t scene);
  380. /** Gets the scene from its source, or NULL if not a scene */
  381. EXPORT obs_scene_t obs_scene_fromsource(obs_source_t source);
  382. /** Determines whether a source is within a scene */
  383. EXPORT obs_sceneitem_t obs_scene_findsource(obs_scene_t scene,
  384. const char *name);
  385. /** Enumerates sources within a scene */
  386. EXPORT void obs_scene_enum_items(obs_scene_t scene,
  387. bool (*callback)(obs_scene_t, obs_sceneitem_t, void*),
  388. void *param);
  389. /** Adds/creates a new scene item for a source */
  390. EXPORT obs_sceneitem_t obs_scene_add(obs_scene_t scene, obs_source_t source);
  391. EXPORT void obs_sceneitem_addref(obs_sceneitem_t item);
  392. EXPORT void obs_sceneitem_release(obs_sceneitem_t item);
  393. /** Removes a scene item. */
  394. EXPORT void obs_sceneitem_remove(obs_sceneitem_t item);
  395. /** Gets the scene parent associated with the scene item. */
  396. EXPORT obs_scene_t obs_sceneitem_getscene(obs_sceneitem_t item);
  397. /** Gets the source of a scene item. */
  398. EXPORT obs_source_t obs_sceneitem_getsource(obs_sceneitem_t item);
  399. /* Functions for gettings/setting specific oriantation of a scene item */
  400. EXPORT void obs_sceneitem_setpos(obs_sceneitem_t item, const struct vec2 *pos);
  401. EXPORT void obs_sceneitem_setrot(obs_sceneitem_t item, float rot);
  402. EXPORT void obs_sceneitem_setorigin(obs_sceneitem_t item,
  403. const struct vec2 *origin);
  404. EXPORT void obs_sceneitem_setscale(obs_sceneitem_t item,
  405. const struct vec2 *scale);
  406. EXPORT void obs_sceneitem_setorder(obs_sceneitem_t item,
  407. enum order_movement movement);
  408. EXPORT void obs_sceneitem_getpos(obs_sceneitem_t item, struct vec2 *pos);
  409. EXPORT float obs_sceneitem_getrot(obs_sceneitem_t item);
  410. EXPORT void obs_sceneitem_getorigin(obs_sceneitem_t item, struct vec2 *center);
  411. EXPORT void obs_sceneitem_getscale(obs_sceneitem_t item, struct vec2 *scale);
  412. /* ------------------------------------------------------------------------- */
  413. /* Outputs */
  414. EXPORT const char *obs_output_getdisplayname(const char *id,
  415. const char *locale);
  416. /**
  417. * Creates an output.
  418. *
  419. * Outputs allow outputting to file, outputting to network, outputting to
  420. * directshow, or other custom outputs.
  421. */
  422. EXPORT obs_output_t obs_output_create(const char *id, const char *name,
  423. obs_data_t settings);
  424. EXPORT void obs_output_destroy(obs_output_t output);
  425. /** Starts the output. */
  426. EXPORT bool obs_output_start(obs_output_t output);
  427. /** Stops the output. */
  428. EXPORT void obs_output_stop(obs_output_t output);
  429. /** Returns whether the output is active */
  430. EXPORT bool obs_output_active(obs_output_t output);
  431. /** Returns the property list, if any. Free with obs_properties_destroy */
  432. EXPORT obs_properties_t obs_output_properties(const char *id,
  433. const char *locale);
  434. /** Updates the settings for this output context */
  435. EXPORT void obs_output_update(obs_output_t output, obs_data_t settings);
  436. /** Specifies whether the output can be paused */
  437. EXPORT bool obs_output_canpause(obs_output_t output);
  438. /** Pauses the output (if the functionality is allowed by the output */
  439. EXPORT void obs_output_pause(obs_output_t output);
  440. /* Gets the current output settings string */
  441. EXPORT obs_data_t obs_output_get_settings(obs_output_t output);
  442. /* ------------------------------------------------------------------------- */
  443. /* Encoders */
  444. EXPORT const char *obs_encoder_getdisplayname(const char *id,
  445. const char *locale);
  446. EXPORT obs_encoder_t obs_encoder_create(const char *id, const char *name,
  447. obs_data_t settings);
  448. EXPORT void obs_encoder_destroy(obs_encoder_t encoder);
  449. /** Returns the property list, if any. Free with obs_properties_destroy */
  450. EXPORT obs_properties_t obs_output_properties(const char *id,
  451. const char *locale);
  452. EXPORT void obs_encoder_update(obs_encoder_t encoder, obs_data_t settings);
  453. EXPORT bool obs_encoder_reset(obs_encoder_t encoder);
  454. EXPORT bool obs_encoder_encode(obs_encoder_t encoder, void *frames,
  455. size_t size);
  456. EXPORT int obs_encoder_getheader(obs_encoder_t encoder,
  457. struct encoder_packet **packets);
  458. EXPORT bool obs_encoder_start(obs_encoder_t encoder,
  459. void (*new_packet)(void *param, struct encoder_packet *packet),
  460. void *param);
  461. EXPORT bool obs_encoder_stop(obs_encoder_t encoder,
  462. void (*new_packet)(void *param, struct encoder_packet *packet),
  463. void *param);
  464. EXPORT bool obs_encoder_setbitrate(obs_encoder_t encoder, uint32_t bitrate,
  465. uint32_t buffersize);
  466. EXPORT bool obs_encoder_request_keyframe(obs_encoder_t encoder);
  467. EXPORT obs_data_t obs_encoder_get_settings(obs_encoder_t encoder);
  468. /* ------------------------------------------------------------------------- */
  469. /* Stream Services */
  470. EXPORT const char *obs_service_getdisplayname(const char *id,
  471. const char *locale);
  472. EXPORT obs_service_t obs_service_create(const char *service,
  473. obs_data_t settings);
  474. EXPORT void obs_service_destroy(obs_service_t service);
  475. /* ------------------------------------------------------------------------- */
  476. /* Source frame allocation functions */
  477. EXPORT void source_frame_init(struct source_frame *frame,
  478. enum video_format format, uint32_t width, uint32_t height);
  479. static inline void source_frame_free(struct source_frame *frame)
  480. {
  481. if (frame) {
  482. bfree(frame->data[0]);
  483. memset(frame, 0, sizeof(struct source_frame));
  484. }
  485. }
  486. static inline struct source_frame *source_frame_create(
  487. enum video_format format, uint32_t width, uint32_t height)
  488. {
  489. struct source_frame *frame;
  490. frame = (struct source_frame*)bzalloc(sizeof(struct source_frame));
  491. source_frame_init(frame, format, width, height);
  492. return frame;
  493. }
  494. static inline void source_frame_destroy(struct source_frame *frame)
  495. {
  496. if (frame) {
  497. bfree(frame->data[0]);
  498. bfree(frame);
  499. }
  500. }
  501. #ifdef __cplusplus
  502. }
  503. #endif