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