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