Open Broadcaster Software
Free, open source software for live streaming and recording
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
obs-internal.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (C) 2013-2014 by Hugh Bailey <obs.jim@gmail.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 "util/darray.h"
22 #include "util/circlebuf.h"
23 #include "util/dstr.h"
24 #include "util/threading.h"
25 #include "util/platform.h"
26 #include "util/profiler.h"
27 #include "callback/signal.h"
28 #include "callback/proc.h"
29 
30 #include "graphics/graphics.h"
31 #include "graphics/matrix4.h"
32 
34 #include "media-io/video-io.h"
35 #include "media-io/audio-io.h"
36 
37 #include "obs.h"
38 
39 #define NUM_TEXTURES 2
40 #define MICROSECOND_DEN 1000000
41 
42 static inline int64_t packet_dts_usec(struct encoder_packet *packet)
43 {
44  return packet->dts * MICROSECOND_DEN / packet->timebase_den;
45 }
46 
47 struct draw_callback {
48  void (*draw)(void *param, uint32_t cx, uint32_t cy);
49  void *param;
50 };
51 
52 /* ------------------------------------------------------------------------- */
53 /* validity checks */
54 
55 static inline bool obs_object_valid(const void *obj, const char *f,
56  const char *t)
57 {
58  if (!obj) {
59  blog(LOG_DEBUG, "%s: Null '%s' parameter", f, t);
60  return false;
61  }
62 
63  return true;
64 }
65 
66 #define obs_ptr_valid(ptr, func) obs_object_valid(ptr, func, #ptr)
67 #define obs_source_valid obs_ptr_valid
68 #define obs_output_valid obs_ptr_valid
69 #define obs_encoder_valid obs_ptr_valid
70 #define obs_service_valid obs_ptr_valid
71 
72 /* ------------------------------------------------------------------------- */
73 /* modules */
74 
75 struct obs_module {
76  char *mod_name;
77  const char *file;
78  char *bin_path;
79  char *data_path;
80  void *module;
81  bool loaded;
82 
83  bool (*load)(void);
84  void (*unload)(void);
85  void (*set_locale)(const char *locale);
86  void (*free_locale)(void);
87  uint32_t (*ver)(void);
89  const char *(*name)(void);
90  const char *(*description)(void);
91  const char *(*author)(void);
92 
93  struct obs_module *next;
94 };
95 
96 extern void free_module(struct obs_module *mod);
97 
99  char *bin;
100  char *data;
101 };
102 
103 static inline void free_module_path(struct obs_module_path *omp)
104 {
105  if (omp) {
106  bfree(omp->bin);
107  bfree(omp->data);
108  }
109 }
110 
111 static inline bool check_path(const char *data, const char *path,
112  struct dstr *output)
113 {
114  dstr_copy(output, path);
115  dstr_cat(output, data);
116 
117  return os_file_exists(output->array);
118 }
119 
120 
121 /* ------------------------------------------------------------------------- */
122 /* hotkeys */
123 
124 struct obs_hotkey {
126  char *name;
127  char *description;
128 
130  void *data;
131  int pressed;
132 
134  void *registerer;
135 
137 };
138 
143  bool pressed0 : 1;
144  bool pressed1 : 1;
145  void *data[2];
146 };
147 
149 
150 typedef struct obs_hotkeys_platform obs_hotkeys_platform_t;
151 
152 void *obs_hotkey_thread(void *param);
153 
154 struct obs_core_hotkeys;
155 bool obs_hotkeys_platform_init(struct obs_core_hotkeys *hotkeys);
156 void obs_hotkeys_platform_free(struct obs_core_hotkeys *hotkeys);
158  obs_key_t key);
159 
160 const char *obs_get_hotkey_translation(obs_key_t key, const char *def);
161 
162 struct obs_context_data;
163 void obs_hotkeys_context_release(struct obs_context_data *context);
164 
165 void obs_hotkeys_free(void);
166 
169  bool pressed : 1;
170  bool modifiers_match : 1;
171 
174 };
175 
176 struct obs_hotkey_name_map;
177 void obs_hotkey_name_map_free(void);
178 
179 
180 /* ------------------------------------------------------------------------- */
181 /* views */
182 
183 struct obs_view {
184  pthread_mutex_t channels_mutex;
186 };
187 
188 extern bool obs_view_init(struct obs_view *view);
189 extern void obs_view_free(struct obs_view *view);
190 
191 
192 /* ------------------------------------------------------------------------- */
193 /* displays */
194 
195 struct obs_display {
197  bool enabled;
201  pthread_mutex_t draw_callbacks_mutex;
202  pthread_mutex_t draw_info_mutex;
203  DARRAY(struct draw_callback) draw_callbacks;
204 
205  struct obs_display *next;
207 };
208 
209 extern bool obs_display_init(struct obs_display *display,
210  const struct gs_init_data *graphics_data);
211 extern void obs_display_free(struct obs_display *display);
212 
213 
214 /* ------------------------------------------------------------------------- */
215 /* core */
216 
219  int count;
220 };
221 
224  gs_stagesurf_t *copy_surfaces[NUM_TEXTURES];
225  gs_texture_t *render_textures[NUM_TEXTURES];
226  gs_texture_t *output_textures[NUM_TEXTURES];
227  gs_texture_t *convert_textures[NUM_TEXTURES];
228  bool textures_rendered[NUM_TEXTURES];
229  bool textures_output[NUM_TEXTURES];
230  bool textures_copied[NUM_TEXTURES];
231  bool textures_converted[NUM_TEXTURES];
232  struct circlebuf vframe_info_buffer;
245 
247  double video_fps;
249  pthread_t video_thread;
253 
255  const char *conversion_tech;
257  uint32_t plane_offsets[3];
258  uint32_t plane_sizes[3];
259  uint32_t plane_linewidth[3];
260 
265  float color_matrix[16];
266  enum obs_scale_type scale_type;
267 
269 
278 };
279 
280 struct audio_monitor;
281 
284 
285  DARRAY(struct obs_source*) render_order;
286  DARRAY(struct obs_source*) root_nodes;
287 
288  uint64_t buffered_ts;
289  struct circlebuf buffered_timestamps;
290  int buffering_wait_ticks;
291  int total_buffering_ticks;
292 
293  float user_volume;
294 
295  pthread_mutex_t monitoring_mutex;
296  DARRAY(struct audio_monitor*) monitors;
297  char *monitoring_device_name;
298  char *monitoring_device_id;
299 };
300 
301 /* user sources, output channels, and displays */
309 
310  pthread_mutex_t sources_mutex;
311  pthread_mutex_t displays_mutex;
312  pthread_mutex_t outputs_mutex;
313  pthread_mutex_t encoders_mutex;
314  pthread_mutex_t services_mutex;
315  pthread_mutex_t audio_sources_mutex;
316 
317  struct obs_view main_view;
318 
319  long long unnamed_index;
320 
321  volatile bool valid;
322 };
323 
324 /* user hotkeys */
326  pthread_mutex_t mutex;
327  DARRAY(obs_hotkey_t) hotkeys;
328  obs_hotkey_id next_id;
329  DARRAY(obs_hotkey_pair_t) hotkey_pairs;
330  obs_hotkey_pair_id next_pair_id;
331 
332  pthread_t hotkey_thread;
333  bool hotkey_thread_initialized;
334  os_event_t *stop_event;
335  bool thread_disable_press : 1;
336  bool strict_modifiers : 1;
337  bool reroute_hotkeys : 1;
338  DARRAY(obs_hotkey_binding_t) bindings;
339 
341  void *router_func_data;
342 
343  obs_hotkeys_platform_t *platform_context;
344 
345  pthread_once_t name_map_init_token;
346  struct obs_hotkey_name_map *name_map;
347 
349 
350  char *translations[OBS_KEY_LAST_VALUE];
351  char *mute;
352  char *unmute;
353  char *push_to_mute;
354  char *push_to_talk;
355  char *sceneitem_show;
356  char *sceneitem_hide;
357 };
358 
359 struct obs_core {
361  DARRAY(struct obs_module_path) module_paths;
362 
363  DARRAY(struct obs_source_info) source_types;
364  DARRAY(struct obs_source_info) input_types;
365  DARRAY(struct obs_source_info) filter_types;
366  DARRAY(struct obs_source_info) transition_types;
367  DARRAY(struct obs_output_info) output_types;
368  DARRAY(struct obs_encoder_info) encoder_types;
369  DARRAY(struct obs_service_info) service_types;
370  DARRAY(struct obs_modal_ui) modal_ui_callbacks;
371  DARRAY(struct obs_modeless_ui) modeless_ui_callbacks;
372 
375 
376  char *locale;
377  char *module_config_path;
378  bool name_store_owned;
380 
381  /* segmented into multiple sub-structures to keep things a bit more
382  * clean and organized */
383  struct obs_core_video video;
384  struct obs_core_audio audio;
385  struct obs_core_data data;
386  struct obs_core_hotkeys hotkeys;
387 };
388 
389 extern struct obs_core *obs;
390 
391 extern void *obs_video_thread(void *param);
392 
393 extern gs_effect_t *obs_load_effect(gs_effect_t **effect, const char *file);
394 
395 extern bool audio_callback(void *param,
396  uint64_t start_ts_in, uint64_t end_ts_in, uint64_t *out_ts,
397  uint32_t mixers, struct audio_output_data *mixes);
398 
399 
400 /* ------------------------------------------------------------------------- */
401 /* obs shared context data */
402 
404  char *name;
405  void *data;
409  enum obs_obj_type type;
410 
411  DARRAY(obs_hotkey_id) hotkeys;
412  DARRAY(obs_hotkey_pair_id) hotkey_pairs;
413  obs_data_t *hotkey_data;
414 
415  DARRAY(char*) rename_cache;
416  pthread_mutex_t rename_cache_mutex;
417 
418  pthread_mutex_t *mutex;
419  struct obs_context_data *next;
420  struct obs_context_data **prev_next;
421 
422  bool private;
423 };
424 
425 extern bool obs_context_data_init(
426  struct obs_context_data *context,
427  enum obs_obj_type type,
428  obs_data_t *settings,
429  const char *name,
430  obs_data_t *hotkey_data,
431  bool private);
432 extern void obs_context_data_free(struct obs_context_data *context);
433 
434 extern void obs_context_data_insert(struct obs_context_data *context,
435  pthread_mutex_t *mutex, void *first);
436 extern void obs_context_data_remove(struct obs_context_data *context);
437 
438 extern void obs_context_data_setname(struct obs_context_data *context,
439  const char *name);
440 
441 
442 /* ------------------------------------------------------------------------- */
443 /* ref-counting */
444 
445 struct obs_weak_ref {
446  volatile long refs;
447  volatile long weak_refs;
448 };
449 
450 static inline void obs_ref_addref(struct obs_weak_ref *ref)
451 {
452  os_atomic_inc_long(&ref->refs);
453 }
454 
455 static inline bool obs_ref_release(struct obs_weak_ref *ref)
456 {
457  return os_atomic_dec_long(&ref->refs) == -1;
458 }
459 
460 static inline void obs_weak_ref_addref(struct obs_weak_ref *ref)
461 {
462  os_atomic_inc_long(&ref->weak_refs);
463 }
464 
465 static inline bool obs_weak_ref_release(struct obs_weak_ref *ref)
466 {
467  return os_atomic_dec_long(&ref->weak_refs) == -1;
468 }
469 
470 static inline bool obs_weak_ref_get_ref(struct obs_weak_ref *ref)
471 {
472  long owners = ref->refs;
473  while (owners > -1) {
474  if (os_atomic_compare_swap_long(&ref->refs, owners, owners + 1))
475  return true;
476 
477  owners = ref->refs;
478  }
479 
480  return false;
481 }
482 
483 
484 /* ------------------------------------------------------------------------- */
485 /* sources */
486 
487 struct async_frame {
490  bool used;
491 };
492 
498 };
499 
500 struct audio_action {
502  enum audio_action_type type;
503  union {
504  float vol;
505  bool set;
506  };
507 };
508 
510  struct obs_weak_ref ref;
512 };
513 
516  void *param;
517 };
518 
519 struct obs_source {
520  struct obs_context_data context;
521  struct obs_source_info info;
523 
524  /* general exposed flags that can be set for the source */
527 
528  /* indicates ownership of the info.id buffer */
530 
531  /* signals to call the source update in the video thread */
533 
534  /* ensures show/hide are only called once */
535  volatile long show_refs;
536 
537  /* ensures activate/deactivate are only called once */
538  volatile long activate_refs;
539 
540  /* used to indicate that the source has been removed and all
541  * references to it should be released (not exactly how I would prefer
542  * to handle things but it's the best option) */
543  bool removed;
544 
545  bool active;
546  bool showing;
547 
548  /* used to temporarily disable sources if needed */
549  bool enabled;
550 
551  /* timing (if video is present, is based upon video) */
552  volatile bool timing_set;
561 
562  /* audio */
566  bool muted;
570  struct circlebuf audio_input_buf[MAX_AUDIO_CHANNELS];
572  DARRAY(struct audio_action) audio_actions;
573  float *audio_output_buf[MAX_AUDIO_MIXES][MAX_AUDIO_CHANNELS];
574  struct resample_info sample_info;
575  audio_resampler_t *resampler;
576  pthread_mutex_t audio_actions_mutex;
577  pthread_mutex_t audio_buf_mutex;
578  pthread_mutex_t audio_mutex;
579  pthread_mutex_t audio_cb_mutex;
580  DARRAY(struct audio_cb_info) audio_cb_list;
582  size_t audio_storage_size;
583  uint32_t audio_mixers;
584  float user_volume;
585  float volume;
586  int64_t sync_offset;
587  int64_t last_sync_offset;
588 
589  /* async video data */
590  gs_texture_t *async_texture;
591  gs_texrender_t *async_texrender;
592  struct obs_source_frame *cur_async_frame;
593  bool async_gpu_conversion;
594  enum video_format async_format;
595  enum video_format async_cache_format;
596  enum gs_color_format async_texture_format;
597  float async_color_matrix[16];
598  bool async_full_range;
599  float async_color_range_min[3];
600  float async_color_range_max[3];
601  int async_plane_offset[2];
602  bool async_flip;
603  bool async_active;
604  bool async_update_texture;
605  DARRAY(struct async_frame) async_cache;
606  DARRAY(struct obs_source_frame*)async_frames;
607  pthread_mutex_t async_mutex;
608  uint32_t async_width;
609  uint32_t async_height;
610  uint32_t async_cache_width;
611  uint32_t async_cache_height;
612  uint32_t async_convert_width;
613  uint32_t async_convert_height;
614 
615  /* async video deinterlacing */
616  uint64_t deinterlace_offset;
617  uint64_t deinterlace_frame_ts;
618  gs_effect_t *deinterlace_effect;
619  struct obs_source_frame *prev_async_frame;
620  gs_texture_t *async_prev_texture;
621  gs_texrender_t *async_prev_texrender;
622  uint32_t deinterlace_half_duration;
623  enum obs_deinterlace_mode deinterlace_mode;
624  bool deinterlace_top_first;
625  bool deinterlace_rendered;
626 
627  /* filters */
628  struct obs_source *filter_parent;
629  struct obs_source *filter_target;
630  DARRAY(struct obs_source*) filters;
631  pthread_mutex_t filter_mutex;
632  gs_texrender_t *filter_texrender;
633  enum obs_allow_direct_render allow_direct;
634  bool rendering_filter;
635 
636  /* sources specific hotkeys */
637  obs_hotkey_pair_id mute_unmute_key;
638  obs_hotkey_id push_to_mute_key;
639  obs_hotkey_id push_to_talk_key;
640  bool push_to_mute_enabled : 1;
641  bool push_to_mute_pressed : 1;
642  bool user_push_to_mute_pressed : 1;
643  bool push_to_talk_enabled : 1;
644  bool push_to_talk_pressed : 1;
645  bool user_push_to_talk_pressed : 1;
646  uint64_t push_to_mute_delay;
647  uint64_t push_to_mute_stop_time;
648  uint64_t push_to_talk_delay;
649  uint64_t push_to_talk_stop_time;
650 
651  /* transitions */
652  uint64_t transition_start_time;
653  uint64_t transition_duration;
654  pthread_mutex_t transition_tex_mutex;
655  gs_texrender_t *transition_texrender[2];
656  pthread_mutex_t transition_mutex;
657  obs_source_t *transition_sources[2];
658  bool transitioning_video;
659  bool transitioning_audio;
660  bool transition_source_active[2];
661  uint32_t transition_alignment;
662  uint32_t transition_actual_cx;
663  uint32_t transition_actual_cy;
664  uint32_t transition_cx;
665  uint32_t transition_cy;
666  uint32_t transition_fixed_duration;
667  bool transition_use_fixed_duration : 1;
668  enum obs_transition_mode transition_mode;
669  enum obs_transition_scale_type transition_scale_type;
670  struct matrix4 transition_matrices[2];
671 
672  struct audio_monitor *monitor;
673  enum obs_monitoring_type monitoring_type;
674 };
675 
676 extern const struct obs_source_info *get_source_info(const char *id);
677 extern bool obs_source_init_context(struct obs_source *source,
678  obs_data_t *settings, const char *name,
679  obs_data_t *hotkey_data, bool private);
680 
681 extern void obs_source_save(obs_source_t *source);
682 extern void obs_source_load(obs_source_t *source);
683 
684 extern bool obs_transition_init(obs_source_t *transition);
685 extern void obs_transition_free(obs_source_t *transition);
686 extern void obs_transition_tick(obs_source_t *transition);
687 extern void obs_transition_enum_sources(obs_source_t *transition,
688  obs_source_enum_proc_t enum_callback, void *param);
689 extern void obs_transition_save(obs_source_t *source, obs_data_t *data);
690 extern void obs_transition_load(obs_source_t *source, obs_data_t *data);
691 
692 struct audio_monitor *audio_monitor_create(obs_source_t *source);
693 void audio_monitor_reset(struct audio_monitor *monitor);
694 extern void audio_monitor_destroy(struct audio_monitor *monitor);
695 
696 extern void obs_source_destroy(struct obs_source *source);
697 
698 enum view_type {
701 };
702 
703 static inline void obs_source_dosignal(struct obs_source *source,
704  const char *signal_obs, const char *signal_source)
705 {
706  struct calldata data;
707  uint8_t stack[128];
708 
709  calldata_init_fixed(&data, stack, sizeof(stack));
710  calldata_set_ptr(&data, "source", source);
711  if (signal_obs && !source->context.private)
712  signal_handler_signal(obs->signals, signal_obs, &data);
713  if (signal_source)
714  signal_handler_signal(source->context.signals, signal_source,
715  &data);
716 }
717 
718 /* maximum timestamp variance in nanoseconds */
719 #define MAX_TS_VAR 2000000000ULL
720 
721 static inline bool frame_out_of_bounds(const obs_source_t *source, uint64_t ts)
722 {
723  if (ts < source->last_frame_ts)
724  return ((source->last_frame_ts - ts) > MAX_TS_VAR);
725  else
726  return ((ts - source->last_frame_ts) > MAX_TS_VAR);
727 }
728 
729 static inline enum gs_color_format convert_video_format(
730  enum video_format format)
731 {
732  if (format == VIDEO_FORMAT_RGBA)
733  return GS_RGBA;
734  else if (format == VIDEO_FORMAT_BGRA)
735  return GS_BGRA;
736 
737  return GS_BGRX;
738 }
739 
740 extern void obs_source_activate(obs_source_t *source, enum view_type type);
741 extern void obs_source_deactivate(obs_source_t *source, enum view_type type);
742 extern void obs_source_video_tick(obs_source_t *source, float seconds);
743 extern float obs_source_get_target_volume(obs_source_t *source,
744  obs_source_t *target);
745 
746 extern void obs_source_audio_render(obs_source_t *source, uint32_t mixers,
747  size_t channels, size_t sample_rate, size_t size);
748 
749 extern void add_alignment(struct vec2 *v, uint32_t align, int cx, int cy);
750 
751 extern struct obs_source_frame *filter_async_video(obs_source_t *source,
752  struct obs_source_frame *in);
753 extern bool update_async_texture(struct obs_source *source,
754  const struct obs_source_frame *frame,
755  gs_texture_t *tex, gs_texrender_t *texrender);
756 extern bool set_async_texture_size(struct obs_source *source,
757  const struct obs_source_frame *frame);
758 extern void remove_async_frame(obs_source_t *source,
759  struct obs_source_frame *frame);
760 
761 extern void set_deinterlace_texture_size(obs_source_t *source);
762 extern void deinterlace_process_last_frame(obs_source_t *source,
763  uint64_t sys_time);
764 extern void deinterlace_update_async_video(obs_source_t *source);
765 extern void deinterlace_render(obs_source_t *s);
766 
767 
768 /* ------------------------------------------------------------------------- */
769 /* outputs */
770 
771 enum delay_msg {
775 };
776 
777 struct delay_data {
778  enum delay_msg msg;
780  struct encoder_packet packet;
781 };
782 
783 typedef void (*encoded_callback_t)(void *data, struct encoder_packet *packet);
784 
786  struct obs_weak_ref ref;
788 };
789 
790 #define CAPTION_LINE_CHARS (32)
791 #define CAPTION_LINE_BYTES (4*CAPTION_LINE_CHARS)
792 struct caption_text {
793  char text[CAPTION_LINE_BYTES+1];
795 };
796 
797 struct obs_output {
798  struct obs_context_data context;
799  struct obs_output_info info;
801 
802  /* indicates ownership of the info.id buffer */
804 
807  volatile bool data_active;
810  int64_t audio_offsets[MAX_AUDIO_MIXES];
815  pthread_mutex_t interleaved_mutex;
816  DARRAY(struct encoder_packet) interleaved_packets;
817  int stop_code;
818 
819  int reconnect_retry_sec;
820  int reconnect_retry_max;
821  int reconnect_retries;
822  int reconnect_retry_cur_sec;
823  pthread_t reconnect_thread;
824  os_event_t *reconnect_stop_event;
825  volatile bool reconnecting;
826  volatile bool reconnect_thread_active;
827 
828  uint32_t starting_drawn_count;
829  uint32_t starting_lagged_count;
830  uint32_t starting_frame_count;
831  uint32_t starting_skipped_frame_count;
832 
833  int total_frames;
834 
835  volatile bool active;
836  video_t *video;
837  audio_t *audio;
838  obs_encoder_t *video_encoder;
839  obs_encoder_t *audio_encoders[MAX_AUDIO_MIXES];
840  obs_service_t *service;
841  size_t mixer_idx;
842 
843  uint32_t scaled_width;
844  uint32_t scaled_height;
845 
846  bool video_conversion_set;
847  bool audio_conversion_set;
848  struct video_scale_info video_conversion;
849  struct audio_convert_info audio_conversion;
850 
851  pthread_mutex_t caption_mutex;
852  double caption_timestamp;
853  struct caption_text *caption_head;
854  struct caption_text *caption_tail;
855 
856  bool valid;
857 
858  uint64_t active_delay_ns;
859  encoded_callback_t delay_callback;
860  struct circlebuf delay_data; /* struct delay_data */
861  pthread_mutex_t delay_mutex;
862  uint32_t delay_sec;
863  uint32_t delay_flags;
864  uint32_t delay_cur_flags;
865  volatile long delay_restart_refs;
866  volatile bool delay_active;
867  volatile bool delay_capturing;
868 };
869 
870 static inline void do_output_signal(struct obs_output *output,
871  const char *signal)
872 {
873  struct calldata params = {0};
874  calldata_set_ptr(&params, "output", output);
875  signal_handler_signal(output->context.signals, signal, &params);
876  calldata_free(&params);
877 }
878 
879 extern void process_delay(void *data, struct encoder_packet *packet);
880 extern void obs_output_cleanup_delay(obs_output_t *output);
881 extern bool obs_output_delay_start(obs_output_t *output);
882 extern void obs_output_delay_stop(obs_output_t *output);
883 extern bool obs_output_actual_start(obs_output_t *output);
884 extern void obs_output_actual_stop(obs_output_t *output, bool force,
885  uint64_t ts);
886 
887 extern const struct obs_output_info *find_output(const char *id);
888 
889 extern void obs_output_remove_encoder(struct obs_output *output,
890  struct obs_encoder *encoder);
891 
892 extern void obs_encoder_packet_create_instance(struct encoder_packet *dst,
893  const struct encoder_packet *src);
894 void obs_output_destroy(obs_output_t *output);
895 
896 
897 /* ------------------------------------------------------------------------- */
898 /* encoders */
899 
901  struct obs_weak_ref ref;
903 };
904 
907  void (*new_packet)(void *param, struct encoder_packet *packet);
908  void *param;
909 };
910 
911 struct obs_encoder {
912  struct obs_context_data context;
913  struct obs_encoder_info info;
915 
916  pthread_mutex_t init_mutex;
917 
919  size_t planes;
920  size_t blocksize;
921  size_t framesize;
923 
924  size_t mixer_idx;
925 
928  enum video_format preferred_format;
929 
930  volatile bool active;
932 
933  /* indicates ownership of the info.id buffer */
935 
938 
940 
941  struct circlebuf audio_input_buffer[MAX_AV_PLANES];
942  uint8_t *audio_output_buffer[MAX_AV_PLANES];
943 
944  /* if a video encoder is paired with an audio encoder, make it start
945  * up at the specific timestamp. if this is the audio encoder,
946  * wait_for_video makes it wait until it's ready to sync up with
947  * video */
954 
955  pthread_mutex_t outputs_mutex;
956  DARRAY(obs_output_t*) outputs;
957 
959 
960  /* stores the video/audio media output pointer. video_t *or audio_t **/
961  void *media;
962 
963  pthread_mutex_t callbacks_mutex;
964  DARRAY(struct encoder_callback) callbacks;
965 
967 };
968 
969 extern struct obs_encoder_info *find_encoder(const char *id);
970 
971 extern bool obs_encoder_initialize(obs_encoder_t *encoder);
972 extern void obs_encoder_shutdown(obs_encoder_t *encoder);
973 
974 extern void obs_encoder_start(obs_encoder_t *encoder,
975  void (*new_packet)(void *param, struct encoder_packet *packet),
976  void *param);
977 extern void obs_encoder_stop(obs_encoder_t *encoder,
978  void (*new_packet)(void *param, struct encoder_packet *packet),
979  void *param);
980 
981 extern void obs_encoder_add_output(struct obs_encoder *encoder,
982  struct obs_output *output);
983 extern void obs_encoder_remove_output(struct obs_encoder *encoder,
984  struct obs_output *output);
985 
986 void obs_encoder_destroy(obs_encoder_t *encoder);
987 
988 /* ------------------------------------------------------------------------- */
989 /* services */
990 
992  struct obs_weak_ref ref;
994 };
995 
996 struct obs_service {
997  struct obs_context_data context;
998  struct obs_service_info info;
1000 
1001  /* indicates ownership of the info.id buffer */
1003 
1004  bool active;
1005  bool destroy;
1007 };
1008 
1009 extern const struct obs_service_info *find_service(const char *id);
1010 
1011 extern void obs_service_activate(struct obs_service *service);
1012 extern void obs_service_deactivate(struct obs_service *service, bool remove);
1013 extern bool obs_service_initialize(struct obs_service *service,
1014  struct obs_output *output);
1015 
1016 void obs_service_destroy(obs_service_t *service);
1017 
bool obs_encoder_initialize(obs_encoder_t *encoder)
Definition: obs-hotkey.h:511
volatile uint64_t timing_adjust
Definition: obs-internal.h:553
pthread_mutex_t callbacks_mutex
Definition: obs-internal.h:963
Definition: graphics.h:60
void(* set_locale)(const char *locale)
Definition: obs-internal.h:85
Definition: calldata.h:46
bool user_muted
Definition: obs-internal.h:565
pthread_mutex_t init_mutex
Definition: obs-internal.h:916
struct audio_resampler audio_resampler_t
Definition: audio-resampler.h:28
void(* draw)(void *param, uint32_t cx, uint32_t cy)
Definition: obs-internal.h:48
void obs_encoder_stop(obs_encoder_t *encoder, void(*new_packet)(void *param, struct encoder_packet *packet), void *param)
uint8_t * data
Definition: obs-encoder.h:42
void obs_encoder_start(obs_encoder_t *encoder, void(*new_packet)(void *param, struct encoder_packet *packet), void *param)
Definition: obs-internal.h:700
size_t planes
Definition: obs-internal.h:919
struct obs_encoder * encoder
Definition: obs-internal.h:902
size_t obs_hotkey_id
Definition: obs-hotkey.h:24
struct obs_display ** prev_next
Definition: obs-internal.h:206
pthread_mutex_t displays_mutex
Definition: obs-internal.h:311
bool defer_update
Definition: obs-internal.h:532
obs_data_t * settings
Definition: obs-internal.h:406
void(* obs_source_audio_capture_t)(void *param, obs_source_t *source, const struct audio_data *audio_data, bool muted)
Definition: obs.h:892
volatile bool active
Definition: obs-internal.h:930
Definition: video-io.h:135
Definition: obs-internal.h:514
bool size_changed
Definition: obs-internal.h:196
bool active
Definition: obs-internal.h:1004
struct obs_source_frame * filter_async_video(obs_source_t *source, struct obs_source_frame *in)
bool received_video
Definition: obs-internal.h:805
Definition: obs-internal.h:139
gs_effect_t * opaque_effect
Definition: obs-internal.h:235
Definition: obs-internal.h:222
struct obs_display * first_display
Definition: obs-internal.h:305
void obs_source_save(obs_source_t *source)
uint64_t next_audio_sys_ts_min
Definition: obs-internal.h:557
Definition: video-io.h:47
void * data[2]
Definition: obs-internal.h:145
struct obs_output * output
Definition: obs-internal.h:1006
bool audio_callback(void *param, uint64_t start_ts_in, uint64_t end_ts_in, uint64_t *out_ts, uint32_t mixers, struct audio_output_data *mixes)
void process_delay(void *data, struct encoder_packet *packet)
video_t * video
Definition: obs-internal.h:248
char * name
Definition: obs-internal.h:126
#define CAPTION_LINE_BYTES
Definition: obs-internal.h:791
bool audio_failed
Definition: obs-internal.h:563
char * data
Definition: obs-internal.h:100
uint8_t * stack
Definition: calldata.h:47
gs_effect_t * bicubic_effect
Definition: obs-internal.h:238
pthread_mutex_t outputs_mutex
Definition: obs-internal.h:955
struct obs_output * output
Definition: obs-internal.h:787
void deinterlace_update_async_video(obs_source_t *source)
Definition: obs-internal.h:797
gs_samplerstate_t * point_sampler
Definition: obs-internal.h:242
bool enabled
Definition: obs-internal.h:197
unsigned uint32_t
Definition: vc_stdint.h:31
#define MAX_AUDIO_CHANNELS
Definition: audio-io.h:29
Definition: obs-internal.h:785
uint32_t scaled_height
Definition: obs-internal.h:927
Definition: circlebuf.h:32
gs_swapchain_t * swap
Definition: obs-internal.h:200
void obs_transition_tick(obs_source_t *transition)
void(* obs_hotkey_func)(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, bool pressed)
Definition: obs-hotkey.h:132
obs_hotkey_t * hotkey
Definition: obs-internal.h:173
Definition: obs-internal.h:519
#define MAX_CHANNELS
Definition: obs-defs.h:21
obs_hotkey_id pair_partner_id
Definition: obs-internal.h:136
Definition: obs-internal.h:359
Definition: obs-internal.h:900
struct obs_output * first_output
Definition: obs-internal.h:306
volatile bool end_data_capture_thread_active
Definition: obs-internal.h:808
bool received_audio
Definition: obs-internal.h:806
uint32_t cy
Definition: obs-internal.h:198
char * bin_path
Definition: obs-internal.h:78
void(* free_locale)(void)
Definition: obs-internal.h:86
void audio_monitor_reset(struct audio_monitor *monitor)
void audio_monitor_destroy(struct audio_monitor *monitor)
video_format
Definition: video-io.h:33
void obs_context_data_insert(struct obs_context_data *context, pthread_mutex_t *mutex, void *first)
delay_msg
Definition: obs-internal.h:771
Definition: obs-ui.h:40
int64_t cur_pts
Definition: obs-internal.h:939
bool(* load)(void)
Definition: obs-internal.h:83
void obs_encoder_packet_create_instance(struct encoder_packet *dst, const struct encoder_packet *src)
Definition: obs-internal.h:774
struct gs_stage_surface gs_stagesurf_t
Definition: graphics.h:259
struct obs_source * next_audio_source
Definition: obs-internal.h:567
obs_obj_type
Definition: obs.h:573
void obs_output_remove_encoder(struct obs_output *output, struct obs_encoder *encoder)
struct obs_source * first_source
Definition: obs-internal.h:303
bool initialized
Definition: obs-internal.h:931
gs_effect_t * deinterlace_blend_2x_effect
Definition: obs-internal.h:275
bool obs_transition_init(obs_source_t *transition)
gs_effect_t * default_rect_effect
Definition: obs-internal.h:234
char * description
Definition: obs-internal.h:127
gs_effect_t * bilinear_lowres_effect
Definition: obs-internal.h:240
Definition: vec2.h:27
uint64_t ts
Definition: obs-internal.h:779
Definition: obs-internal.h:773
void set_deinterlace_texture_size(obs_source_t *source)
int32_t timebase_den
Definition: obs-encoder.h:49
void(* encoded_callback_t)(void *data, struct encoder_packet *packet)
Definition: obs-internal.h:783
void obs_output_cleanup_delay(obs_output_t *output)
gs_effect_t * solid_effect
Definition: obs-internal.h:236
Definition: audio-io.h:74
uint64_t last_frame_ts
Definition: obs-internal.h:558
Definition: graphics.h:443
void * param
Definition: obs-internal.h:516
EXPORT void blog(int log_level, const char *format,...)
os_event_t * stopping_event
Definition: obs-internal.h:814
bool obs_source_init_context(struct obs_source *source, obs_data_t *settings, const char *name, obs_data_t *hotkey_data, bool private)
unsigned __int64 uint64_t
Definition: vc_stdint.h:33
gs_effect_t * deinterlace_linear_effect
Definition: obs-internal.h:272
gs_effect_t * premultiplied_alpha_effect
Definition: obs-internal.h:241
Definition: obs-hotkey.h:37
volatile long refs
Definition: obs-internal.h:446
bool set
Definition: obs-internal.h:505
obs_source_t * channels[MAX_CHANNELS]
Definition: obs-internal.h:185
struct obs_weak_source * control
Definition: obs-internal.h:522
Definition: audio-io.h:93
bool obs_display_init(struct obs_display *display, const struct gs_init_data *graphics_data)
gs_color_format
Definition: graphics.h:56
Definition: obs-internal.h:487
void obs_encoder_remove_output(struct obs_encoder *encoder, struct obs_output *output)
obs_transition_mode
Definition: obs.h:1096
obs_deinterlace_mode
Definition: obs.h:900
Definition: obs-encoder.h:41
unsigned char uint8_t
Definition: vc_stdint.h:27
struct obs_data obs_data_t
Definition: obs-data.h:42
Definition: obs-source.h:143
void obs_output_destroy(obs_output_t *output)
uint32_t timebase_num
Definition: obs-internal.h:936
Definition: obs-output.h:33
volatile bool data_active
Definition: obs-internal.h:807
uint32_t lagged_frames
Definition: obs-internal.h:251
void * obs_hotkey_thread(void *param)
Definition: obs-internal.h:325
size_t last_audio_input_buf_size
Definition: obs-internal.h:571
gs_effect_t * default_effect
Definition: obs-internal.h:233
void obs_hotkeys_context_release(struct obs_context_data *context)
bool update_async_texture(struct obs_source *source, const struct obs_source_frame *frame, gs_texture_t *tex, gs_texrender_t *texrender)
bool set_async_texture_size(struct obs_source *source, const struct obs_source_frame *frame)
volatile bool valid
Definition: obs-internal.h:321
uint32_t conversion_height
Definition: obs-internal.h:256
void obs_transition_enum_sources(obs_source_t *transition, obs_source_enum_proc_t enum_callback, void *param)
uint64_t start_ts
Definition: obs-internal.h:953
void obs_transition_free(obs_source_t *transition)
size_t blocksize
Definition: obs-internal.h:920
Definition: obs-internal.h:167
obs_transition_scale_type
Definition: obs.h:1106
Definition: obs-internal.h:497
void obs_source_load(obs_source_t *source)
void(* obs_source_enum_proc_t)(obs_source_t *parent, obs_source_t *child, void *param)
Definition: obs-source.h:133
pthread_mutex_t services_mutex
Definition: obs-internal.h:314
uint64_t first_raw_ts
Definition: obs-internal.h:952
bool destroy_on_stop
Definition: obs-internal.h:958
void deinterlace_render(obs_source_t *s)
char * bin
Definition: obs-internal.h:99
gs_effect_t * deinterlace_yadif_2x_effect
Definition: obs-internal.h:277
uint64_t next_audio_ts_min
Definition: obs-internal.h:556
pthread_mutex_t encoders_mutex
Definition: obs-internal.h:313
void * media
Definition: obs-internal.h:961
pthread_mutex_t mutex
Definition: obs-internal.h:326
struct obs_source * first_audio_source
Definition: obs-internal.h:304
bool obs_output_actual_start(obs_output_t *output)
uint64_t last_audio_ts
Definition: obs-internal.h:555
size_t framesize_bytes
Definition: obs-internal.h:922
Definition: obs-internal.h:792
Definition: obs-internal.h:509
DARRAY(struct draw_callback) draw_callbacks
#define MAX_TS_VAR
Definition: obs-internal.h:719
Definition: obs-ui.h:84
bool obs_hotkeys_platform_init(struct obs_core_hotkeys *hotkeys)
struct obs_weak_encoder * control
Definition: obs-internal.h:914
Definition: obs-internal.h:183
uint32_t total_frames
Definition: obs-internal.h:250
bool gpu_conversion
Definition: obs-internal.h:254
Definition: obs-internal.h:777
#define MAX_AUDIO_MIXES
Definition: audio-io.h:28
Definition: graphics-internal.h:271
struct obs_hotkeys_platform obs_hotkeys_platform_t
Definition: obs-internal.h:150
struct obs_source_frame * frame
Definition: obs-internal.h:488
gs_texture_t * transparent_texture
Definition: obs-internal.h:268
Definition: obs-internal.h:282
uint32_t default_flags
Definition: obs-internal.h:526
Definition: obs-internal.h:911
Definition: obs-internal.h:75
Definition: obs-internal.h:302
obs_hotkey_active_func func[2]
Definition: obs-internal.h:142
void obs_source_activate(obs_source_t *source, enum view_type type)
bool obs_output_delay_start(obs_output_t *output)
int count
Definition: obs-internal.h:219
bool muted
Definition: obs-internal.h:566
volatile bool timing_set
Definition: obs-internal.h:552
double video_fps
Definition: obs-internal.h:247
enum obs_key obs_key_t
Definition: obs-hotkey.h:35
EXPORT void dstr_copy(struct dstr *dst, const char *array)
void obs_hotkey_name_map_free(void)
int cur_texture
Definition: obs-internal.h:244
Definition: effect.h:139
struct obs_service * first_service
Definition: obs-internal.h:308
obs_scale_type
Definition: obs.h:114
pthread_mutex_t draw_callbacks_mutex
Definition: obs-internal.h:201
Definition: obs-internal.h:98
void obs_source_deactivate(obs_source_t *source, enum view_type type)
void obs_context_data_free(struct obs_context_data *context)
struct obs_module * first_module
Definition: obs-internal.h:360
void obs_source_audio_render(obs_source_t *source, uint32_t mixers, size_t channels, size_t sample_rate, size_t size)
size_t framesize
Definition: obs-internal.h:921
signal_handler_t * signals
Definition: obs-internal.h:407
int64_t dts
Definition: obs-encoder.h:46
uint32_t scaled_width
Definition: obs-internal.h:926
void obs_source_video_tick(obs_source_t *source, float seconds)
Definition: obs-internal.h:494
void * module
Definition: obs-internal.h:80
void remove_async_frame(obs_source_t *source, struct obs_source_frame *frame)
Definition: obs-internal.h:403
obs_key_combination_t key
Definition: obs-internal.h:168
Definition: obs-encoder.h:112
void obs_encoder_destroy(obs_encoder_t *encoder)
obs_hotkey_pair_id pair_id
Definition: obs-internal.h:140
void free_module(struct obs_module *mod)
Definition: matrix4.h:32
void(* set_pointer)(obs_module_t *module)
Definition: obs-internal.h:88
void add_alignment(struct vec2 *v, uint32_t align, int cx, int cy)
void(* obs_hotkey_callback_router_func)(void *data, obs_hotkey_id id, bool pressed)
Definition: obs-hotkey.h:251
pthread_mutex_t sources_mutex
Definition: obs-internal.h:310
void obs_encoder_shutdown(obs_encoder_t *encoder)
uint32_t samplerate
Definition: obs-internal.h:918
struct obs_encoder_info * find_encoder(const char *id)
void obs_hotkeys_platform_free(struct obs_core_hotkeys *hotkeys)
EXPORT void signal_handler_signal(signal_handler_t *handler, const char *signal, calldata_t *params)
gs_effect_t * deinterlace_discard_2x_effect
Definition: obs-internal.h:271
void obs_hotkeys_free(void)
struct gs_texture gs_texture_t
Definition: graphics.h:258
void * obs_video_thread(void *param)
gs_effect_t * obs_load_effect(gs_effect_t **effect, const char *file)
char * array
Definition: dstr.h:37
view_type
Definition: obs-internal.h:698
Definition: obs.h:221
void obs_output_delay_stop(obs_output_t *output)
char * data_path
Definition: obs-internal.h:79
bool loaded
Definition: obs-internal.h:81
struct obs_encoder * first_encoder
Definition: obs-internal.h:307
size_t obs_hotkey_pair_id
Definition: obs-hotkey.h:26
uint64_t resample_offset
Definition: obs-internal.h:554
bool owns_info_id
Definition: obs-internal.h:529
int64_t video_offset
Definition: obs-internal.h:809
struct obs_weak_service * control
Definition: obs-internal.h:999
audio_t * audio
Definition: obs-internal.h:283
bool sent_first_packet
Definition: obs-internal.h:906
Definition: audio-io.h:68
struct obs_service * service
Definition: obs-internal.h:993
pthread_mutex_t channels_mutex
Definition: obs-internal.h:184
int64_t highest_video_ts
Definition: obs-internal.h:812
bool wait_for_video
Definition: obs-internal.h:948
gs_stagesurf_t * mapped_surface
Definition: obs-internal.h:243
void * data
Definition: obs-internal.h:130
struct signal_handler signal_handler_t
Definition: signal.h:35
Definition: obs-internal.h:495
Definition: obs-internal.h:500
gs_effect_t * deinterlace_yadif_effect
Definition: obs-internal.h:276
bool active
Definition: obs-internal.h:545
bool private
Definition: obs-internal.h:422
const char * conversion_tech
Definition: obs-internal.h:255
void * data
Definition: obs-internal.h:405
void obs_service_activate(struct obs_service *service)
bool first_received
Definition: obs-internal.h:949
void obs_context_data_setname(struct obs_context_data *context, const char *name)
char * name
Definition: obs-internal.h:404
gs_effect_t * deinterlace_discard_effect
Definition: obs-internal.h:270
Definition: dstr.h:36
Definition: obs-internal.h:991
pthread_mutex_t draw_info_mutex
Definition: obs-internal.h:202
bool audio_pending
Definition: obs-internal.h:564
uint64_t timestamp
Definition: obs-internal.h:218
pthread_mutex_t outputs_mutex
Definition: obs-internal.h:312
struct gs_sampler_state gs_samplerstate_t
Definition: graphics.h:263
bool modifiers_match
Definition: obs-internal.h:170
bool obs_service_initialize(struct obs_service *service, struct obs_output *output)
gs_effect_t * conversion_effect
Definition: obs-internal.h:237
obs_hotkey_registerer_t registerer_type
Definition: obs-internal.h:133
bool owns_info_id
Definition: obs-internal.h:1002
struct obs_source ** prev_next_audio_source
Definition: obs-internal.h:568
graphics_t * graphics
Definition: obs-internal.h:223
#define MICROSECOND_DEN
Definition: obs-internal.h:40
obs_allow_direct_render
Definition: obs.h:109
struct obs_context_data context
Definition: obs-internal.h:520
struct video_output video_t
Definition: video-io.h:31
void obs_view_free(struct obs_view *view)
uint64_t audio_ts
Definition: obs-internal.h:569
bool pressed1
Definition: obs-internal.h:144
void obs_service_destroy(obs_service_t *service)
bool owns_info_id
Definition: obs-internal.h:803
uint32_t flags
Definition: obs-internal.h:525
Definition: obs-internal.h:905
bool thread_initialized
Definition: obs-internal.h:252
uint32_t base_width
Definition: obs-internal.h:263
struct obs_core * obs
struct audio_monitor * audio_monitor_create(obs_source_t *source)
struct obs_display * next
Definition: obs-internal.h:205
gs_effect_t * deinterlace_linear_2x_effect
Definition: obs-internal.h:273
long long unnamed_index
Definition: obs-internal.h:319
void obs_output_actual_stop(obs_output_t *output, bool force, uint64_t ts)
struct obs_weak_output * control
Definition: obs-internal.h:800
void obs_context_data_remove(struct obs_context_data *context)
gs_effect_t * lanczos_effect
Definition: obs-internal.h:239
obs_hotkey_id id
Definition: obs-internal.h:125
size_t size
Definition: calldata.h:48
const char * file
Definition: obs-internal.h:77
#define NUM_TEXTURES
Definition: obs-internal.h:39
char * mod_name
Definition: obs-internal.h:76
struct caption_text * next
Definition: obs-internal.h:794
#define MAX_AV_PLANES
Definition: media-io-defs.h:20
struct obs_module * next
Definition: obs-internal.h:93
pthread_mutex_t interleaved_mutex
Definition: obs-internal.h:815
struct obs_source_info * get_source_info(const char *id)
void deinterlace_process_last_frame(obs_source_t *source, uint64_t sys_time)
float vol
Definition: obs-internal.h:504
Definition: graphics.h:61
Definition: obs-internal.h:47
uint32_t output_width
Definition: obs-internal.h:261
uint32_t timebase_den
Definition: obs-internal.h:937
bool async_rendered
Definition: obs-internal.h:560
bool pressed0
Definition: obs-internal.h:143
uint32_t(* ver)(void)
Definition: obs-internal.h:87
size_t mixer_idx
Definition: obs-internal.h:924
bool removed
Definition: obs-internal.h:543
uint32_t background_color
Definition: obs-internal.h:199
struct obs_source * source
Definition: obs-internal.h:511
bool showing
Definition: obs-internal.h:546
audio_action_type
Definition: obs-internal.h:493
struct obs_encoder * paired_encoder
Definition: obs-internal.h:950
int pressed
Definition: obs-internal.h:131
bool owns_info_id
Definition: obs-internal.h:934
Definition: base.h:65
bool obs_hotkeys_platform_is_pressed(obs_hotkeys_platform_t *context, obs_key_t key)
Definition: obs-internal.h:996
uint32_t output_height
Definition: obs-internal.h:262
void obs_source_destroy(struct obs_source *source)
uint64_t timestamp
Definition: obs-internal.h:501
enum obs_hotkey_registerer_type obs_hotkey_registerer_t
Definition: obs-hotkey.h:53
Definition: obs-internal.h:217
obs_monitoring_type
Definition: obs.h:926
void obs_encoder_add_output(struct obs_encoder *encoder, struct obs_output *output)
struct os_event_data os_event_t
Definition: threading.h:63
struct proc_handler proc_handler_t
Definition: proc.h:36
gs_effect_t * deinterlace_blend_effect
Definition: obs-internal.h:274
Main libobs header used by applications.
uint32_t cx
Definition: obs-internal.h:198
Definition: audio-resampler.h:30
volatile long weak_refs
Definition: obs-internal.h:447
Definition: graphics.h:62
struct obs_output_info * find_output(const char *id)
bool pressed
Definition: obs-internal.h:169
int64_t highest_audio_ts
Definition: obs-internal.h:811
Definition: obs-internal.h:699
obs_hotkey_func func
Definition: obs-internal.h:129
Definition: obs-internal.h:445
proc_handler_t * procs
Definition: obs-internal.h:408
obs_hotkey_id hotkey_id
Definition: obs-internal.h:172
obs_source_audio_capture_t callback
Definition: obs-internal.h:515
Definition: obs-internal.h:496
bool enabled
Definition: obs-internal.h:549
__int64 int64_t
Definition: vc_stdint.h:32
EXPORT void bfree(void *ptr)
uint32_t base_height
Definition: obs-internal.h:264
Definition: obs-internal.h:124
Definition: obs-internal.h:772
void(* unload)(void)
Definition: obs-internal.h:84
EXPORT bool os_file_exists(const char *path)
pthread_mutex_t audio_sources_mutex
Definition: obs-internal.h:315
bool obs_view_init(struct obs_view *view)
void obs_transition_load(obs_source_t *source, obs_data_t *data)
bool used
Definition: obs-internal.h:490
const char * profile_encoder_encode_name
Definition: obs-internal.h:966
uint64_t video_time
Definition: obs-internal.h:246
#define bool
Definition: vc_stdbool.h:5
void obs_service_deactivate(struct obs_service *service, bool remove)
void * registerer
Definition: obs-internal.h:134
pthread_t end_data_capture_thread
Definition: obs-internal.h:813
int64_t offset_usec
Definition: obs-internal.h:951
Definition: obs-internal.h:195
uint64_t last_sys_timestamp
Definition: obs-internal.h:559
long unused_count
Definition: obs-internal.h:489
bool obs_context_data_init(struct obs_context_data *context, enum obs_obj_type type, obs_data_t *settings, const char *name, obs_data_t *hotkey_data, bool private)
void * param
Definition: obs-internal.h:908
void obs_display_free(struct obs_display *display)
bool destroy
Definition: obs-internal.h:1005
volatile long activate_refs
Definition: obs-internal.h:538
struct gs_texture_render gs_texrender_t
Definition: graphics.h:265
struct audio_output audio_t
Definition: audio-io.h:38
Definition: obs.h:191
bool(* obs_hotkey_active_func)(void *data, obs_hotkey_pair_id id, obs_hotkey_t *hotkey, bool pressed)
Definition: obs-hotkey.h:154
void * param
Definition: obs-internal.h:49
float obs_source_get_target_volume(obs_source_t *source, obs_source_t *target)
void obs_transition_save(obs_source_t *source, obs_data_t *data)
const char * obs_get_hotkey_translation(obs_key_t key, const char *def)
Definition: obs-service.h:31
volatile long show_refs
Definition: obs-internal.h:535
struct profiler_name_store profiler_name_store_t
Definition: profiler.h:39
struct gs_swap_chain gs_swapchain_t
Definition: graphics.h:264
pthread_t video_thread
Definition: obs-internal.h:249
struct obs_service_info * find_service(const char *id)
Definition: video-io.h:46