├── .gitignore ├── .vscode ├── settings.json └── tasks.json ├── NetObsBindings ├── ObsInterop │ ├── Generated │ │ ├── os_dir.cs │ │ ├── gs_device.cs │ │ ├── gs_shader.cs │ │ ├── gs_timer.cs │ │ ├── obs_data.cs │ │ ├── obs_fader.cs │ │ ├── obs_scene.cs │ │ ├── obs_view.cs │ │ ├── timespec.cs │ │ ├── audio_output.cs │ │ ├── config_data.cs │ │ ├── gs_texrender.cs │ │ ├── gs_texture.cs │ │ ├── obs_canvas.cs │ │ ├── obs_display.cs │ │ ├── obs_encoder.cs │ │ ├── obs_module.cs │ │ ├── obs_output.cs │ │ ├── obs_property.cs │ │ ├── obs_service.cs │ │ ├── obs_source.cs │ │ ├── obs_volmeter.cs │ │ ├── proc_handler.cs │ │ ├── text_lookup.cs │ │ ├── video_output.cs │ │ ├── video_scaler.cs │ │ ├── gs_duplicator.cs │ │ ├── gs_swap_chain.cs │ │ ├── gs_timer_range.cs │ │ ├── obs_data_array.cs │ │ ├── obs_data_item.cs │ │ ├── obs_properties.cs │ │ ├── obs_scene_item.cs │ │ ├── signal_handler.cs │ │ ├── audio_resampler.cs │ │ ├── gs_index_buffer.cs │ │ ├── gs_sampler_state.cs │ │ ├── gs_shader_param.cs │ │ ├── gs_stage_surface.cs │ │ ├── gs_texture_render.cs │ │ ├── gs_vertex_buffer.cs │ │ ├── input_subsystem.cs │ │ ├── media_remux_job.cs │ │ ├── obs_context_data.cs │ │ ├── obs_encoder_group.cs │ │ ├── obs_missing_file.cs │ │ ├── obs_missing_files.cs │ │ ├── obs_weak_canvas.cs │ │ ├── obs_weak_encoder.cs │ │ ├── obs_weak_object.cs │ │ ├── obs_weak_output.cs │ │ ├── obs_weak_service.cs │ │ ├── obs_weak_source.cs │ │ ├── os_cpu_usage_info.cs │ │ ├── os_inhibit_info.cs │ │ ├── profiler_snapshot.cs │ │ ├── graphics_subsystem.cs │ │ ├── gs_zstencil_buffer.cs │ │ ├── obs_module_metadata.cs │ │ ├── profiler_name_store.cs │ │ ├── profiler_snapshot_entry.cs │ │ ├── gs_window.cs │ │ ├── gs_cull_mode.cs │ │ ├── gs_index_type.cs │ │ ├── gs_shader_type.cs │ │ ├── obs_button_type.cs │ │ ├── obs_encoder_type.cs │ │ ├── obs_number_type.cs │ │ ├── gs_texture_type.cs │ │ ├── obs_blending_method.cs │ │ ├── obs_missing_file_src.cs │ │ ├── obs_mouse_button_type.cs │ │ ├── obs_path_type.cs │ │ ├── obs_service_resolution.cs │ │ ├── obs_transition_mode.cs │ │ ├── obs_transition_target.cs │ │ ├── gs_stencil_side.cs │ │ ├── obs_group_type.cs │ │ ├── obs_allow_direct_render.cs │ │ ├── video_range_type.cs │ │ ├── video_trc.cs │ │ ├── obs_data_number_type.cs │ │ ├── obs_text_info_type.cs │ │ ├── gs_draw_mode.cs │ │ ├── obs_task_type.cs │ │ ├── gs_color_space.cs │ │ ├── obs_balance_type.cs │ │ ├── obs_deinterlace_field_order.cs │ │ ├── gs_rect.cs │ │ ├── gs_zstencil_format.cs │ │ ├── obs_text_type.cs │ │ ├── gs_image_alpha_mode.cs │ │ ├── gs_tvertarray.cs │ │ ├── plane.cs │ │ ├── obs_cmdline_args.cs │ │ ├── effect_section.cs │ │ ├── gs_stencil_op_type.cs │ │ ├── obs_combo_type.cs │ │ ├── obs_monitoring_type.cs │ │ ├── obs_order_movement.cs │ │ ├── obs_transition_scale_type.cs │ │ ├── obs_editable_list_type.cs │ │ ├── obs_source_type.cs │ │ ├── gs_address_mode.cs │ │ ├── gs_cube_sides.cs │ │ ├── obs_sceneitem_crop.cs │ │ ├── os_globent.cs │ │ ├── gs_blend_op_type.cs │ │ ├── obs_data_type.cs │ │ ├── obs_scene_duplicate_type.cs │ │ ├── gs_depth_test.cs │ │ ├── video_colorspace.cs │ │ ├── video_scale_type.cs │ │ ├── obs_scale_type.cs │ │ ├── profiler_time_entry.cs │ │ ├── gs_shader_texture.cs │ │ ├── obs_combo_format.cs │ │ ├── bounds.cs │ │ ├── darray.cs │ │ ├── gs_image_file2.cs │ │ ├── os_glob_info.cs │ │ ├── media_frames_per_second.cs │ │ ├── obs_module_info.cs │ │ ├── obs_obj_type.cs │ │ ├── os_proc_memory_usage.cs │ │ ├── obs_audio_info.cs │ │ ├── obs_module_failure_info.cs │ │ ├── call_param_type.cs │ │ ├── gs_image_file4.cs │ │ ├── gs_effect_param_info.cs │ │ ├── gs_shader_param_info.cs │ │ ├── obs_blending_type.cs │ │ ├── gs_image_file3.cs │ │ ├── pass_shaderparam.cs │ │ ├── obs_mouse_event.cs │ │ ├── obs_sceneitem_order_info.cs │ │ ├── speaker_layout.cs │ │ ├── obs_bounds_type.cs │ │ ├── obs_module_load_state.cs │ │ ├── obs_source_cea_708.cs │ │ ├── obs_module_info2.cs │ │ ├── obs_canvas_flags.cs │ │ ├── obs_media_state.cs │ │ ├── resample_info.cs │ │ ├── audio_format.cs │ │ ├── calldata.cs │ │ ├── gif_result.cs │ │ ├── gs_display_mode.cs │ │ ├── gs_monitor_info.cs │ │ ├── ObsInput.cs │ │ ├── obs_base_effect.cs │ │ ├── gs_blend_type.cs │ │ ├── gs_device_loss.cs │ │ ├── ObsEffect.cs │ │ ├── obs_encoder_roi.cs │ │ ├── obs_source_audio_mix.cs │ │ ├── ObsAxisang.cs │ │ ├── ObsService.cs │ │ ├── obs_audio_info2.cs │ │ ├── matrix3.cs │ │ ├── matrix4.cs │ │ ├── os_dirent.cs │ │ ├── audio_convert_info.cs │ │ ├── obs_deinterlace_mode.cs │ │ ├── encoder_packet_time.cs │ │ ├── gs_sample_filter.cs │ │ ├── base_allocator.cs │ │ ├── obs_service_connect_info.cs │ │ ├── obs_key_event.cs │ │ ├── gs_shader_param_type.cs │ │ ├── obs_property_type.cs │ │ ├── video_scale_info.cs │ │ ├── gs_color_format.cs │ │ ├── gs_effect_pass.cs │ │ ├── obs_interaction_flags.cs │ │ ├── obs_icon_type.cs │ │ ├── gs_sampler_info.cs │ │ ├── gs_init_data.cs │ │ ├── audio_output_info.cs │ │ ├── ObsMathDefs.cs │ │ ├── gs_vb_data.cs │ │ ├── obs_transform_info.cs │ │ ├── encoder_texture.cs │ │ ├── audio_output_data.cs │ │ ├── video_format.cs │ │ ├── video_output_info.cs │ │ ├── ObsVideoFrame.cs │ │ ├── gif_bitmap_callback_vt.cs │ │ ├── audio_data.cs │ │ ├── obs_audio_data.cs │ │ ├── NativeTypeNameAttribute.cs │ │ ├── video_frame.cs │ │ ├── encoder_packet.cs │ │ ├── gif_frame.cs │ │ ├── ObsLibnsgif.cs │ │ ├── ObsMediaRemux.cs │ │ ├── video_data.cs │ │ ├── obs_video_info.cs │ │ ├── encoder_frame.cs │ │ ├── obs_source_audio.cs │ │ ├── ObsBmem.cs │ │ ├── ObsTextLookup.cs │ │ ├── ObsEncoder.cs │ │ ├── ObsAudioResampler.cs │ │ ├── gs_image_file.cs │ │ ├── ObsProc.cs │ │ ├── ObsBase.cs │ │ ├── gs_effect_param_array_t.cs │ │ ├── pass_shaderparam_array_t.cs │ │ ├── profiler_time_entries_t.cs │ │ ├── ObsCalldata.cs │ │ ├── ObsVideoScaler.cs │ │ ├── obs_frontend_source_list.cs │ │ ├── obs_frontend_canvas_list.cs │ │ ├── gs_effect_technique.cs │ │ ├── axisang.cs │ │ ├── ObsMathExtra.cs │ │ ├── ObsOutput.cs │ │ ├── obs_frontend_event.cs │ │ ├── obs_source_frame2.cs │ │ ├── obs_source_frame.cs │ │ ├── ObsFormatConversion.cs │ │ ├── ObsPlane.cs │ │ ├── gs_effect.cs │ │ ├── obs_output_info.cs │ │ ├── ObsSource.cs │ │ ├── gif_animation.cs │ │ ├── obs_encoder_info.cs │ │ ├── ObsSignal.cs │ │ ├── ObsMatrix3.cs │ │ ├── ObsMissingFiles.cs │ │ ├── obs_service_info.cs │ │ ├── gs_effect_param.cs │ │ ├── ObsImageFile.cs │ │ ├── ObsAudio.cs │ │ ├── ObsMatrix4.cs │ │ ├── ObsBounds.cs │ │ └── obs_source_info.cs │ ├── ObsPlatform.Manual.cs │ ├── ObsBase.Manual.cs │ └── ObsBmem.Manual.cs ├── Obs.Version.cs └── NetObsBindings.csproj ├── generate ├── util │ └── obs-util.h ├── media-io │ └── obs-media-io.h └── graphics │ └── obs-graphics.h ├── samples └── SimplePlugin │ ├── SimplePlugin.csproj │ └── ObsPlugin.cs ├── replace_version.ps1 ├── .github └── workflows │ └── publish.yml ├── LICENSE.md ├── init_obs.ps1 ├── NetObsBindings.sln ├── README.md └── generate_bindings.ps1 /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | obj 3 | obs-studio 4 | publish 5 | .idea -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dotnet.defaultSolution": "NetObsBindings.sln" 3 | } -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_dir.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct os_dir 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_device.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_device 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_shader.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_shader 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_timer.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_timer 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_data 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_fader.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_fader 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_scene.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_scene 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_view.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_view 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/timespec.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct timespec 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_output.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct audio_output 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/config_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct config_data 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_texrender.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_texrender 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_texture.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_texture 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_canvas.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_canvas 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_display.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_display 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_encoder.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_encoder 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_module.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_module 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_output.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_output 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_property.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_property 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_service.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_service 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_source 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_volmeter.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_volmeter 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/proc_handler.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct proc_handler 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/text_lookup.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct text_lookup 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_output.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct video_output 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_scaler.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct video_scaler 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_duplicator.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_duplicator 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_swap_chain.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_swap_chain 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_timer_range.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_timer_range 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_data_array.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_data_array 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_data_item.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_data_item 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_properties.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_properties 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_scene_item.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_scene_item 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/signal_handler.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct signal_handler 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_resampler.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct audio_resampler 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_index_buffer.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_index_buffer 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_sampler_state.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_sampler_state 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_shader_param.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_shader_param 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_stage_surface.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_stage_surface 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_texture_render.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_texture_render 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_vertex_buffer.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_vertex_buffer 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/input_subsystem.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct input_subsystem 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/media_remux_job.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct media_remux_job 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_context_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_context_data 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_encoder_group.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_encoder_group 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_missing_file.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_missing_file 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_missing_files.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_missing_files 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_weak_canvas.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_weak_canvas 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_weak_encoder.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_weak_encoder 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_weak_object.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_weak_object 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_weak_output.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_weak_output 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_weak_service.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_weak_service 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_weak_source.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_weak_source 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_cpu_usage_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct os_cpu_usage_info 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_inhibit_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct os_inhibit_info 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/profiler_snapshot.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct profiler_snapshot 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/graphics_subsystem.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct graphics_subsystem 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_zstencil_buffer.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_zstencil_buffer 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_module_metadata.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_module_metadata 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/profiler_name_store.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct profiler_name_store 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/profiler_snapshot_entry.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct profiler_snapshot_entry 4 | { 5 | } 6 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_window.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_window 4 | { 5 | public void* hwnd; 6 | } 7 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_cull_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_cull_mode 4 | { 5 | GS_BACK, 6 | GS_FRONT, 7 | GS_NEITHER, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_index_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_index_type 4 | { 5 | GS_UNSIGNED_SHORT, 6 | GS_UNSIGNED_LONG, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_shader_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_shader_type 4 | { 5 | GS_SHADER_VERTEX, 6 | GS_SHADER_PIXEL, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/Obs.Version.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public static partial class Obs 4 | { 5 | public static readonly Version Version = new Version(32, 0, 0); 6 | } 7 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_button_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_button_type 4 | { 5 | OBS_BUTTON_DEFAULT, 6 | OBS_BUTTON_URL, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_encoder_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_encoder_type 4 | { 5 | OBS_ENCODER_AUDIO, 6 | OBS_ENCODER_VIDEO, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_number_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_number_type 4 | { 5 | OBS_NUMBER_SCROLLER, 6 | OBS_NUMBER_SLIDER, 7 | } 8 | -------------------------------------------------------------------------------- /generate/util/obs-util.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_texture_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_texture_type 4 | { 5 | GS_TEXTURE_2D, 6 | GS_TEXTURE_3D, 7 | GS_TEXTURE_CUBE, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_blending_method.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_blending_method 4 | { 5 | OBS_BLEND_METHOD_DEFAULT, 6 | OBS_BLEND_METHOD_SRGB_OFF, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_missing_file_src.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_missing_file_src 4 | { 5 | OBS_MISSING_FILE_SOURCE, 6 | OBS_MISSING_FILE_SCRIPT, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_mouse_button_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_mouse_button_type 4 | { 5 | MOUSE_LEFT, 6 | MOUSE_MIDDLE, 7 | MOUSE_RIGHT, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_path_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_path_type 4 | { 5 | OBS_PATH_FILE, 6 | OBS_PATH_FILE_SAVE, 7 | OBS_PATH_DIRECTORY, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_service_resolution.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_service_resolution 4 | { 5 | public int cx; 6 | 7 | public int cy; 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_transition_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_transition_mode 4 | { 5 | OBS_TRANSITION_MODE_AUTO, 6 | OBS_TRANSITION_MODE_MANUAL, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_transition_target.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_transition_target 4 | { 5 | OBS_TRANSITION_SOURCE_A, 6 | OBS_TRANSITION_SOURCE_B, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_stencil_side.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_stencil_side 4 | { 5 | GS_STENCIL_FRONT = 1, 6 | GS_STENCIL_BACK, 7 | GS_STENCIL_BOTH, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_group_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_group_type 4 | { 5 | OBS_COMBO_INVALID, 6 | OBS_GROUP_NORMAL, 7 | OBS_GROUP_CHECKABLE, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_allow_direct_render.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_allow_direct_render 4 | { 5 | OBS_NO_DIRECT_RENDERING, 6 | OBS_ALLOW_DIRECT_RENDERING, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_range_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum video_range_type 4 | { 5 | VIDEO_RANGE_DEFAULT, 6 | VIDEO_RANGE_PARTIAL, 7 | VIDEO_RANGE_FULL, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_trc.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum video_trc 4 | { 5 | VIDEO_TRC_DEFAULT, 6 | VIDEO_TRC_SRGB, 7 | VIDEO_TRC_PQ, 8 | VIDEO_TRC_HLG, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_data_number_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_data_number_type 4 | { 5 | OBS_DATA_NUM_INVALID, 6 | OBS_DATA_NUM_INT, 7 | OBS_DATA_NUM_DOUBLE, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_text_info_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_text_info_type 4 | { 5 | OBS_TEXT_INFO_NORMAL, 6 | OBS_TEXT_INFO_WARNING, 7 | OBS_TEXT_INFO_ERROR, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_draw_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_draw_mode 4 | { 5 | GS_POINTS, 6 | GS_LINES, 7 | GS_LINESTRIP, 8 | GS_TRIS, 9 | GS_TRISTRIP, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_task_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_task_type 4 | { 5 | OBS_TASK_UI, 6 | OBS_TASK_GRAPHICS, 7 | OBS_TASK_AUDIO, 8 | OBS_TASK_DESTROY, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_color_space.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_color_space 4 | { 5 | GS_CS_SRGB, 6 | GS_CS_SRGB_16F, 7 | GS_CS_709_EXTENDED, 8 | GS_CS_709_SCRGB, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_balance_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_balance_type 4 | { 5 | OBS_BALANCE_TYPE_SINE_LAW, 6 | OBS_BALANCE_TYPE_SQUARE_LAW, 7 | OBS_BALANCE_TYPE_LINEAR, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_deinterlace_field_order.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_deinterlace_field_order 4 | { 5 | OBS_DEINTERLACE_FIELD_ORDER_TOP, 6 | OBS_DEINTERLACE_FIELD_ORDER_BOTTOM, 7 | } 8 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_rect.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_rect 4 | { 5 | public int x; 6 | 7 | public int y; 8 | 9 | public int cx; 10 | 11 | public int cy; 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_zstencil_format.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_zstencil_format 4 | { 5 | GS_ZS_NONE, 6 | GS_Z16, 7 | GS_Z24_S8, 8 | GS_Z32F, 9 | GS_Z32F_S8X24, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_text_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_text_type 4 | { 5 | OBS_TEXT_DEFAULT, 6 | OBS_TEXT_PASSWORD, 7 | OBS_TEXT_MULTILINE, 8 | OBS_TEXT_INFO, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_image_alpha_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_image_alpha_mode 4 | { 5 | GS_IMAGE_ALPHA_STRAIGHT, 6 | GS_IMAGE_ALPHA_PREMULTIPLY_SRGB, 7 | GS_IMAGE_ALPHA_PREMULTIPLY, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_tvertarray.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_tvertarray 4 | { 5 | [NativeTypeName("size_t")] 6 | public nuint width; 7 | 8 | public void* array; 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/plane.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct plane 4 | { 5 | [NativeTypeName("struct vec3")] 6 | public System.Numerics.Vector3 dir; 7 | 8 | public float dist; 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_cmdline_args.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_cmdline_args 4 | { 5 | public int argc; 6 | 7 | [NativeTypeName("char **")] 8 | public sbyte** argv; 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/effect_section.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum effect_section 4 | { 5 | EFFECT_PARAM, 6 | EFFECT_TECHNIQUE, 7 | EFFECT_SAMPLER, 8 | EFFECT_PASS, 9 | EFFECT_ANNOTATION, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_stencil_op_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_stencil_op_type 4 | { 5 | GS_KEEP, 6 | GS_ZERO, 7 | GS_REPLACE, 8 | GS_INCR, 9 | GS_DECR, 10 | GS_INVERT, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_combo_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_combo_type 4 | { 5 | OBS_COMBO_TYPE_INVALID, 6 | OBS_COMBO_TYPE_EDITABLE, 7 | OBS_COMBO_TYPE_LIST, 8 | OBS_COMBO_TYPE_RADIO, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_monitoring_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_monitoring_type 4 | { 5 | OBS_MONITORING_TYPE_NONE, 6 | OBS_MONITORING_TYPE_MONITOR_ONLY, 7 | OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_order_movement.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_order_movement 4 | { 5 | OBS_ORDER_MOVE_UP, 6 | OBS_ORDER_MOVE_DOWN, 7 | OBS_ORDER_MOVE_TOP, 8 | OBS_ORDER_MOVE_BOTTOM, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_transition_scale_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_transition_scale_type 4 | { 5 | OBS_TRANSITION_SCALE_MAX_ONLY, 6 | OBS_TRANSITION_SCALE_ASPECT, 7 | OBS_TRANSITION_SCALE_STRETCH, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_editable_list_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_editable_list_type 4 | { 5 | OBS_EDITABLE_LIST_TYPE_STRINGS, 6 | OBS_EDITABLE_LIST_TYPE_FILES, 7 | OBS_EDITABLE_LIST_TYPE_FILES_AND_URLS, 8 | } 9 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_source_type 4 | { 5 | OBS_SOURCE_TYPE_INPUT, 6 | OBS_SOURCE_TYPE_FILTER, 7 | OBS_SOURCE_TYPE_TRANSITION, 8 | OBS_SOURCE_TYPE_SCENE, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_address_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_address_mode 4 | { 5 | GS_ADDRESS_CLAMP, 6 | GS_ADDRESS_WRAP, 7 | GS_ADDRESS_MIRROR, 8 | GS_ADDRESS_BORDER, 9 | GS_ADDRESS_MIRRORONCE, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_cube_sides.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_cube_sides 4 | { 5 | GS_POSITIVE_X, 6 | GS_NEGATIVE_X, 7 | GS_POSITIVE_Y, 8 | GS_NEGATIVE_Y, 9 | GS_POSITIVE_Z, 10 | GS_NEGATIVE_Z, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_sceneitem_crop.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_sceneitem_crop 4 | { 5 | public int left; 6 | 7 | public int top; 8 | 9 | public int right; 10 | 11 | public int bottom; 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_globent.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct os_globent 4 | { 5 | [NativeTypeName("char *")] 6 | public sbyte* path; 7 | 8 | [NativeTypeName("bool")] 9 | public byte directory; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_blend_op_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_blend_op_type 4 | { 5 | GS_BLEND_OP_ADD, 6 | GS_BLEND_OP_SUBTRACT, 7 | GS_BLEND_OP_REVERSE_SUBTRACT, 8 | GS_BLEND_OP_MIN, 9 | GS_BLEND_OP_MAX, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_data_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_data_type 4 | { 5 | OBS_DATA_NULL, 6 | OBS_DATA_STRING, 7 | OBS_DATA_NUMBER, 8 | OBS_DATA_BOOLEAN, 9 | OBS_DATA_OBJECT, 10 | OBS_DATA_ARRAY, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_scene_duplicate_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_scene_duplicate_type 4 | { 5 | OBS_SCENE_DUP_REFS, 6 | OBS_SCENE_DUP_COPY, 7 | OBS_SCENE_DUP_PRIVATE_REFS, 8 | OBS_SCENE_DUP_PRIVATE_COPY, 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_depth_test.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_depth_test 4 | { 5 | GS_NEVER, 6 | GS_LESS, 7 | GS_LEQUAL, 8 | GS_EQUAL, 9 | GS_GEQUAL, 10 | GS_GREATER, 11 | GS_NOTEQUAL, 12 | GS_ALWAYS, 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_colorspace.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum video_colorspace 4 | { 5 | VIDEO_CS_DEFAULT, 6 | VIDEO_CS_601, 7 | VIDEO_CS_709, 8 | VIDEO_CS_SRGB, 9 | VIDEO_CS_2100_PQ, 10 | VIDEO_CS_2100_HLG, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_scale_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum video_scale_type 4 | { 5 | VIDEO_SCALE_DEFAULT, 6 | VIDEO_SCALE_POINT, 7 | VIDEO_SCALE_FAST_BILINEAR, 8 | VIDEO_SCALE_BILINEAR, 9 | VIDEO_SCALE_BICUBIC, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_scale_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_scale_type 4 | { 5 | OBS_SCALE_DISABLE, 6 | OBS_SCALE_POINT, 7 | OBS_SCALE_BICUBIC, 8 | OBS_SCALE_BILINEAR, 9 | OBS_SCALE_LANCZOS, 10 | OBS_SCALE_AREA, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/profiler_time_entry.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct profiler_time_entry 4 | { 5 | [NativeTypeName("uint64_t")] 6 | public ulong time_delta; 7 | 8 | [NativeTypeName("uint64_t")] 9 | public ulong count; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_shader_texture.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_shader_texture 4 | { 5 | [NativeTypeName("gs_texture_t *")] 6 | public gs_texture* tex; 7 | 8 | [NativeTypeName("bool")] 9 | public byte srgb; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_combo_format.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_combo_format 4 | { 5 | OBS_COMBO_FORMAT_INVALID, 6 | OBS_COMBO_FORMAT_INT, 7 | OBS_COMBO_FORMAT_FLOAT, 8 | OBS_COMBO_FORMAT_STRING, 9 | OBS_COMBO_FORMAT_BOOL, 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/bounds.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct bounds 4 | { 5 | [NativeTypeName("struct vec3")] 6 | public System.Numerics.Vector3 min; 7 | 8 | [NativeTypeName("struct vec3")] 9 | public System.Numerics.Vector3 max; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/darray.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct darray 4 | { 5 | public void* array; 6 | 7 | [NativeTypeName("size_t")] 8 | public nuint num; 9 | 10 | [NativeTypeName("size_t")] 11 | public nuint capacity; 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_image_file2.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_image_file2 4 | { 5 | [NativeTypeName("struct gs_image_file")] 6 | public gs_image_file image; 7 | 8 | [NativeTypeName("uint64_t")] 9 | public ulong mem_usage; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_glob_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct os_glob_info 4 | { 5 | [NativeTypeName("size_t")] 6 | public nuint gl_pathc; 7 | 8 | [NativeTypeName("struct os_globent *")] 9 | public os_globent* gl_pathv; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/media_frames_per_second.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct media_frames_per_second 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint numerator; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint denominator; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_module_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_module_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* bin_path; 7 | 8 | [NativeTypeName("const char *")] 9 | public sbyte* data_path; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_obj_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_obj_type 4 | { 5 | OBS_OBJ_TYPE_INVALID, 6 | OBS_OBJ_TYPE_SOURCE, 7 | OBS_OBJ_TYPE_OUTPUT, 8 | OBS_OBJ_TYPE_ENCODER, 9 | OBS_OBJ_TYPE_SERVICE, 10 | OBS_OBJ_TYPE_CANVAS, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_proc_memory_usage.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct os_proc_memory_usage 4 | { 5 | [NativeTypeName("uint64_t")] 6 | public ulong resident_size; 7 | 8 | [NativeTypeName("uint64_t")] 9 | public ulong virtual_size; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_audio_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_audio_info 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint samples_per_sec; 7 | 8 | [NativeTypeName("enum speaker_layout")] 9 | public speaker_layout speakers; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_module_failure_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_module_failure_info 4 | { 5 | [NativeTypeName("char **")] 6 | public sbyte** failed_modules; 7 | 8 | [NativeTypeName("size_t")] 9 | public nuint count; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/call_param_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum call_param_type 4 | { 5 | CALL_PARAM_TYPE_VOID, 6 | CALL_PARAM_TYPE_INT, 7 | CALL_PARAM_TYPE_FLOAT, 8 | CALL_PARAM_TYPE_BOOL, 9 | CALL_PARAM_TYPE_PTR, 10 | CALL_PARAM_TYPE_STRING, 11 | } 12 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_image_file4.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_image_file4 4 | { 5 | [NativeTypeName("struct gs_image_file3")] 6 | public gs_image_file3 image3; 7 | 8 | [NativeTypeName("enum gs_color_space")] 9 | public gs_color_space space; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_effect_param_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_effect_param_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* name; 7 | 8 | [NativeTypeName("enum gs_shader_param_type")] 9 | public gs_shader_param_type type; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_shader_param_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_shader_param_info 4 | { 5 | [NativeTypeName("enum gs_shader_param_type")] 6 | public gs_shader_param_type type; 7 | 8 | [NativeTypeName("const char *")] 9 | public sbyte* name; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_blending_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_blending_type 4 | { 5 | OBS_BLEND_NORMAL, 6 | OBS_BLEND_ADDITIVE, 7 | OBS_BLEND_SUBTRACT, 8 | OBS_BLEND_SCREEN, 9 | OBS_BLEND_MULTIPLY, 10 | OBS_BLEND_LIGHTEN, 11 | OBS_BLEND_DARKEN, 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_image_file3.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_image_file3 4 | { 5 | [NativeTypeName("struct gs_image_file2")] 6 | public gs_image_file2 image2; 7 | 8 | [NativeTypeName("enum gs_image_alpha_mode")] 9 | public gs_image_alpha_mode alpha_mode; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/pass_shaderparam.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct pass_shaderparam 4 | { 5 | [NativeTypeName("struct gs_effect_param *")] 6 | public gs_effect_param* eparam; 7 | 8 | [NativeTypeName("gs_sparam_t *")] 9 | public gs_shader_param* sparam; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_mouse_event.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_mouse_event 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint modifiers; 7 | 8 | [NativeTypeName("int32_t")] 9 | public int x; 10 | 11 | [NativeTypeName("int32_t")] 12 | public int y; 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_sceneitem_order_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_sceneitem_order_info 4 | { 5 | [NativeTypeName("obs_sceneitem_t *")] 6 | public obs_scene_item* group; 7 | 8 | [NativeTypeName("obs_sceneitem_t *")] 9 | public obs_scene_item* item; 10 | } 11 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/speaker_layout.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum speaker_layout 4 | { 5 | SPEAKERS_UNKNOWN, 6 | SPEAKERS_MONO, 7 | SPEAKERS_STEREO, 8 | SPEAKERS_2POINT1, 9 | SPEAKERS_4POINT0, 10 | SPEAKERS_4POINT1, 11 | SPEAKERS_5POINT1, 12 | SPEAKERS_7POINT1 = 8, 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_bounds_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_bounds_type 4 | { 5 | OBS_BOUNDS_NONE, 6 | OBS_BOUNDS_STRETCH, 7 | OBS_BOUNDS_SCALE_INNER, 8 | OBS_BOUNDS_SCALE_OUTER, 9 | OBS_BOUNDS_SCALE_TO_WIDTH, 10 | OBS_BOUNDS_SCALE_TO_HEIGHT, 11 | OBS_BOUNDS_MAX_ONLY, 12 | } 13 | -------------------------------------------------------------------------------- /generate/media-io/obs-media-io.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_module_load_state.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_module_load_state 4 | { 5 | OBS_MODULE_INVALID, 6 | OBS_MODULE_ENABLED, 7 | OBS_MODULE_MISSING, 8 | OBS_MODULE_DISABLED, 9 | OBS_MODULE_DISABLED_SAFE, 10 | OBS_MODULE_FAILED_TO_OPEN, 11 | OBS_MODULE_FAILED_TO_INITIALIZE, 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_cea_708.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_source_cea_708 4 | { 5 | [NativeTypeName("const uint8_t *")] 6 | public byte* data; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint packets; 10 | 11 | [NativeTypeName("uint64_t")] 12 | public ulong timestamp; 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_module_info2.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_module_info2 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* bin_path; 7 | 8 | [NativeTypeName("const char *")] 9 | public sbyte* data_path; 10 | 11 | [NativeTypeName("const char *")] 12 | public sbyte* name; 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_canvas_flags.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_canvas_flags 4 | { 5 | MAIN = 1 << 0, 6 | ACTIVATE = 1 << 1, 7 | MIX_AUDIO = 1 << 2, 8 | SCENE_REF = 1 << 3, 9 | EPHEMERAL = 1 << 4, 10 | PROGRAM = ACTIVATE | MIX_AUDIO | SCENE_REF, 11 | PREVIEW = EPHEMERAL, 12 | DEVICE = ACTIVATE | EPHEMERAL, 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_media_state.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_media_state 4 | { 5 | OBS_MEDIA_STATE_NONE, 6 | OBS_MEDIA_STATE_PLAYING, 7 | OBS_MEDIA_STATE_OPENING, 8 | OBS_MEDIA_STATE_BUFFERING, 9 | OBS_MEDIA_STATE_PAUSED, 10 | OBS_MEDIA_STATE_STOPPED, 11 | OBS_MEDIA_STATE_ENDED, 12 | OBS_MEDIA_STATE_ERROR, 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/resample_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct resample_info 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint samples_per_sec; 7 | 8 | [NativeTypeName("enum audio_format")] 9 | public audio_format format; 10 | 11 | [NativeTypeName("enum speaker_layout")] 12 | public speaker_layout speakers; 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_format.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum audio_format 4 | { 5 | AUDIO_FORMAT_UNKNOWN, 6 | AUDIO_FORMAT_U8BIT, 7 | AUDIO_FORMAT_16BIT, 8 | AUDIO_FORMAT_32BIT, 9 | AUDIO_FORMAT_FLOAT, 10 | AUDIO_FORMAT_U8BIT_PLANAR, 11 | AUDIO_FORMAT_16BIT_PLANAR, 12 | AUDIO_FORMAT_32BIT_PLANAR, 13 | AUDIO_FORMAT_FLOAT_PLANAR, 14 | } 15 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/calldata.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct calldata 4 | { 5 | [NativeTypeName("uint8_t *")] 6 | public byte* stack; 7 | 8 | [NativeTypeName("size_t")] 9 | public nuint size; 10 | 11 | [NativeTypeName("size_t")] 12 | public nuint capacity; 13 | 14 | [NativeTypeName("bool")] 15 | public byte @fixed; 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gif_result.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gif_result 4 | { 5 | GIF_WORKING = 1, 6 | GIF_OK = 0, 7 | GIF_INSUFFICIENT_FRAME_DATA = -1, 8 | GIF_FRAME_DATA_ERROR = -2, 9 | GIF_INSUFFICIENT_DATA = -3, 10 | GIF_DATA_ERROR = -4, 11 | GIF_INSUFFICIENT_MEMORY = -5, 12 | GIF_FRAME_NO_DISPLAY = -6, 13 | GIF_END_OF_FRAME = -7, 14 | } 15 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_display_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_display_mode 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint width; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint height; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint bits; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint freq; 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_monitor_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_monitor_info 4 | { 5 | public int rotation_degrees; 6 | 7 | [NativeTypeName("long")] 8 | public int x; 9 | 10 | [NativeTypeName("long")] 11 | public int y; 12 | 13 | [NativeTypeName("long")] 14 | public int cx; 15 | 16 | [NativeTypeName("long")] 17 | public int cy; 18 | } 19 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsInput.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsInput 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern int input_getbuttonstate([NativeTypeName("input_t *")] input_subsystem* input, [NativeTypeName("uint32_t")] uint button); 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_base_effect.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_base_effect 4 | { 5 | OBS_EFFECT_DEFAULT, 6 | OBS_EFFECT_DEFAULT_RECT, 7 | OBS_EFFECT_OPAQUE, 8 | OBS_EFFECT_SOLID, 9 | OBS_EFFECT_BICUBIC, 10 | OBS_EFFECT_LANCZOS, 11 | OBS_EFFECT_BILINEAR_LOWRES, 12 | OBS_EFFECT_PREMULTIPLIED_ALPHA, 13 | OBS_EFFECT_REPEAT, 14 | OBS_EFFECT_AREA, 15 | } 16 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_blend_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_blend_type 4 | { 5 | GS_BLEND_ZERO, 6 | GS_BLEND_ONE, 7 | GS_BLEND_SRCCOLOR, 8 | GS_BLEND_INVSRCCOLOR, 9 | GS_BLEND_SRCALPHA, 10 | GS_BLEND_INVSRCALPHA, 11 | GS_BLEND_DSTCOLOR, 12 | GS_BLEND_INVDSTCOLOR, 13 | GS_BLEND_DSTALPHA, 14 | GS_BLEND_INVDSTALPHA, 15 | GS_BLEND_SRCALPHASAT, 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_device_loss.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_device_loss 4 | { 5 | [NativeTypeName("void (*)(void *)")] 6 | public delegate* unmanaged[Cdecl] device_loss_release; 7 | 8 | [NativeTypeName("void (*)(void *, void *)")] 9 | public delegate* unmanaged[Cdecl] device_loss_rebuild; 10 | 11 | public void* data; 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsEffect.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsEffect 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void effect_param_parse_property([NativeTypeName("gs_eparam_t *")] gs_effect_param* param0, [NativeTypeName("const char *")] sbyte* property); 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_encoder_roi.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_encoder_roi 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint top; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint bottom; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint left; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint right; 16 | 17 | public float priority; 18 | } 19 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_audio_mix.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct obs_source_audio_mix 6 | { 7 | [NativeTypeName("struct audio_output_data[6]")] 8 | public _output_e__FixedBuffer output; 9 | 10 | [InlineArray(6)] 11 | public partial struct _output_e__FixedBuffer 12 | { 13 | public audio_output_data e0; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsAxisang.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsAxisang 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void axisang_from_quat([NativeTypeName("struct axisang *")] axisang* dst, [NativeTypeName("const struct quat *")] System.Numerics.Quaternion* q); 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsService.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsService 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void obs_register_service_s([NativeTypeName("const struct obs_service_info *")] obs_service_info* info, [NativeTypeName("size_t")] nuint size); 9 | } 10 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_audio_info2.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_audio_info2 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint samples_per_sec; 7 | 8 | [NativeTypeName("enum speaker_layout")] 9 | public speaker_layout speakers; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint max_buffering_ms; 13 | 14 | [NativeTypeName("bool")] 15 | public byte fixed_buffering; 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/matrix3.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct matrix3 4 | { 5 | [NativeTypeName("struct vec3")] 6 | public System.Numerics.Vector3 x; 7 | 8 | [NativeTypeName("struct vec3")] 9 | public System.Numerics.Vector3 y; 10 | 11 | [NativeTypeName("struct vec3")] 12 | public System.Numerics.Vector3 z; 13 | 14 | [NativeTypeName("struct vec3")] 15 | public System.Numerics.Vector3 t; 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/matrix4.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct matrix4 4 | { 5 | [NativeTypeName("struct vec4")] 6 | public System.Numerics.Vector4 x; 7 | 8 | [NativeTypeName("struct vec4")] 9 | public System.Numerics.Vector4 y; 10 | 11 | [NativeTypeName("struct vec4")] 12 | public System.Numerics.Vector4 z; 13 | 14 | [NativeTypeName("struct vec4")] 15 | public System.Numerics.Vector4 t; 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/os_dirent.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct os_dirent 6 | { 7 | [NativeTypeName("char[256]")] 8 | public _d_name_e__FixedBuffer d_name; 9 | 10 | [NativeTypeName("bool")] 11 | public byte directory; 12 | 13 | [InlineArray(256)] 14 | public partial struct _d_name_e__FixedBuffer 15 | { 16 | public sbyte e0; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_convert_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct audio_convert_info 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint samples_per_sec; 7 | 8 | [NativeTypeName("enum audio_format")] 9 | public audio_format format; 10 | 11 | [NativeTypeName("enum speaker_layout")] 12 | public speaker_layout speakers; 13 | 14 | [NativeTypeName("bool")] 15 | public byte allow_clipping; 16 | } 17 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_deinterlace_mode.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_deinterlace_mode 4 | { 5 | OBS_DEINTERLACE_MODE_DISABLE, 6 | OBS_DEINTERLACE_MODE_DISCARD, 7 | OBS_DEINTERLACE_MODE_RETRO, 8 | OBS_DEINTERLACE_MODE_BLEND, 9 | OBS_DEINTERLACE_MODE_BLEND_2X, 10 | OBS_DEINTERLACE_MODE_LINEAR, 11 | OBS_DEINTERLACE_MODE_LINEAR_2X, 12 | OBS_DEINTERLACE_MODE_YADIF, 13 | OBS_DEINTERLACE_MODE_YADIF_2X, 14 | } 15 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/encoder_packet_time.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct encoder_packet_time 4 | { 5 | [NativeTypeName("int64_t")] 6 | public long pts; 7 | 8 | [NativeTypeName("uint64_t")] 9 | public ulong cts; 10 | 11 | [NativeTypeName("uint64_t")] 12 | public ulong fer; 13 | 14 | [NativeTypeName("uint64_t")] 15 | public ulong ferc; 16 | 17 | [NativeTypeName("uint64_t")] 18 | public ulong pir; 19 | } 20 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_sample_filter.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_sample_filter 4 | { 5 | GS_FILTER_POINT, 6 | GS_FILTER_LINEAR, 7 | GS_FILTER_ANISOTROPIC, 8 | GS_FILTER_MIN_MAG_POINT_MIP_LINEAR, 9 | GS_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT, 10 | GS_FILTER_MIN_POINT_MAG_MIP_LINEAR, 11 | GS_FILTER_MIN_LINEAR_MAG_MIP_POINT, 12 | GS_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR, 13 | GS_FILTER_MIN_MAG_LINEAR_MIP_POINT, 14 | } 15 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/base_allocator.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct base_allocator 4 | { 5 | [NativeTypeName("void *(*)(size_t)")] 6 | public delegate* unmanaged[Cdecl] malloc; 7 | 8 | [NativeTypeName("void *(*)(void *, size_t)")] 9 | public delegate* unmanaged[Cdecl] realloc; 10 | 11 | [NativeTypeName("void (*)(void *)")] 12 | public delegate* unmanaged[Cdecl] free; 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_service_connect_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_service_connect_info 4 | { 5 | OBS_SERVICE_CONNECT_INFO_SERVER_URL = 0, 6 | OBS_SERVICE_CONNECT_INFO_STREAM_ID = 2, 7 | OBS_SERVICE_CONNECT_INFO_STREAM_KEY = 2, 8 | OBS_SERVICE_CONNECT_INFO_USERNAME = 4, 9 | OBS_SERVICE_CONNECT_INFO_PASSWORD = 6, 10 | OBS_SERVICE_CONNECT_INFO_ENCRYPT_PASSPHRASE = 8, 11 | OBS_SERVICE_CONNECT_INFO_BEARER_TOKEN = 10, 12 | } 13 | -------------------------------------------------------------------------------- /samples/SimplePlugin/SimplePlugin.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_key_event.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_key_event 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint modifiers; 7 | 8 | [NativeTypeName("char *")] 9 | public sbyte* text; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint native_modifiers; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint native_scancode; 16 | 17 | [NativeTypeName("uint32_t")] 18 | public uint native_vkey; 19 | } 20 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_shader_param_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_shader_param_type 4 | { 5 | GS_SHADER_PARAM_UNKNOWN, 6 | GS_SHADER_PARAM_BOOL, 7 | GS_SHADER_PARAM_FLOAT, 8 | GS_SHADER_PARAM_INT, 9 | GS_SHADER_PARAM_STRING, 10 | GS_SHADER_PARAM_VEC2, 11 | GS_SHADER_PARAM_VEC3, 12 | GS_SHADER_PARAM_VEC4, 13 | GS_SHADER_PARAM_INT2, 14 | GS_SHADER_PARAM_INT3, 15 | GS_SHADER_PARAM_INT4, 16 | GS_SHADER_PARAM_MATRIX4X4, 17 | GS_SHADER_PARAM_TEXTURE, 18 | } 19 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_property_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_property_type 4 | { 5 | OBS_PROPERTY_INVALID, 6 | OBS_PROPERTY_BOOL, 7 | OBS_PROPERTY_INT, 8 | OBS_PROPERTY_FLOAT, 9 | OBS_PROPERTY_TEXT, 10 | OBS_PROPERTY_PATH, 11 | OBS_PROPERTY_LIST, 12 | OBS_PROPERTY_COLOR, 13 | OBS_PROPERTY_BUTTON, 14 | OBS_PROPERTY_FONT, 15 | OBS_PROPERTY_EDITABLE_LIST, 16 | OBS_PROPERTY_FRAME_RATE, 17 | OBS_PROPERTY_GROUP, 18 | OBS_PROPERTY_COLOR_ALPHA, 19 | } 20 | -------------------------------------------------------------------------------- /generate/graphics/obs-graphics.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_scale_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct video_scale_info 4 | { 5 | [NativeTypeName("enum video_format")] 6 | public video_format format; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint width; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint height; 13 | 14 | [NativeTypeName("enum video_range_type")] 15 | public video_range_type range; 16 | 17 | [NativeTypeName("enum video_colorspace")] 18 | public video_colorspace colorspace; 19 | } 20 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_color_format.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum gs_color_format 4 | { 5 | GS_UNKNOWN, 6 | GS_A8, 7 | GS_R8, 8 | GS_RGBA, 9 | GS_BGRX, 10 | GS_BGRA, 11 | GS_R10G10B10A2, 12 | GS_RGBA16, 13 | GS_R16, 14 | GS_RGBA16F, 15 | GS_RGBA32F, 16 | GS_RG16F, 17 | GS_RG32F, 18 | GS_R16F, 19 | GS_R32F, 20 | GS_DXT1, 21 | GS_DXT3, 22 | GS_DXT5, 23 | GS_R8G8, 24 | GS_RGBA_UNORM, 25 | GS_BGRX_UNORM, 26 | GS_BGRA_UNORM, 27 | GS_RG16, 28 | } 29 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_effect_pass.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_effect_pass 4 | { 5 | [NativeTypeName("char *")] 6 | public sbyte* name; 7 | 8 | [NativeTypeName("enum effect_section")] 9 | public effect_section section; 10 | 11 | [NativeTypeName("gs_shader_t *")] 12 | public gs_shader* vertshader; 13 | 14 | [NativeTypeName("gs_shader_t *")] 15 | public gs_shader* pixelshader; 16 | 17 | public pass_shaderparam_array_t vertshader_params; 18 | 19 | public pass_shaderparam_array_t pixelshader_params; 20 | } 21 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/ObsPlatform.Manual.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | 3 | namespace ObsInterop; 4 | 5 | /// 6 | /// This method contains bindings generated form platform.h header file in the OBS library. 7 | /// 8 | /// [IMPORTANT] Please use with care and prefer .NET APIs whenever possible. 9 | /// 10 | /// For example, the os_cpu_usage_info_start() method returns a pointer to the struct that has different layout in different systems. 11 | /// 12 | public partial class ObsPlatform 13 | { 14 | public static readonly unsafe int ARCH_BITS = sizeof(nint) * 8; 15 | } -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_interaction_flags.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_interaction_flags 4 | { 5 | INTERACT_NONE = 0, 6 | INTERACT_CAPS_KEY = 1, 7 | INTERACT_SHIFT_KEY = 1 << 1, 8 | INTERACT_CONTROL_KEY = 1 << 2, 9 | INTERACT_ALT_KEY = 1 << 3, 10 | INTERACT_MOUSE_LEFT = 1 << 4, 11 | INTERACT_MOUSE_MIDDLE = 1 << 5, 12 | INTERACT_MOUSE_RIGHT = 1 << 6, 13 | INTERACT_COMMAND_KEY = 1 << 7, 14 | INTERACT_NUMLOCK_KEY = 1 << 8, 15 | INTERACT_IS_KEY_PAD = 1 << 9, 16 | INTERACT_IS_LEFT = 1 << 10, 17 | INTERACT_IS_RIGHT = 1 << 11, 18 | } 19 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_icon_type.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_icon_type 4 | { 5 | OBS_ICON_TYPE_UNKNOWN, 6 | OBS_ICON_TYPE_IMAGE, 7 | OBS_ICON_TYPE_COLOR, 8 | OBS_ICON_TYPE_SLIDESHOW, 9 | OBS_ICON_TYPE_AUDIO_INPUT, 10 | OBS_ICON_TYPE_AUDIO_OUTPUT, 11 | OBS_ICON_TYPE_DESKTOP_CAPTURE, 12 | OBS_ICON_TYPE_WINDOW_CAPTURE, 13 | OBS_ICON_TYPE_GAME_CAPTURE, 14 | OBS_ICON_TYPE_CAMERA, 15 | OBS_ICON_TYPE_TEXT, 16 | OBS_ICON_TYPE_MEDIA, 17 | OBS_ICON_TYPE_BROWSER, 18 | OBS_ICON_TYPE_CUSTOM, 19 | OBS_ICON_TYPE_PROCESS_AUDIO_OUTPUT, 20 | } 21 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_sampler_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_sampler_info 4 | { 5 | [NativeTypeName("enum gs_sample_filter")] 6 | public gs_sample_filter filter; 7 | 8 | [NativeTypeName("enum gs_address_mode")] 9 | public gs_address_mode address_u; 10 | 11 | [NativeTypeName("enum gs_address_mode")] 12 | public gs_address_mode address_v; 13 | 14 | [NativeTypeName("enum gs_address_mode")] 15 | public gs_address_mode address_w; 16 | 17 | public int max_anisotropy; 18 | 19 | [NativeTypeName("uint32_t")] 20 | public uint border_color; 21 | } 22 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_init_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gs_init_data 4 | { 5 | [NativeTypeName("struct gs_window")] 6 | public gs_window window; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint cx; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint cy; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint num_backbuffers; 16 | 17 | [NativeTypeName("enum gs_color_format")] 18 | public gs_color_format format; 19 | 20 | [NativeTypeName("enum gs_zstencil_format")] 21 | public gs_zstencil_format zsformat; 22 | 23 | [NativeTypeName("uint32_t")] 24 | public uint adapter; 25 | } 26 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_output_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct audio_output_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* name; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint samples_per_sec; 10 | 11 | [NativeTypeName("enum audio_format")] 12 | public audio_format format; 13 | 14 | [NativeTypeName("enum speaker_layout")] 15 | public speaker_layout speakers; 16 | 17 | [NativeTypeName("audio_input_callback_t")] 18 | public delegate* unmanaged[Cdecl] input_callback; 19 | 20 | public void* input_param; 21 | } 22 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsMathDefs.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public static partial class ObsMathDefs 4 | { 5 | [NativeTypeName("#define M_PI 3.1415926535897932384626433832795f")] 6 | public const float M_PI = 3.1415926535897932384626433832795f; 7 | 8 | [NativeTypeName("#define LARGE_EPSILON 1e-2f")] 9 | public const float LARGE_EPSILON = 1e-2f; 10 | 11 | [NativeTypeName("#define EPSILON 1e-4f")] 12 | public const float EPSILON = 1e-4f; 13 | 14 | [NativeTypeName("#define TINY_EPSILON 1e-5f")] 15 | public const float TINY_EPSILON = 1e-5f; 16 | 17 | [NativeTypeName("#define M_INFINITE 3.4e38f")] 18 | public const float M_INFINITE = 3.4e38f; 19 | } 20 | -------------------------------------------------------------------------------- /replace_version.ps1: -------------------------------------------------------------------------------- 1 | $major = (Select-String -Path obs-studio/libobs/obs-config.h -Pattern '#define LIBOBS_API_MAJOR_VER (\d+)').Matches.Groups[1].Value 2 | $minor = (Select-String -Path obs-studio/libobs/obs-config.h -Pattern '#define LIBOBS_API_MINOR_VER (\d+)').Matches.Groups[1].Value 3 | $build = (Select-String -Path obs-studio/libobs/obs-config.h -Pattern '#define LIBOBS_API_PATCH_VER (\d+)').Matches.Groups[1].Value 4 | 5 | $obsVersionFile = @" 6 | namespace ObsInterop; 7 | 8 | public static partial class Obs 9 | { 10 | public static readonly Version Version = new Version(${major}, ${minor}, ${build}); 11 | } 12 | "@ 13 | 14 | Out-File -FilePath NetObsBindings/Obs.Version.cs -InputObject $obsVersionFile 15 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_vb_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_vb_data 4 | { 5 | [NativeTypeName("size_t")] 6 | public nuint num; 7 | 8 | [NativeTypeName("struct vec3 *")] 9 | public System.Numerics.Vector3* points; 10 | 11 | [NativeTypeName("struct vec3 *")] 12 | public System.Numerics.Vector3* normals; 13 | 14 | [NativeTypeName("struct vec3 *")] 15 | public System.Numerics.Vector3* tangents; 16 | 17 | [NativeTypeName("uint32_t *")] 18 | public uint* colors; 19 | 20 | [NativeTypeName("size_t")] 21 | public nuint num_tex; 22 | 23 | [NativeTypeName("struct gs_tvertarray *")] 24 | public gs_tvertarray* tvarray; 25 | } 26 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/ObsBase.Manual.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsBase 6 | { 7 | // Due to a limitation in the .NET Runtime, there is currently no portable way to do P/Invoke with varargs in C#. 8 | // Until https://github.com/dotnet/runtime/issues/48796 is resolved and support is added to ClangSharp, we can only 9 | // provide non-varargs bindings to prevent silent portability bugs (i.e., crashes on Linux and possibly other 10 | // platforms). 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | public static extern void blog(int log_level, [NativeTypeName("const char *")] sbyte* format); 13 | } 14 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_transform_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_transform_info 4 | { 5 | [NativeTypeName("struct vec2")] 6 | public System.Numerics.Vector2 pos; 7 | 8 | public float rot; 9 | 10 | [NativeTypeName("struct vec2")] 11 | public System.Numerics.Vector2 scale; 12 | 13 | [NativeTypeName("uint32_t")] 14 | public uint alignment; 15 | 16 | [NativeTypeName("enum obs_bounds_type")] 17 | public obs_bounds_type bounds_type; 18 | 19 | [NativeTypeName("uint32_t")] 20 | public uint bounds_alignment; 21 | 22 | [NativeTypeName("struct vec2")] 23 | public System.Numerics.Vector2 bounds; 24 | 25 | [NativeTypeName("bool")] 26 | public byte crop_to_bounds; 27 | } 28 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/encoder_texture.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct encoder_texture 4 | { 5 | [NativeTypeName("uint32_t")] 6 | public uint handle; 7 | 8 | [NativeTypeName("struct gs_texture *[4]")] 9 | public _tex_e__FixedBuffer tex; 10 | 11 | public unsafe partial struct _tex_e__FixedBuffer 12 | { 13 | public gs_texture* e0; 14 | public gs_texture* e1; 15 | public gs_texture* e2; 16 | public gs_texture* e3; 17 | 18 | public ref gs_texture* this[int index] 19 | { 20 | get 21 | { 22 | fixed (gs_texture** pThis = &e0) 23 | { 24 | return ref pThis[index]; 25 | } 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_output_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct audio_output_data 4 | { 5 | [NativeTypeName("float *[8]")] 6 | public _data_e__FixedBuffer data; 7 | 8 | public unsafe partial struct _data_e__FixedBuffer 9 | { 10 | public float* e0; 11 | public float* e1; 12 | public float* e2; 13 | public float* e3; 14 | public float* e4; 15 | public float* e5; 16 | public float* e6; 17 | public float* e7; 18 | 19 | public ref float* this[int index] 20 | { 21 | get 22 | { 23 | fixed (float** pThis = &e0) 24 | { 25 | return ref pThis[index]; 26 | } 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_format.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum video_format 4 | { 5 | VIDEO_FORMAT_NONE, 6 | VIDEO_FORMAT_I420, 7 | VIDEO_FORMAT_NV12, 8 | VIDEO_FORMAT_YVYU, 9 | VIDEO_FORMAT_YUY2, 10 | VIDEO_FORMAT_UYVY, 11 | VIDEO_FORMAT_RGBA, 12 | VIDEO_FORMAT_BGRA, 13 | VIDEO_FORMAT_BGRX, 14 | VIDEO_FORMAT_Y800, 15 | VIDEO_FORMAT_I444, 16 | VIDEO_FORMAT_BGR3, 17 | VIDEO_FORMAT_I422, 18 | VIDEO_FORMAT_I40A, 19 | VIDEO_FORMAT_I42A, 20 | VIDEO_FORMAT_YUVA, 21 | VIDEO_FORMAT_AYUV, 22 | VIDEO_FORMAT_I010, 23 | VIDEO_FORMAT_P010, 24 | VIDEO_FORMAT_I210, 25 | VIDEO_FORMAT_I412, 26 | VIDEO_FORMAT_YA2L, 27 | VIDEO_FORMAT_P216, 28 | VIDEO_FORMAT_P416, 29 | VIDEO_FORMAT_V210, 30 | VIDEO_FORMAT_R10L, 31 | } 32 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_output_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct video_output_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* name; 7 | 8 | [NativeTypeName("enum video_format")] 9 | public video_format format; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint fps_num; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint fps_den; 16 | 17 | [NativeTypeName("uint32_t")] 18 | public uint width; 19 | 20 | [NativeTypeName("uint32_t")] 21 | public uint height; 22 | 23 | [NativeTypeName("size_t")] 24 | public nuint cache_size; 25 | 26 | [NativeTypeName("enum video_colorspace")] 27 | public video_colorspace colorspace; 28 | 29 | [NativeTypeName("enum video_range_type")] 30 | public video_range_type range; 31 | } 32 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsVideoFrame.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsVideoFrame 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void video_frame_init([NativeTypeName("struct video_frame *")] video_frame* frame, [NativeTypeName("enum video_format")] video_format format, [NativeTypeName("uint32_t")] uint width, [NativeTypeName("uint32_t")] uint height); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void video_frame_copy([NativeTypeName("struct video_frame *")] video_frame* dst, [NativeTypeName("const struct video_frame *")] video_frame* src, [NativeTypeName("enum video_format")] video_format format, [NativeTypeName("uint32_t")] uint height); 12 | } 13 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gif_bitmap_callback_vt.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gif_bitmap_callback_vt 4 | { 5 | [NativeTypeName("gif_bitmap_cb_create")] 6 | public delegate* unmanaged[Cdecl] bitmap_create; 7 | 8 | [NativeTypeName("gif_bitmap_cb_destroy")] 9 | public delegate* unmanaged[Cdecl] bitmap_destroy; 10 | 11 | [NativeTypeName("gif_bitmap_cb_get_buffer")] 12 | public delegate* unmanaged[Cdecl] bitmap_get_buffer; 13 | 14 | [NativeTypeName("gif_bitmap_cb_set_opaque")] 15 | public delegate* unmanaged[Cdecl] bitmap_set_opaque; 16 | 17 | [NativeTypeName("gif_bitmap_cb_test_opaque")] 18 | public delegate* unmanaged[Cdecl] bitmap_test_opaque; 19 | 20 | [NativeTypeName("gif_bitmap_cb_modified")] 21 | public delegate* unmanaged[Cdecl] bitmap_modified; 22 | } 23 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/audio_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct audio_data 4 | { 5 | [NativeTypeName("uint8_t *[8]")] 6 | public _data_e__FixedBuffer data; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint frames; 10 | 11 | [NativeTypeName("uint64_t")] 12 | public ulong timestamp; 13 | 14 | public unsafe partial struct _data_e__FixedBuffer 15 | { 16 | public byte* e0; 17 | public byte* e1; 18 | public byte* e2; 19 | public byte* e3; 20 | public byte* e4; 21 | public byte* e5; 22 | public byte* e6; 23 | public byte* e7; 24 | 25 | public ref byte* this[int index] 26 | { 27 | get 28 | { 29 | fixed (byte** pThis = &e0) 30 | { 31 | return ref pThis[index]; 32 | } 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_audio_data.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_audio_data 4 | { 5 | [NativeTypeName("uint8_t *[8]")] 6 | public _data_e__FixedBuffer data; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint frames; 10 | 11 | [NativeTypeName("uint64_t")] 12 | public ulong timestamp; 13 | 14 | public unsafe partial struct _data_e__FixedBuffer 15 | { 16 | public byte* e0; 17 | public byte* e1; 18 | public byte* e2; 19 | public byte* e3; 20 | public byte* e4; 21 | public byte* e5; 22 | public byte* e6; 23 | public byte* e7; 24 | 25 | public ref byte* this[int index] 26 | { 27 | get 28 | { 29 | fixed (byte** pThis = &e0) 30 | { 31 | return ref pThis[index]; 32 | } 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | paths: ['NetObsBindings/**'] 7 | jobs: 8 | publish: 9 | runs-on: ubuntu-latest 10 | defaults: 11 | run: 12 | shell: bash 13 | env: 14 | DEPLOY_SECRET: ${{ secrets.NUGET_TOKEN }} 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v2 18 | with: 19 | fetch-depth: 0 20 | 21 | - name: Install .NET 9.0 22 | uses: actions/setup-dotnet@v1 23 | with: 24 | dotnet-version: '9.0.x' 25 | 26 | - name: Pack & Publish to nuget 27 | shell: bash 28 | run: | 29 | dotnet pack ./NetObsBindings -c release -o publish /p:ContinuousIntegrationBuild=true 30 | dotnet nuget push publish/*.nupkg -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/NativeTypeNameAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | 4 | namespace ObsInterop; 5 | 6 | /// Defines the type of a member as it was used in the native signature. 7 | [AttributeUsage(AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = false, Inherited = true)] 8 | [Conditional("DEBUG")] 9 | internal sealed partial class NativeTypeNameAttribute : Attribute 10 | { 11 | private readonly string _name; 12 | 13 | /// Initializes a new instance of the class. 14 | /// The name of the type that was used in the native signature. 15 | public NativeTypeNameAttribute(string name) 16 | { 17 | _name = name; 18 | } 19 | 20 | /// Gets the name of the type that was used in the native signature. 21 | public string Name => _name; 22 | } 23 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_frame.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct video_frame 6 | { 7 | [NativeTypeName("uint8_t *[8]")] 8 | public _data_e__FixedBuffer data; 9 | 10 | [NativeTypeName("uint32_t[8]")] 11 | public _linesize_e__FixedBuffer linesize; 12 | 13 | public unsafe partial struct _data_e__FixedBuffer 14 | { 15 | public byte* e0; 16 | public byte* e1; 17 | public byte* e2; 18 | public byte* e3; 19 | public byte* e4; 20 | public byte* e5; 21 | public byte* e6; 22 | public byte* e7; 23 | 24 | public ref byte* this[int index] 25 | { 26 | get 27 | { 28 | fixed (byte** pThis = &e0) 29 | { 30 | return ref pThis[index]; 31 | } 32 | } 33 | } 34 | } 35 | 36 | [InlineArray(8)] 37 | public partial struct _linesize_e__FixedBuffer 38 | { 39 | public uint e0; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/encoder_packet.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct encoder_packet 4 | { 5 | [NativeTypeName("uint8_t *")] 6 | public byte* data; 7 | 8 | [NativeTypeName("size_t")] 9 | public nuint size; 10 | 11 | [NativeTypeName("int64_t")] 12 | public long pts; 13 | 14 | [NativeTypeName("int64_t")] 15 | public long dts; 16 | 17 | [NativeTypeName("int32_t")] 18 | public int timebase_num; 19 | 20 | [NativeTypeName("int32_t")] 21 | public int timebase_den; 22 | 23 | [NativeTypeName("enum obs_encoder_type")] 24 | public obs_encoder_type type; 25 | 26 | [NativeTypeName("bool")] 27 | public byte keyframe; 28 | 29 | [NativeTypeName("int64_t")] 30 | public long dts_usec; 31 | 32 | [NativeTypeName("int64_t")] 33 | public long sys_dts_usec; 34 | 35 | public int priority; 36 | 37 | public int drop_priority; 38 | 39 | [NativeTypeName("size_t")] 40 | public nuint track_idx; 41 | 42 | [NativeTypeName("obs_encoder_t *")] 43 | public obs_encoder* encoder; 44 | } 45 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gif_frame.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct gif_frame 4 | { 5 | [NativeTypeName("bool")] 6 | public byte display; 7 | 8 | [NativeTypeName("unsigned int")] 9 | public uint frame_delay; 10 | 11 | [NativeTypeName("unsigned int")] 12 | public uint frame_pointer; 13 | 14 | [NativeTypeName("bool")] 15 | public byte virgin; 16 | 17 | [NativeTypeName("bool")] 18 | public byte opaque; 19 | 20 | [NativeTypeName("bool")] 21 | public byte redraw_required; 22 | 23 | [NativeTypeName("unsigned char")] 24 | public byte disposal_method; 25 | 26 | [NativeTypeName("bool")] 27 | public byte transparency; 28 | 29 | [NativeTypeName("unsigned char")] 30 | public byte transparency_index; 31 | 32 | [NativeTypeName("unsigned int")] 33 | public uint redraw_x; 34 | 35 | [NativeTypeName("unsigned int")] 36 | public uint redraw_y; 37 | 38 | [NativeTypeName("unsigned int")] 39 | public uint redraw_width; 40 | 41 | [NativeTypeName("unsigned int")] 42 | public uint redraw_height; 43 | } 44 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build (Debug)", 6 | "command": "dotnet", 7 | "type": "process", 8 | "options": { 9 | "cwd": "${workspaceFolder}/NetObsBindings" 10 | }, 11 | "args": [ 12 | "build", 13 | "-c", 14 | "Debug" 15 | ], 16 | "problemMatcher": "$msCompile", 17 | "group": { 18 | "kind": "build", 19 | "isDefault": true 20 | } 21 | }, 22 | { 23 | "label": "build (Release)", 24 | "command": "dotnet", 25 | "type": "process", 26 | "options": { 27 | "cwd": "${workspaceFolder}/NetObsBindings" 28 | }, 29 | "args": [ 30 | "build", 31 | "-c", 32 | "Release" 33 | ], 34 | "problemMatcher": "$msCompile", 35 | "group": { 36 | "kind": "build", 37 | "isDefault": true 38 | } 39 | }, 40 | { 41 | "label": "Generate C# bindings", 42 | "type": "shell", 43 | "command": ".\\build.ps1" 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsLibnsgif.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsLibnsgif 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void gif_create(gif_animation* gif, gif_bitmap_callback_vt* bitmap_callbacks); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern gif_result gif_initialise(gif_animation* gif, [NativeTypeName("size_t")] nuint size, [NativeTypeName("unsigned char *")] byte* data); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern gif_result gif_decode_frame(gif_animation* gif, [NativeTypeName("unsigned int")] uint frame); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern void gif_finalise(gif_animation* gif); 18 | 19 | [NativeTypeName("#define GIF_MAX_LZW 12")] 20 | public const int GIF_MAX_LZW = 12; 21 | } 22 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsMediaRemux.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsMediaRemux 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("bool")] 9 | public static extern byte media_remux_job_create([NativeTypeName("media_remux_job_t *")] media_remux_job** job, [NativeTypeName("const char *")] sbyte* in_filename, [NativeTypeName("const char *")] sbyte* out_filename); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | [return: NativeTypeName("bool")] 13 | public static extern byte media_remux_job_process([NativeTypeName("media_remux_job_t")] media_remux_job* job, [NativeTypeName("media_remux_progress_callback")] delegate* unmanaged[Cdecl] callback, void* data); 14 | 15 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 16 | public static extern void media_remux_job_destroy([NativeTypeName("media_remux_job_t")] media_remux_job* job); 17 | } 18 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright © Kostiantyn Sharovarskyi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/video_data.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct video_data 6 | { 7 | [NativeTypeName("uint8_t *[8]")] 8 | public _data_e__FixedBuffer data; 9 | 10 | [NativeTypeName("uint32_t[8]")] 11 | public _linesize_e__FixedBuffer linesize; 12 | 13 | [NativeTypeName("uint64_t")] 14 | public ulong timestamp; 15 | 16 | public unsafe partial struct _data_e__FixedBuffer 17 | { 18 | public byte* e0; 19 | public byte* e1; 20 | public byte* e2; 21 | public byte* e3; 22 | public byte* e4; 23 | public byte* e5; 24 | public byte* e6; 25 | public byte* e7; 26 | 27 | public ref byte* this[int index] 28 | { 29 | get 30 | { 31 | fixed (byte** pThis = &e0) 32 | { 33 | return ref pThis[index]; 34 | } 35 | } 36 | } 37 | } 38 | 39 | [InlineArray(8)] 40 | public partial struct _linesize_e__FixedBuffer 41 | { 42 | public uint e0; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /init_obs.ps1: -------------------------------------------------------------------------------- 1 | $BeforeLocation = Get-Location 2 | $GitTag = "32.0.0" 3 | 4 | try { 5 | $ObsFolder = './obs-studio' 6 | 7 | if (Test-Path -Path $ObsFolder) { 8 | Set-Location $ObsFolder 9 | git fetch origin 10 | git checkout $GitTag 11 | git pull origin 12 | } else { 13 | git clone https://github.com/obsproject/obs-studio 14 | git checkout $GitTag 15 | } 16 | 17 | # Create obsconfig.h in libobs folder 18 | $LibObsFolder = './libobs' 19 | $ObsConfigPath = Join-Path $LibObsFolder 'obsconfig.h' 20 | 21 | if (Test-Path -Path $LibObsFolder) { 22 | if (-not (Test-Path -Path $ObsConfigPath)) { 23 | Write-Host "Creating obsconfig.h in libobs folder..." 24 | '#pragma once' | Out-File -FilePath $ObsConfigPath -Encoding UTF8 25 | Write-Host "obsconfig.h created successfully at: $ObsConfigPath" 26 | } else { 27 | Write-Host "obsconfig.h already exists at: $ObsConfigPath" 28 | } 29 | } else { 30 | Write-Host "Warning: libobs folder not found at expected location: $LibObsFolder" 31 | } 32 | } 33 | finally { 34 | Set-Location $BeforeLocation 35 | } 36 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_video_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_video_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* graphics_module; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint fps_num; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint fps_den; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint base_width; 16 | 17 | [NativeTypeName("uint32_t")] 18 | public uint base_height; 19 | 20 | [NativeTypeName("uint32_t")] 21 | public uint output_width; 22 | 23 | [NativeTypeName("uint32_t")] 24 | public uint output_height; 25 | 26 | [NativeTypeName("enum video_format")] 27 | public video_format output_format; 28 | 29 | [NativeTypeName("uint32_t")] 30 | public uint adapter; 31 | 32 | [NativeTypeName("bool")] 33 | public byte gpu_conversion; 34 | 35 | [NativeTypeName("enum video_colorspace")] 36 | public video_colorspace colorspace; 37 | 38 | [NativeTypeName("enum video_range_type")] 39 | public video_range_type range; 40 | 41 | [NativeTypeName("enum obs_scale_type")] 42 | public obs_scale_type scale_type; 43 | } 44 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/encoder_frame.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct encoder_frame 6 | { 7 | [NativeTypeName("uint8_t *[8]")] 8 | public _data_e__FixedBuffer data; 9 | 10 | [NativeTypeName("uint32_t[8]")] 11 | public _linesize_e__FixedBuffer linesize; 12 | 13 | [NativeTypeName("uint32_t")] 14 | public uint frames; 15 | 16 | [NativeTypeName("int64_t")] 17 | public long pts; 18 | 19 | public unsafe partial struct _data_e__FixedBuffer 20 | { 21 | public byte* e0; 22 | public byte* e1; 23 | public byte* e2; 24 | public byte* e3; 25 | public byte* e4; 26 | public byte* e5; 27 | public byte* e6; 28 | public byte* e7; 29 | 30 | public ref byte* this[int index] 31 | { 32 | get 33 | { 34 | fixed (byte** pThis = &e0) 35 | { 36 | return ref pThis[index]; 37 | } 38 | } 39 | } 40 | } 41 | 42 | [InlineArray(8)] 43 | public partial struct _linesize_e__FixedBuffer 44 | { 45 | public uint e0; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_audio.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public partial struct obs_source_audio 4 | { 5 | [NativeTypeName("const uint8_t *[8]")] 6 | public _data_e__FixedBuffer data; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint frames; 10 | 11 | [NativeTypeName("enum speaker_layout")] 12 | public speaker_layout speakers; 13 | 14 | [NativeTypeName("enum audio_format")] 15 | public audio_format format; 16 | 17 | [NativeTypeName("uint32_t")] 18 | public uint samples_per_sec; 19 | 20 | [NativeTypeName("uint64_t")] 21 | public ulong timestamp; 22 | 23 | public unsafe partial struct _data_e__FixedBuffer 24 | { 25 | public byte* e0; 26 | public byte* e1; 27 | public byte* e2; 28 | public byte* e3; 29 | public byte* e4; 30 | public byte* e5; 31 | public byte* e6; 32 | public byte* e7; 33 | 34 | public ref byte* this[int index] 35 | { 36 | get 37 | { 38 | fixed (byte** pThis = &e0) 39 | { 40 | return ref pThis[index]; 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsBmem.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsBmem 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void* bmalloc([NativeTypeName("size_t")] nuint size); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void* brealloc(void* ptr, [NativeTypeName("size_t")] nuint size); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void bfree(void* ptr); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern int base_get_alignment(); 18 | 19 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 20 | [return: NativeTypeName("long")] 21 | public static extern int bnum_allocs(); 22 | 23 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 24 | public static extern void* bmemdup([NativeTypeName("const void *")] void* ptr, [NativeTypeName("size_t")] nuint size); 25 | } 26 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsTextLookup.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsTextLookup 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("lookup_t *")] 9 | public static extern text_lookup* text_lookup_create([NativeTypeName("const char *")] sbyte* path); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | [return: NativeTypeName("bool")] 13 | public static extern byte text_lookup_add([NativeTypeName("lookup_t *")] text_lookup* lookup, [NativeTypeName("const char *")] sbyte* path); 14 | 15 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 16 | public static extern void text_lookup_destroy([NativeTypeName("lookup_t *")] text_lookup* lookup); 17 | 18 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 19 | [return: NativeTypeName("bool")] 20 | public static extern byte text_lookup_getstr([NativeTypeName("lookup_t *")] text_lookup* lookup, [NativeTypeName("const char *")] sbyte* lookup_val, [NativeTypeName("const char **")] sbyte** @out); 21 | } 22 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsEncoder.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsEncoder 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void obs_register_encoder_s([NativeTypeName("const struct obs_encoder_info *")] obs_encoder_info* info, [NativeTypeName("size_t")] nuint size); 9 | 10 | [NativeTypeName("#define OBS_ENCODER_CAP_DEPRECATED (1 << 0)")] 11 | public const int OBS_ENCODER_CAP_DEPRECATED = (1 << 0); 12 | 13 | [NativeTypeName("#define OBS_ENCODER_CAP_PASS_TEXTURE (1 << 1)")] 14 | public const int OBS_ENCODER_CAP_PASS_TEXTURE = (1 << 1); 15 | 16 | [NativeTypeName("#define OBS_ENCODER_CAP_DYN_BITRATE (1 << 2)")] 17 | public const int OBS_ENCODER_CAP_DYN_BITRATE = (1 << 2); 18 | 19 | [NativeTypeName("#define OBS_ENCODER_CAP_INTERNAL (1 << 3)")] 20 | public const int OBS_ENCODER_CAP_INTERNAL = (1 << 3); 21 | 22 | [NativeTypeName("#define OBS_ENCODER_CAP_ROI (1 << 4)")] 23 | public const int OBS_ENCODER_CAP_ROI = (1 << 4); 24 | 25 | [NativeTypeName("#define OBS_ENCODER_CAP_SCALING (1 << 5)")] 26 | public const int OBS_ENCODER_CAP_SCALING = (1 << 5); 27 | } 28 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsAudioResampler.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsAudioResampler 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("audio_resampler_t *")] 9 | public static extern audio_resampler* audio_resampler_create([NativeTypeName("const struct resample_info *")] resample_info* dst, [NativeTypeName("const struct resample_info *")] resample_info* src); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | public static extern void audio_resampler_destroy([NativeTypeName("audio_resampler_t *")] audio_resampler* resampler); 13 | 14 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 15 | [return: NativeTypeName("bool")] 16 | public static extern byte audio_resampler_resample([NativeTypeName("audio_resampler_t *")] audio_resampler* resampler, [NativeTypeName("uint8_t *[]")] byte** output, [NativeTypeName("uint32_t *")] uint* out_frames, [NativeTypeName("uint64_t *")] ulong* ts_offset, [NativeTypeName("const uint8_t *const[]")] byte** input, [NativeTypeName("uint32_t")] uint in_frames); 17 | } 18 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_image_file.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct gs_image_file 4 | { 5 | [NativeTypeName("gs_texture_t *")] 6 | public gs_texture* texture; 7 | 8 | [NativeTypeName("enum gs_color_format")] 9 | public gs_color_format format; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint cx; 13 | 14 | [NativeTypeName("uint32_t")] 15 | public uint cy; 16 | 17 | [NativeTypeName("bool")] 18 | public byte is_animated_gif; 19 | 20 | [NativeTypeName("bool")] 21 | public byte frame_updated; 22 | 23 | [NativeTypeName("bool")] 24 | public byte loaded; 25 | 26 | public gif_animation gif; 27 | 28 | [NativeTypeName("uint8_t *")] 29 | public byte* gif_data; 30 | 31 | [NativeTypeName("uint8_t **")] 32 | public byte** animation_frame_cache; 33 | 34 | [NativeTypeName("uint8_t *")] 35 | public byte* animation_frame_data; 36 | 37 | [NativeTypeName("uint64_t")] 38 | public ulong cur_time; 39 | 40 | public int cur_frame; 41 | 42 | public int cur_loop; 43 | 44 | public int last_decoded_frame; 45 | 46 | [NativeTypeName("uint8_t *")] 47 | public byte* texture_data; 48 | 49 | public gif_bitmap_callback_vt bitmap_callbacks; 50 | } 51 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsProc.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsProc 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("proc_handler_t *")] 9 | public static extern proc_handler* proc_handler_create(); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | public static extern void proc_handler_destroy([NativeTypeName("proc_handler_t *")] proc_handler* handler); 13 | 14 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 15 | public static extern void proc_handler_add([NativeTypeName("proc_handler_t *")] proc_handler* handler, [NativeTypeName("const char *")] sbyte* decl_string, [NativeTypeName("proc_handler_proc_t")] delegate* unmanaged[Cdecl] proc, void* data); 16 | 17 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 18 | [return: NativeTypeName("bool")] 19 | public static extern byte proc_handler_call([NativeTypeName("proc_handler_t *")] proc_handler* handler, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("calldata_t *")] calldata* @params); 20 | } 21 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsBase.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsBase 6 | { 7 | public const int LOG_ERROR = 100; 8 | public const int LOG_WARNING = 200; 9 | public const int LOG_INFO = 300; 10 | public const int LOG_DEBUG = 400; 11 | 12 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 13 | public static extern void base_get_log_handler([NativeTypeName("log_handler_t *")] delegate* unmanaged[Cdecl]* handler, void** param1); 14 | 15 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 16 | public static extern void base_set_log_handler([NativeTypeName("log_handler_t")] delegate* unmanaged[Cdecl] handler, void* param1); 17 | 18 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 19 | public static extern void base_set_crash_handler([NativeTypeName("void (*)(const char *, va_list, void *)")] delegate* unmanaged[Cdecl] handler, void* param1); 20 | 21 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 22 | public static extern void bcrash([NativeTypeName("const char *")] sbyte* format, __arglist); 23 | } 24 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_effect_param_array_t.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | [StructLayout(LayoutKind.Explicit)] 7 | public unsafe partial struct gs_effect_param_array_t 8 | { 9 | [FieldOffset(0)] 10 | [NativeTypeName("struct darray")] 11 | public darray da; 12 | 13 | [FieldOffset(0)] 14 | [NativeTypeName("__AnonymousRecord_effect_L27_C9")] 15 | public _Anonymous_e__Struct Anonymous; 16 | 17 | [UnscopedRef] 18 | public ref gs_effect_param* array 19 | { 20 | get 21 | { 22 | return ref Anonymous.array; 23 | } 24 | } 25 | 26 | [UnscopedRef] 27 | public ref nuint num 28 | { 29 | get 30 | { 31 | return ref Anonymous.num; 32 | } 33 | } 34 | 35 | [UnscopedRef] 36 | public ref nuint capacity 37 | { 38 | get 39 | { 40 | return ref Anonymous.capacity; 41 | } 42 | } 43 | 44 | public unsafe partial struct _Anonymous_e__Struct 45 | { 46 | [NativeTypeName("struct gs_effect_param *")] 47 | public gs_effect_param* array; 48 | 49 | [NativeTypeName("size_t")] 50 | public nuint num; 51 | 52 | [NativeTypeName("size_t")] 53 | public nuint capacity; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/pass_shaderparam_array_t.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | [StructLayout(LayoutKind.Explicit)] 7 | public unsafe partial struct pass_shaderparam_array_t 8 | { 9 | [FieldOffset(0)] 10 | [NativeTypeName("struct darray")] 11 | public darray da; 12 | 13 | [FieldOffset(0)] 14 | [NativeTypeName("__AnonymousRecord_effect_L28_C9")] 15 | public _Anonymous_e__Struct Anonymous; 16 | 17 | [UnscopedRef] 18 | public ref pass_shaderparam* array 19 | { 20 | get 21 | { 22 | return ref Anonymous.array; 23 | } 24 | } 25 | 26 | [UnscopedRef] 27 | public ref nuint num 28 | { 29 | get 30 | { 31 | return ref Anonymous.num; 32 | } 33 | } 34 | 35 | [UnscopedRef] 36 | public ref nuint capacity 37 | { 38 | get 39 | { 40 | return ref Anonymous.capacity; 41 | } 42 | } 43 | 44 | public unsafe partial struct _Anonymous_e__Struct 45 | { 46 | [NativeTypeName("struct pass_shaderparam *")] 47 | public pass_shaderparam* array; 48 | 49 | [NativeTypeName("size_t")] 50 | public nuint num; 51 | 52 | [NativeTypeName("size_t")] 53 | public nuint capacity; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/profiler_time_entries_t.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | [StructLayout(LayoutKind.Explicit)] 7 | public unsafe partial struct profiler_time_entries_t 8 | { 9 | [FieldOffset(0)] 10 | [NativeTypeName("struct darray")] 11 | public darray da; 12 | 13 | [FieldOffset(0)] 14 | [NativeTypeName("__AnonymousRecord_profiler_L62_C9")] 15 | public _Anonymous_e__Struct Anonymous; 16 | 17 | [UnscopedRef] 18 | public ref profiler_time_entry* array 19 | { 20 | get 21 | { 22 | return ref Anonymous.array; 23 | } 24 | } 25 | 26 | [UnscopedRef] 27 | public ref nuint num 28 | { 29 | get 30 | { 31 | return ref Anonymous.num; 32 | } 33 | } 34 | 35 | [UnscopedRef] 36 | public ref nuint capacity 37 | { 38 | get 39 | { 40 | return ref Anonymous.capacity; 41 | } 42 | } 43 | 44 | public unsafe partial struct _Anonymous_e__Struct 45 | { 46 | [NativeTypeName("profiler_time_entry_t *")] 47 | public profiler_time_entry* array; 48 | 49 | [NativeTypeName("size_t")] 50 | public nuint num; 51 | 52 | [NativeTypeName("size_t")] 53 | public nuint capacity; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsCalldata.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsCalldata 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("bool")] 9 | public static extern byte calldata_get_data([NativeTypeName("const calldata_t *")] calldata* data, [NativeTypeName("const char *")] sbyte* name, void* @out, [NativeTypeName("size_t")] nuint size); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | public static extern void calldata_set_data([NativeTypeName("calldata_t *")] calldata* data, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const void *")] void* @in, [NativeTypeName("size_t")] nuint new_size); 13 | 14 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 15 | [return: NativeTypeName("bool")] 16 | public static extern byte calldata_get_string([NativeTypeName("const calldata_t *")] calldata* data, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char **")] sbyte** str); 17 | 18 | [NativeTypeName("#define CALL_PARAM_IN (1 << 0)")] 19 | public const int CALL_PARAM_IN = (1 << 0); 20 | 21 | [NativeTypeName("#define CALL_PARAM_OUT (1 << 1)")] 22 | public const int CALL_PARAM_OUT = (1 << 1); 23 | } 24 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/ObsBmem.Manual.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsBmem 6 | { 7 | /// 8 | /// Allocates a chunk of unmanaged OBS memory with size= 9 | /// 10 | public static T* bzalloc() 11 | where T: unmanaged 12 | { 13 | var size = Marshal.SizeOf(); 14 | return (T*) bzalloc((nuint) size); 15 | } 16 | 17 | public static void* bzalloc(nuint size) 18 | { 19 | var mem = bmalloc(size); 20 | 21 | if (mem != null) 22 | { 23 | var span = new Span(mem, (int)size); 24 | span.Clear(); 25 | } 26 | 27 | return mem; 28 | } 29 | 30 | public static sbyte* bstrdup_n(sbyte* str, nuint n) 31 | { 32 | if (str == null) 33 | return null; 34 | 35 | var dup = (sbyte *)bmemdup(str, n + 1); 36 | dup[n] = 0; 37 | 38 | return dup; 39 | } 40 | 41 | public static sbyte *bstrdup(sbyte *str) 42 | { 43 | if (str == null) 44 | return null; 45 | 46 | return bstrdup_n(str, strlen(str)); 47 | } 48 | 49 | private static nuint strlen(sbyte* str) 50 | { 51 | sbyte *searchCharacter; 52 | 53 | for (searchCharacter = str; *searchCharacter != 0; ++searchCharacter) ; 54 | 55 | return (nuint) (searchCharacter - str); 56 | } 57 | } -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsVideoScaler.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsVideoScaler 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern int video_scaler_create([NativeTypeName("video_scaler_t **")] video_scaler** scaler, [NativeTypeName("const struct video_scale_info *")] video_scale_info* dst, [NativeTypeName("const struct video_scale_info *")] video_scale_info* src, [NativeTypeName("enum video_scale_type")] video_scale_type type); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void video_scaler_destroy([NativeTypeName("video_scaler_t *")] video_scaler* scaler); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | [return: NativeTypeName("bool")] 15 | public static extern byte video_scaler_scale([NativeTypeName("video_scaler_t *")] video_scaler* scaler, [NativeTypeName("uint8_t *[]")] byte** output, [NativeTypeName("const uint32_t[]")] uint* out_linesize, [NativeTypeName("const uint8_t *const[]")] byte** input, [NativeTypeName("const uint32_t[]")] uint* in_linesize); 16 | 17 | [NativeTypeName("#define VIDEO_SCALER_SUCCESS 0")] 18 | public const int VIDEO_SCALER_SUCCESS = 0; 19 | 20 | [NativeTypeName("#define VIDEO_SCALER_BAD_CONVERSION -1")] 21 | public const int VIDEO_SCALER_BAD_CONVERSION = -1; 22 | 23 | [NativeTypeName("#define VIDEO_SCALER_FAILED -2")] 24 | public const int VIDEO_SCALER_FAILED = -2; 25 | } 26 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_frontend_source_list.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | public partial struct obs_frontend_source_list 7 | { 8 | [NativeTypeName("__AnonymousRecord_obs-frontend-api_L75_C2")] 9 | public _sources_e__Union sources; 10 | 11 | [StructLayout(LayoutKind.Explicit)] 12 | public unsafe partial struct _sources_e__Union 13 | { 14 | [FieldOffset(0)] 15 | [NativeTypeName("struct darray")] 16 | public darray da; 17 | 18 | [FieldOffset(0)] 19 | [NativeTypeName("__AnonymousRecord_obs-frontend-api_L75_C2")] 20 | public _Anonymous_e__Struct Anonymous; 21 | 22 | [UnscopedRef] 23 | public ref obs_source** array 24 | { 25 | get 26 | { 27 | return ref Anonymous.array; 28 | } 29 | } 30 | 31 | [UnscopedRef] 32 | public ref nuint num 33 | { 34 | get 35 | { 36 | return ref Anonymous.num; 37 | } 38 | } 39 | 40 | [UnscopedRef] 41 | public ref nuint capacity 42 | { 43 | get 44 | { 45 | return ref Anonymous.capacity; 46 | } 47 | } 48 | 49 | public unsafe partial struct _Anonymous_e__Struct 50 | { 51 | [NativeTypeName("obs_source_t **")] 52 | public obs_source** array; 53 | 54 | [NativeTypeName("size_t")] 55 | public nuint num; 56 | 57 | [NativeTypeName("size_t")] 58 | public nuint capacity; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_frontend_canvas_list.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | public partial struct obs_frontend_canvas_list 7 | { 8 | [NativeTypeName("__AnonymousRecord_obs-frontend-api_L87_C2")] 9 | public _canvases_e__Union canvases; 10 | 11 | [StructLayout(LayoutKind.Explicit)] 12 | public unsafe partial struct _canvases_e__Union 13 | { 14 | [FieldOffset(0)] 15 | [NativeTypeName("struct darray")] 16 | public darray da; 17 | 18 | [FieldOffset(0)] 19 | [NativeTypeName("__AnonymousRecord_obs-frontend-api_L87_C2")] 20 | public _Anonymous_e__Struct Anonymous; 21 | 22 | [UnscopedRef] 23 | public ref obs_canvas** array 24 | { 25 | get 26 | { 27 | return ref Anonymous.array; 28 | } 29 | } 30 | 31 | [UnscopedRef] 32 | public ref nuint num 33 | { 34 | get 35 | { 36 | return ref Anonymous.num; 37 | } 38 | } 39 | 40 | [UnscopedRef] 41 | public ref nuint capacity 42 | { 43 | get 44 | { 45 | return ref Anonymous.capacity; 46 | } 47 | } 48 | 49 | public unsafe partial struct _Anonymous_e__Struct 50 | { 51 | [NativeTypeName("obs_canvas_t **")] 52 | public obs_canvas** array; 53 | 54 | [NativeTypeName("size_t")] 55 | public nuint num; 56 | 57 | [NativeTypeName("size_t")] 58 | public nuint capacity; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /samples/SimplePlugin/ObsPlugin.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | using System.Text; 3 | using ObsInterop; 4 | 5 | namespace SimplePlugin; 6 | 7 | public static class ObsPlugin 8 | { 9 | private static nint _obsModulePointer; 10 | 11 | [UnmanagedCallersOnly(EntryPoint = "obs_module_set_pointer", CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] 12 | public static void SetPointer(nint obsModulePointer) 13 | { 14 | Log("Pointer Saved!"); 15 | _obsModulePointer = obsModulePointer; 16 | } 17 | 18 | [UnmanagedCallersOnly(EntryPoint = "obs_module_ver", CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] 19 | public static uint GetVersion() 20 | { 21 | Log("Returned version!"); 22 | 23 | var major = (uint) Obs.Version.Major; 24 | var minor = (uint) Obs.Version.Minor; 25 | var patch = (uint) Obs.Version.Build; 26 | var version = (major << 24) | (minor << 16) | patch; 27 | return version; 28 | } 29 | 30 | [UnmanagedCallersOnly(EntryPoint = "obs_module_load", CallConvs = new[] {typeof(System.Runtime.CompilerServices.CallConvCdecl)})] 31 | public static unsafe bool ModuleLoad() 32 | { 33 | Log("Loaded!"); 34 | 35 | var profilePath = ObsFrontendApi.obs_frontend_get_current_profile_path(); 36 | var name = new string(profilePath); 37 | Log($"Current profile path = {name}"); 38 | ObsBmem.bfree(profilePath); 39 | 40 | return true; 41 | } 42 | 43 | private static unsafe void Log(string text) 44 | { 45 | text = $"[ObsPlugin]: {text}"; 46 | var asciiBytes = Encoding.UTF8.GetBytes(text); 47 | fixed (byte* logMessagePtr = asciiBytes) 48 | { 49 | ObsBase.blog(ObsBase.LOG_INFO, (sbyte*) logMessagePtr); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_effect_technique.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | public unsafe partial struct gs_effect_technique 7 | { 8 | [NativeTypeName("char *")] 9 | public sbyte* name; 10 | 11 | [NativeTypeName("enum effect_section")] 12 | public effect_section section; 13 | 14 | [NativeTypeName("struct gs_effect *")] 15 | public gs_effect* effect; 16 | 17 | [NativeTypeName("__AnonymousRecord_effect_L126_C2")] 18 | public _passes_e__Union passes; 19 | 20 | [StructLayout(LayoutKind.Explicit)] 21 | public unsafe partial struct _passes_e__Union 22 | { 23 | [FieldOffset(0)] 24 | [NativeTypeName("struct darray")] 25 | public darray da; 26 | 27 | [FieldOffset(0)] 28 | [NativeTypeName("__AnonymousRecord_effect_L126_C2")] 29 | public _Anonymous_e__Struct Anonymous; 30 | 31 | [UnscopedRef] 32 | public ref gs_effect_pass* array 33 | { 34 | get 35 | { 36 | return ref Anonymous.array; 37 | } 38 | } 39 | 40 | [UnscopedRef] 41 | public ref nuint num 42 | { 43 | get 44 | { 45 | return ref Anonymous.num; 46 | } 47 | } 48 | 49 | [UnscopedRef] 50 | public ref nuint capacity 51 | { 52 | get 53 | { 54 | return ref Anonymous.capacity; 55 | } 56 | } 57 | 58 | public unsafe partial struct _Anonymous_e__Struct 59 | { 60 | [NativeTypeName("struct gs_effect_pass *")] 61 | public gs_effect_pass* array; 62 | 63 | [NativeTypeName("size_t")] 64 | public nuint num; 65 | 66 | [NativeTypeName("size_t")] 67 | public nuint capacity; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/axisang.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics.CodeAnalysis; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace ObsInterop; 7 | 8 | public partial struct axisang 9 | { 10 | [NativeTypeName("__AnonymousRecord_axisang_L29_C2")] 11 | public _Anonymous_e__Union Anonymous; 12 | 13 | [UnscopedRef] 14 | public ref float x 15 | { 16 | get 17 | { 18 | return ref Anonymous.Anonymous.x; 19 | } 20 | } 21 | 22 | [UnscopedRef] 23 | public ref float y 24 | { 25 | get 26 | { 27 | return ref Anonymous.Anonymous.y; 28 | } 29 | } 30 | 31 | [UnscopedRef] 32 | public ref float z 33 | { 34 | get 35 | { 36 | return ref Anonymous.Anonymous.z; 37 | } 38 | } 39 | 40 | [UnscopedRef] 41 | public ref float w 42 | { 43 | get 44 | { 45 | return ref Anonymous.Anonymous.w; 46 | } 47 | } 48 | 49 | [UnscopedRef] 50 | public Span ptr 51 | { 52 | get 53 | { 54 | return Anonymous.ptr; 55 | } 56 | } 57 | 58 | [StructLayout(LayoutKind.Explicit)] 59 | public partial struct _Anonymous_e__Union 60 | { 61 | [FieldOffset(0)] 62 | [NativeTypeName("__AnonymousRecord_axisang_L30_C3")] 63 | public _Anonymous_e__Struct Anonymous; 64 | 65 | [FieldOffset(0)] 66 | [NativeTypeName("float[4]")] 67 | public _ptr_e__FixedBuffer ptr; 68 | 69 | public partial struct _Anonymous_e__Struct 70 | { 71 | public float x; 72 | 73 | public float y; 74 | 75 | public float z; 76 | 77 | public float w; 78 | } 79 | 80 | [InlineArray(4)] 81 | public partial struct _ptr_e__FixedBuffer 82 | { 83 | public float e0; 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsMathExtra.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsMathExtra 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void polar_to_cart([NativeTypeName("struct vec3 *")] System.Numerics.Vector3* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void cart_to_polar([NativeTypeName("struct vec3 *")] System.Numerics.Vector3* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void norm_to_polar([NativeTypeName("struct vec2 *")] System.Numerics.Vector2* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* norm); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern void polar_to_norm([NativeTypeName("struct vec3 *")] System.Numerics.Vector3* dst, [NativeTypeName("const struct vec2 *")] System.Numerics.Vector2* polar); 18 | 19 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 20 | public static extern float calc_torquef(float val1, float val2, float torque, float min_adjust, float t); 21 | 22 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 23 | public static extern void calc_torque([NativeTypeName("struct vec3 *")] System.Numerics.Vector3* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v1, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v2, float torque, float min_adjust, float t); 24 | 25 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 26 | public static extern float rand_float(int positive_only); 27 | } 28 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsOutput.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsOutput 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void obs_register_output_s([NativeTypeName("const struct obs_output_info *")] obs_output_info* info, [NativeTypeName("size_t")] nuint size); 9 | 10 | [NativeTypeName("#define OBS_OUTPUT_VIDEO (1 << 0)")] 11 | public const int OBS_OUTPUT_VIDEO = (1 << 0); 12 | 13 | [NativeTypeName("#define OBS_OUTPUT_AUDIO (1 << 1)")] 14 | public const int OBS_OUTPUT_AUDIO = (1 << 1); 15 | 16 | [NativeTypeName("#define OBS_OUTPUT_AV (OBS_OUTPUT_VIDEO | OBS_OUTPUT_AUDIO)")] 17 | public const int OBS_OUTPUT_AV = ((1 << 0) | (1 << 1)); 18 | 19 | [NativeTypeName("#define OBS_OUTPUT_ENCODED (1 << 2)")] 20 | public const int OBS_OUTPUT_ENCODED = (1 << 2); 21 | 22 | [NativeTypeName("#define OBS_OUTPUT_SERVICE (1 << 3)")] 23 | public const int OBS_OUTPUT_SERVICE = (1 << 3); 24 | 25 | [NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK (1 << 4)")] 26 | public const int OBS_OUTPUT_MULTI_TRACK = (1 << 4); 27 | 28 | [NativeTypeName("#define OBS_OUTPUT_CAN_PAUSE (1 << 5)")] 29 | public const int OBS_OUTPUT_CAN_PAUSE = (1 << 5); 30 | 31 | [NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK_AUDIO OBS_OUTPUT_MULTI_TRACK")] 32 | public const int OBS_OUTPUT_MULTI_TRACK_AUDIO = (1 << 4); 33 | 34 | [NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK_VIDEO (1 << 6)")] 35 | public const int OBS_OUTPUT_MULTI_TRACK_VIDEO = (1 << 6); 36 | 37 | [NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK_AV (OBS_OUTPUT_MULTI_TRACK_AUDIO | OBS_OUTPUT_MULTI_TRACK_VIDEO)")] 38 | public const int OBS_OUTPUT_MULTI_TRACK_AV = ((1 << 4) | (1 << 6)); 39 | 40 | [NativeTypeName("#define MAX_OUTPUT_AUDIO_ENCODERS 6")] 41 | public const int MAX_OUTPUT_AUDIO_ENCODERS = 6; 42 | 43 | [NativeTypeName("#define MAX_OUTPUT_VIDEO_ENCODERS 10")] 44 | public const int MAX_OUTPUT_VIDEO_ENCODERS = 10; 45 | } 46 | -------------------------------------------------------------------------------- /NetObsBindings/NetObsBindings.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Library 5 | net9.0 6 | enable 7 | enable 8 | 9 | true 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 32.0.0.0 17 | 18 | LICENSE.md 19 | https://github.com/kostya9/NetObsBindings 20 | NetObsBindings 21 | true 22 | https://github.com/kostya9/NetObsBindings.git 23 | git 24 | embedded 25 | true 26 | 27 | 28 | 29 | NetObsBindings contain OBS bindings for .NET apps 30 | README.md 31 | NetObsBindings contain OBS bindings for .NET apps 32 | Kostiantyn Sharovarskyi 33 | en-US 34 | Kostiantyn Sharovarskyi 35 | obs;bindings 36 | true 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | true 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_frontend_event.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public enum obs_frontend_event 4 | { 5 | OBS_FRONTEND_EVENT_STREAMING_STARTING, 6 | OBS_FRONTEND_EVENT_STREAMING_STARTED, 7 | OBS_FRONTEND_EVENT_STREAMING_STOPPING, 8 | OBS_FRONTEND_EVENT_STREAMING_STOPPED, 9 | OBS_FRONTEND_EVENT_RECORDING_STARTING, 10 | OBS_FRONTEND_EVENT_RECORDING_STARTED, 11 | OBS_FRONTEND_EVENT_RECORDING_STOPPING, 12 | OBS_FRONTEND_EVENT_RECORDING_STOPPED, 13 | OBS_FRONTEND_EVENT_SCENE_CHANGED, 14 | OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED, 15 | OBS_FRONTEND_EVENT_TRANSITION_CHANGED, 16 | OBS_FRONTEND_EVENT_TRANSITION_STOPPED, 17 | OBS_FRONTEND_EVENT_TRANSITION_LIST_CHANGED, 18 | OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGED, 19 | OBS_FRONTEND_EVENT_SCENE_COLLECTION_LIST_CHANGED, 20 | OBS_FRONTEND_EVENT_PROFILE_CHANGED, 21 | OBS_FRONTEND_EVENT_PROFILE_LIST_CHANGED, 22 | OBS_FRONTEND_EVENT_EXIT, 23 | OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTING, 24 | OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTED, 25 | OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPING, 26 | OBS_FRONTEND_EVENT_REPLAY_BUFFER_STOPPED, 27 | OBS_FRONTEND_EVENT_STUDIO_MODE_ENABLED, 28 | OBS_FRONTEND_EVENT_STUDIO_MODE_DISABLED, 29 | OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED, 30 | OBS_FRONTEND_EVENT_SCENE_COLLECTION_CLEANUP, 31 | OBS_FRONTEND_EVENT_FINISHED_LOADING, 32 | OBS_FRONTEND_EVENT_RECORDING_PAUSED, 33 | OBS_FRONTEND_EVENT_RECORDING_UNPAUSED, 34 | OBS_FRONTEND_EVENT_TRANSITION_DURATION_CHANGED, 35 | OBS_FRONTEND_EVENT_REPLAY_BUFFER_SAVED, 36 | OBS_FRONTEND_EVENT_VIRTUALCAM_STARTED, 37 | OBS_FRONTEND_EVENT_VIRTUALCAM_STOPPED, 38 | OBS_FRONTEND_EVENT_TBAR_VALUE_CHANGED, 39 | OBS_FRONTEND_EVENT_SCENE_COLLECTION_CHANGING, 40 | OBS_FRONTEND_EVENT_PROFILE_CHANGING, 41 | OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN, 42 | OBS_FRONTEND_EVENT_PROFILE_RENAMED, 43 | OBS_FRONTEND_EVENT_SCENE_COLLECTION_RENAMED, 44 | OBS_FRONTEND_EVENT_THEME_CHANGED, 45 | OBS_FRONTEND_EVENT_SCREENSHOT_TAKEN, 46 | OBS_FRONTEND_EVENT_CANVAS_ADDED, 47 | OBS_FRONTEND_EVENT_CANVAS_REMOVED, 48 | } 49 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_frame2.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct obs_source_frame2 6 | { 7 | [NativeTypeName("uint8_t *[8]")] 8 | public _data_e__FixedBuffer data; 9 | 10 | [NativeTypeName("uint32_t[8]")] 11 | public _linesize_e__FixedBuffer linesize; 12 | 13 | [NativeTypeName("uint32_t")] 14 | public uint width; 15 | 16 | [NativeTypeName("uint32_t")] 17 | public uint height; 18 | 19 | [NativeTypeName("uint64_t")] 20 | public ulong timestamp; 21 | 22 | [NativeTypeName("enum video_format")] 23 | public video_format format; 24 | 25 | [NativeTypeName("enum video_range_type")] 26 | public video_range_type range; 27 | 28 | [NativeTypeName("float[16]")] 29 | public _color_matrix_e__FixedBuffer color_matrix; 30 | 31 | [NativeTypeName("float[3]")] 32 | public _color_range_min_e__FixedBuffer color_range_min; 33 | 34 | [NativeTypeName("float[3]")] 35 | public _color_range_max_e__FixedBuffer color_range_max; 36 | 37 | [NativeTypeName("bool")] 38 | public byte flip; 39 | 40 | [NativeTypeName("uint8_t")] 41 | public byte flags; 42 | 43 | [NativeTypeName("uint8_t")] 44 | public byte trc; 45 | 46 | public unsafe partial struct _data_e__FixedBuffer 47 | { 48 | public byte* e0; 49 | public byte* e1; 50 | public byte* e2; 51 | public byte* e3; 52 | public byte* e4; 53 | public byte* e5; 54 | public byte* e6; 55 | public byte* e7; 56 | 57 | public ref byte* this[int index] 58 | { 59 | get 60 | { 61 | fixed (byte** pThis = &e0) 62 | { 63 | return ref pThis[index]; 64 | } 65 | } 66 | } 67 | } 68 | 69 | [InlineArray(8)] 70 | public partial struct _linesize_e__FixedBuffer 71 | { 72 | public uint e0; 73 | } 74 | 75 | [InlineArray(16)] 76 | public partial struct _color_matrix_e__FixedBuffer 77 | { 78 | public float e0; 79 | } 80 | 81 | [InlineArray(3)] 82 | public partial struct _color_range_min_e__FixedBuffer 83 | { 84 | public float e0; 85 | } 86 | 87 | [InlineArray(3)] 88 | public partial struct _color_range_max_e__FixedBuffer 89 | { 90 | public float e0; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /NetObsBindings.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetObsBindings", "NetObsBindings\NetObsBindings.csproj", "{EC55055C-1D4C-416E-AEA2-A670318CBAB6}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1AD2D6FC-CBDF-4EC6-961C-F86A4F42FEFF}" 9 | ProjectSection(SolutionItems) = preProject 10 | .gitignore = .gitignore 11 | build.ps1 = build.ps1 12 | generate_bindings.ps1 = generate_bindings.ps1 13 | init_obs.ps1 = init_obs.ps1 14 | LICENSE.md = LICENSE.md 15 | NetObsBindings.sln = NetObsBindings.sln 16 | README.md = README.md 17 | replace_version.ps1 = replace_version.ps1 18 | .github\workflows\publish.yml = .github\workflows\publish.yml 19 | EndProjectSection 20 | EndProject 21 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{CB52F2D4-B942-4FA6-9B6A-68648BC9C8CC}" 22 | EndProject 23 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimplePlugin", "samples\SimplePlugin\SimplePlugin.csproj", "{4610909C-7B78-4828-A747-28F2A653B998}" 24 | EndProject 25 | Global 26 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 27 | Debug|Any CPU = Debug|Any CPU 28 | Release|Any CPU = Release|Any CPU 29 | EndGlobalSection 30 | GlobalSection(SolutionProperties) = preSolution 31 | HideSolutionNode = FALSE 32 | EndGlobalSection 33 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 34 | {EC55055C-1D4C-416E-AEA2-A670318CBAB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {EC55055C-1D4C-416E-AEA2-A670318CBAB6}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {EC55055C-1D4C-416E-AEA2-A670318CBAB6}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {EC55055C-1D4C-416E-AEA2-A670318CBAB6}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {4610909C-7B78-4828-A747-28F2A653B998}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {4610909C-7B78-4828-A747-28F2A653B998}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {4610909C-7B78-4828-A747-28F2A653B998}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {4610909C-7B78-4828-A747-28F2A653B998}.Release|Any CPU.Build.0 = Release|Any CPU 42 | EndGlobalSection 43 | GlobalSection(NestedProjects) = preSolution 44 | {4610909C-7B78-4828-A747-28F2A653B998} = {CB52F2D4-B942-4FA6-9B6A-68648BC9C8CC} 45 | EndGlobalSection 46 | EndGlobal 47 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_frame.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public partial struct obs_source_frame 6 | { 7 | [NativeTypeName("uint8_t *[8]")] 8 | public _data_e__FixedBuffer data; 9 | 10 | [NativeTypeName("uint32_t[8]")] 11 | public _linesize_e__FixedBuffer linesize; 12 | 13 | [NativeTypeName("uint32_t")] 14 | public uint width; 15 | 16 | [NativeTypeName("uint32_t")] 17 | public uint height; 18 | 19 | [NativeTypeName("uint64_t")] 20 | public ulong timestamp; 21 | 22 | [NativeTypeName("enum video_format")] 23 | public video_format format; 24 | 25 | [NativeTypeName("float[16]")] 26 | public _color_matrix_e__FixedBuffer color_matrix; 27 | 28 | [NativeTypeName("bool")] 29 | public byte full_range; 30 | 31 | [NativeTypeName("uint16_t")] 32 | public ushort max_luminance; 33 | 34 | [NativeTypeName("float[3]")] 35 | public _color_range_min_e__FixedBuffer color_range_min; 36 | 37 | [NativeTypeName("float[3]")] 38 | public _color_range_max_e__FixedBuffer color_range_max; 39 | 40 | [NativeTypeName("bool")] 41 | public byte flip; 42 | 43 | [NativeTypeName("uint8_t")] 44 | public byte flags; 45 | 46 | [NativeTypeName("uint8_t")] 47 | public byte trc; 48 | 49 | [NativeTypeName("volatile long")] 50 | public int refs; 51 | 52 | [NativeTypeName("bool")] 53 | public byte prev_frame; 54 | 55 | public unsafe partial struct _data_e__FixedBuffer 56 | { 57 | public byte* e0; 58 | public byte* e1; 59 | public byte* e2; 60 | public byte* e3; 61 | public byte* e4; 62 | public byte* e5; 63 | public byte* e6; 64 | public byte* e7; 65 | 66 | public ref byte* this[int index] 67 | { 68 | get 69 | { 70 | fixed (byte** pThis = &e0) 71 | { 72 | return ref pThis[index]; 73 | } 74 | } 75 | } 76 | } 77 | 78 | [InlineArray(8)] 79 | public partial struct _linesize_e__FixedBuffer 80 | { 81 | public uint e0; 82 | } 83 | 84 | [InlineArray(16)] 85 | public partial struct _color_matrix_e__FixedBuffer 86 | { 87 | public float e0; 88 | } 89 | 90 | [InlineArray(3)] 91 | public partial struct _color_range_min_e__FixedBuffer 92 | { 93 | public float e0; 94 | } 95 | 96 | [InlineArray(3)] 97 | public partial struct _color_range_max_e__FixedBuffer 98 | { 99 | public float e0; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsFormatConversion.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsFormatConversion 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void compress_uyvx_to_i420([NativeTypeName("const uint8_t *")] byte* input, [NativeTypeName("uint32_t")] uint in_linesize, [NativeTypeName("uint32_t")] uint start_y, [NativeTypeName("uint32_t")] uint end_y, [NativeTypeName("uint8_t *[]")] byte** output, [NativeTypeName("const uint32_t[]")] uint* out_linesize); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void compress_uyvx_to_nv12([NativeTypeName("const uint8_t *")] byte* input, [NativeTypeName("uint32_t")] uint in_linesize, [NativeTypeName("uint32_t")] uint start_y, [NativeTypeName("uint32_t")] uint end_y, [NativeTypeName("uint8_t *[]")] byte** output, [NativeTypeName("const uint32_t[]")] uint* out_linesize); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void convert_uyvx_to_i444([NativeTypeName("const uint8_t *")] byte* input, [NativeTypeName("uint32_t")] uint in_linesize, [NativeTypeName("uint32_t")] uint start_y, [NativeTypeName("uint32_t")] uint end_y, [NativeTypeName("uint8_t *[]")] byte** output, [NativeTypeName("const uint32_t[]")] uint* out_linesize); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern void decompress_nv12([NativeTypeName("const uint8_t *const[]")] byte** input, [NativeTypeName("const uint32_t[]")] uint* in_linesize, [NativeTypeName("uint32_t")] uint start_y, [NativeTypeName("uint32_t")] uint end_y, [NativeTypeName("uint8_t *")] byte* output, [NativeTypeName("uint32_t")] uint out_linesize); 18 | 19 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 20 | public static extern void decompress_420([NativeTypeName("const uint8_t *const[]")] byte** input, [NativeTypeName("const uint32_t[]")] uint* in_linesize, [NativeTypeName("uint32_t")] uint start_y, [NativeTypeName("uint32_t")] uint end_y, [NativeTypeName("uint8_t *")] byte* output, [NativeTypeName("uint32_t")] uint out_linesize); 21 | 22 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 23 | public static extern void decompress_422([NativeTypeName("const uint8_t *")] byte* input, [NativeTypeName("uint32_t")] uint in_linesize, [NativeTypeName("uint32_t")] uint start_y, [NativeTypeName("uint32_t")] uint end_y, [NativeTypeName("uint8_t *")] byte* output, [NativeTypeName("uint32_t")] uint out_linesize, [NativeTypeName("bool")] byte leading_lum); 24 | } 25 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsPlane.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsPlane 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void plane_from_tri([NativeTypeName("struct plane *")] plane* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v1, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v2, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v3); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void plane_transform([NativeTypeName("struct plane *")] plane* dst, [NativeTypeName("const struct plane *")] plane* p, [NativeTypeName("const struct matrix4 *")] matrix4* m); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void plane_transform3x4([NativeTypeName("struct plane *")] plane* dst, [NativeTypeName("const struct plane *")] plane* p, [NativeTypeName("const struct matrix3 *")] matrix3* m); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | [return: NativeTypeName("bool")] 18 | public static extern byte plane_intersection_ray([NativeTypeName("const struct plane *")] plane* p, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* orig, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* dir, float* t); 19 | 20 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 21 | [return: NativeTypeName("bool")] 22 | public static extern byte plane_intersection_line([NativeTypeName("const struct plane *")] plane* p, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v1, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v2, float* t); 23 | 24 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 25 | [return: NativeTypeName("bool")] 26 | public static extern byte plane_tri_inside([NativeTypeName("const struct plane *")] plane* p, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v1, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v2, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v3, float precision); 27 | 28 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 29 | [return: NativeTypeName("bool")] 30 | public static extern byte plane_line_inside([NativeTypeName("const struct plane *")] plane* p, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v1, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v2, float precision); 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NetObsBindings 2 | 3 | [![NuGet version (NetObsBindings)](https://img.shields.io/nuget/v/NetObsBindings.svg?style=flat-square)](https://www.nuget.org/packages/NetObsBindings/) 4 | 5 | NetObsBindings is a library that provides .NET bindings for Open Broadcaster Software (OBS). 6 | 7 | These bindings are generated from the OBS repository, specifically [libobs](https://github.com/obsproject/obs-studio/tree/master/libobs) and [obs-frontend](https://github.com/obsproject/obs-studio/tree/master/UI/obs-frontend-api) projects. 8 | 9 | The approach taken is to generate a static class per header file via [ClangSharp](https://github.com/dotnet/ClangSharp) generator. 10 | This means, that, for example, you could find functions exported from the [obs-service.h](https://github.com/obsproject/obs-studio/blob/master/libobs/obs-service.h) file in the [ObsService](https://github.com/kostya9/NetObsBindings/blob/main/NetObsBindings/ObsInterop/ObsService.cs) C# class. 11 | 12 | ## How to use these bindings? 13 | 14 | These bindings can be used to create your own plugin in C#. There is one caveat: make sure you are publishing the plugins as NativeAOT libraries, this is essential to make it work due to the plugin model of OBS. 15 | 16 | Examples: 17 | - samples folder contains a [simple plugin example](https://github.com/kostya9/NetObsBindings/blob/main/samples/SimplePlugin/ObsPlugin.cs). 18 | - more comprehensive example - [ObsCSharpExample](https://github.com/YorVeX/ObsCSharpExample) by [@YorVeX](https://github.com/YorVeX) 19 | > Example for an OBS plugin written in C# containing various standard items like output, filter, source or a settings dialog in the OBS Tools menu. 20 | 21 | 22 | Plugins made using this library: 23 | - [xObsBrowserAutoRefresh](https://github.com/YorVeX/xObsBrowserAutoRefresh) by [@YorVeX](https://github.com/YorVeX) 24 | > OBS plugin providing a filter for automatically refreshing a browser source in a configurable interval. 25 | 26 | 27 | 28 | --- 29 | 30 | ## How to generate bindings locally? 31 | 32 | In order to generate bindings locally, please use the [build.ps1](https://github.com/kostya9/NetObsBindings/blob/main/build.ps1) script. Make sure that you have ClangSharpPInvokeGenerator dotnet tool installed. 33 | 34 | This script will: 35 | 1. Clone the OBS repository 36 | 2. Generate bindings for all required modules 37 | 3. Insert the version of the OBS library to [Obs.Version.cs](https://github.com/kostya9/NetObsBindings/blob/main/NetObsBindings/Obs.Version.cs) file. 38 | 39 | NB: to change the OBS version - modify the $GitTag variable in the ./init_obs.ps1 script. Also please update the package version to indicate the OBS version that it is generated from. 40 | E.g. 30.0.2.0 means that the bindings were generated from the OBS version 30.0.2. 41 | 42 | --- 43 | 44 | Originally, these bindings generated in the blog post https://sharovarskyi.com/blog/posts/clangsharp-dotnet-interop-bindings/ 45 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_effect.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | public unsafe partial struct gs_effect 7 | { 8 | [NativeTypeName("bool")] 9 | public byte processing; 10 | 11 | [NativeTypeName("bool")] 12 | public byte cached; 13 | 14 | [NativeTypeName("char *")] 15 | public sbyte* effect_path; 16 | 17 | [NativeTypeName("char *")] 18 | public sbyte* effect_dir; 19 | 20 | public gs_effect_param_array_t @params; 21 | 22 | [NativeTypeName("__AnonymousRecord_effect_L152_C2")] 23 | public _techniques_e__Union techniques; 24 | 25 | [NativeTypeName("struct gs_effect_technique *")] 26 | public gs_effect_technique* cur_technique; 27 | 28 | [NativeTypeName("struct gs_effect_pass *")] 29 | public gs_effect_pass* cur_pass; 30 | 31 | [NativeTypeName("gs_eparam_t *")] 32 | public gs_effect_param* view_proj; 33 | 34 | [NativeTypeName("gs_eparam_t *")] 35 | public gs_effect_param* world; 36 | 37 | [NativeTypeName("gs_eparam_t *")] 38 | public gs_effect_param* scale; 39 | 40 | [NativeTypeName("graphics_t *")] 41 | public graphics_subsystem* graphics; 42 | 43 | [NativeTypeName("struct gs_effect *")] 44 | public gs_effect* next; 45 | 46 | [NativeTypeName("size_t")] 47 | public nuint loop_pass; 48 | 49 | [NativeTypeName("bool")] 50 | public byte looping; 51 | 52 | [StructLayout(LayoutKind.Explicit)] 53 | public unsafe partial struct _techniques_e__Union 54 | { 55 | [FieldOffset(0)] 56 | [NativeTypeName("struct darray")] 57 | public darray da; 58 | 59 | [FieldOffset(0)] 60 | [NativeTypeName("__AnonymousRecord_effect_L152_C2")] 61 | public _Anonymous_e__Struct Anonymous; 62 | 63 | [UnscopedRef] 64 | public ref gs_effect_technique* array 65 | { 66 | get 67 | { 68 | return ref Anonymous.array; 69 | } 70 | } 71 | 72 | [UnscopedRef] 73 | public ref nuint num 74 | { 75 | get 76 | { 77 | return ref Anonymous.num; 78 | } 79 | } 80 | 81 | [UnscopedRef] 82 | public ref nuint capacity 83 | { 84 | get 85 | { 86 | return ref Anonymous.capacity; 87 | } 88 | } 89 | 90 | public unsafe partial struct _Anonymous_e__Struct 91 | { 92 | [NativeTypeName("struct gs_effect_technique *")] 93 | public gs_effect_technique* array; 94 | 95 | [NativeTypeName("size_t")] 96 | public nuint num; 97 | 98 | [NativeTypeName("size_t")] 99 | public nuint capacity; 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_output_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_output_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* id; 7 | 8 | [NativeTypeName("uint32_t")] 9 | public uint flags; 10 | 11 | [NativeTypeName("const char *(*)(void *)")] 12 | public delegate* unmanaged[Cdecl] get_name; 13 | 14 | [NativeTypeName("void *(*)(obs_data_t *, obs_output_t *)")] 15 | public delegate* unmanaged[Cdecl] create; 16 | 17 | [NativeTypeName("void (*)(void *)")] 18 | public delegate* unmanaged[Cdecl] destroy; 19 | 20 | [NativeTypeName("bool (*)(void *)")] 21 | public delegate* unmanaged[Cdecl] start; 22 | 23 | [NativeTypeName("void (*)(void *, uint64_t)")] 24 | public delegate* unmanaged[Cdecl] stop; 25 | 26 | [NativeTypeName("void (*)(void *, struct video_data *)")] 27 | public delegate* unmanaged[Cdecl] raw_video; 28 | 29 | [NativeTypeName("void (*)(void *, struct audio_data *)")] 30 | public delegate* unmanaged[Cdecl] raw_audio; 31 | 32 | [NativeTypeName("void (*)(void *, struct encoder_packet *)")] 33 | public delegate* unmanaged[Cdecl] encoded_packet; 34 | 35 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 36 | public delegate* unmanaged[Cdecl] update; 37 | 38 | [NativeTypeName("void (*)(obs_data_t *)")] 39 | public delegate* unmanaged[Cdecl] get_defaults; 40 | 41 | [NativeTypeName("obs_properties_t *(*)(void *)")] 42 | public delegate* unmanaged[Cdecl] get_properties; 43 | 44 | [NativeTypeName("void (*)(void *)")] 45 | public delegate* unmanaged[Cdecl] unused1; 46 | 47 | [NativeTypeName("uint64_t (*)(void *)")] 48 | public delegate* unmanaged[Cdecl] get_total_bytes; 49 | 50 | [NativeTypeName("int (*)(void *)")] 51 | public delegate* unmanaged[Cdecl] get_dropped_frames; 52 | 53 | public void* type_data; 54 | 55 | [NativeTypeName("void (*)(void *)")] 56 | public delegate* unmanaged[Cdecl] free_type_data; 57 | 58 | [NativeTypeName("float (*)(void *)")] 59 | public delegate* unmanaged[Cdecl] get_congestion; 60 | 61 | [NativeTypeName("int (*)(void *)")] 62 | public delegate* unmanaged[Cdecl] get_connect_time_ms; 63 | 64 | [NativeTypeName("const char *")] 65 | public sbyte* encoded_video_codecs; 66 | 67 | [NativeTypeName("const char *")] 68 | public sbyte* encoded_audio_codecs; 69 | 70 | [NativeTypeName("void (*)(void *, size_t, struct audio_data *)")] 71 | public delegate* unmanaged[Cdecl] raw_audio2; 72 | 73 | [NativeTypeName("const char *")] 74 | public sbyte* protocols; 75 | } 76 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsSource.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsSource 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void obs_register_source_s([NativeTypeName("const struct obs_source_info *")] obs_source_info* info, [NativeTypeName("size_t")] nuint size); 9 | 10 | [NativeTypeName("#define OBS_SOURCE_VIDEO (1 << 0)")] 11 | public const int OBS_SOURCE_VIDEO = (1 << 0); 12 | 13 | [NativeTypeName("#define OBS_SOURCE_AUDIO (1 << 1)")] 14 | public const int OBS_SOURCE_AUDIO = (1 << 1); 15 | 16 | [NativeTypeName("#define OBS_SOURCE_ASYNC (1 << 2)")] 17 | public const int OBS_SOURCE_ASYNC = (1 << 2); 18 | 19 | [NativeTypeName("#define OBS_SOURCE_ASYNC_VIDEO (OBS_SOURCE_ASYNC | OBS_SOURCE_VIDEO)")] 20 | public const int OBS_SOURCE_ASYNC_VIDEO = ((1 << 2) | (1 << 0)); 21 | 22 | [NativeTypeName("#define OBS_SOURCE_CUSTOM_DRAW (1 << 3)")] 23 | public const int OBS_SOURCE_CUSTOM_DRAW = (1 << 3); 24 | 25 | [NativeTypeName("#define OBS_SOURCE_INTERACTION (1 << 5)")] 26 | public const int OBS_SOURCE_INTERACTION = (1 << 5); 27 | 28 | [NativeTypeName("#define OBS_SOURCE_COMPOSITE (1 << 6)")] 29 | public const int OBS_SOURCE_COMPOSITE = (1 << 6); 30 | 31 | [NativeTypeName("#define OBS_SOURCE_DO_NOT_DUPLICATE (1 << 7)")] 32 | public const int OBS_SOURCE_DO_NOT_DUPLICATE = (1 << 7); 33 | 34 | [NativeTypeName("#define OBS_SOURCE_DEPRECATED (1 << 8)")] 35 | public const int OBS_SOURCE_DEPRECATED = (1 << 8); 36 | 37 | [NativeTypeName("#define OBS_SOURCE_DO_NOT_SELF_MONITOR (1 << 9)")] 38 | public const int OBS_SOURCE_DO_NOT_SELF_MONITOR = (1 << 9); 39 | 40 | [NativeTypeName("#define OBS_SOURCE_CAP_DISABLED (1 << 10)")] 41 | public const int OBS_SOURCE_CAP_DISABLED = (1 << 10); 42 | 43 | [NativeTypeName("#define OBS_SOURCE_CAP_OBSOLETE OBS_SOURCE_CAP_DISABLED")] 44 | public const int OBS_SOURCE_CAP_OBSOLETE = (1 << 10); 45 | 46 | [NativeTypeName("#define OBS_SOURCE_MONITOR_BY_DEFAULT (1 << 11)")] 47 | public const int OBS_SOURCE_MONITOR_BY_DEFAULT = (1 << 11); 48 | 49 | [NativeTypeName("#define OBS_SOURCE_SUBMIX (1 << 12)")] 50 | public const int OBS_SOURCE_SUBMIX = (1 << 12); 51 | 52 | [NativeTypeName("#define OBS_SOURCE_CONTROLLABLE_MEDIA (1 << 13)")] 53 | public const int OBS_SOURCE_CONTROLLABLE_MEDIA = (1 << 13); 54 | 55 | [NativeTypeName("#define OBS_SOURCE_CEA_708 (1 << 14)")] 56 | public const int OBS_SOURCE_CEA_708 = (1 << 14); 57 | 58 | [NativeTypeName("#define OBS_SOURCE_SRGB (1 << 15)")] 59 | public const int OBS_SOURCE_SRGB = (1 << 15); 60 | 61 | [NativeTypeName("#define OBS_SOURCE_CAP_DONT_SHOW_PROPERTIES (1 << 16)")] 62 | public const int OBS_SOURCE_CAP_DONT_SHOW_PROPERTIES = (1 << 16); 63 | 64 | [NativeTypeName("#define OBS_SOURCE_REQUIRES_CANVAS (1 << 17)")] 65 | public const int OBS_SOURCE_REQUIRES_CANVAS = (1 << 17); 66 | } 67 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gif_animation.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public unsafe partial struct gif_animation 6 | { 7 | public gif_bitmap_callback_vt bitmap_callbacks; 8 | 9 | [NativeTypeName("unsigned char *")] 10 | public byte* gif_data; 11 | 12 | [NativeTypeName("unsigned int")] 13 | public uint width; 14 | 15 | [NativeTypeName("unsigned int")] 16 | public uint height; 17 | 18 | [NativeTypeName("unsigned int")] 19 | public uint frame_count; 20 | 21 | [NativeTypeName("unsigned int")] 22 | public uint frame_count_partial; 23 | 24 | public gif_frame* frames; 25 | 26 | public int decoded_frame; 27 | 28 | public void* frame_image; 29 | 30 | public int loop_count; 31 | 32 | public gif_result current_error; 33 | 34 | [NativeTypeName("unsigned int")] 35 | public uint buffer_position; 36 | 37 | [NativeTypeName("unsigned int")] 38 | public uint buffer_size; 39 | 40 | [NativeTypeName("unsigned int")] 41 | public uint frame_holders; 42 | 43 | [NativeTypeName("unsigned int")] 44 | public uint background_index; 45 | 46 | [NativeTypeName("unsigned int")] 47 | public uint aspect_ratio; 48 | 49 | [NativeTypeName("unsigned int")] 50 | public uint colour_table_size; 51 | 52 | [NativeTypeName("bool")] 53 | public byte global_colours; 54 | 55 | [NativeTypeName("unsigned int *")] 56 | public uint* global_colour_table; 57 | 58 | [NativeTypeName("unsigned int *")] 59 | public uint* local_colour_table; 60 | 61 | [NativeTypeName("unsigned char[4]")] 62 | public _buf_e__FixedBuffer buf; 63 | 64 | [NativeTypeName("unsigned char *")] 65 | public byte* direct; 66 | 67 | [NativeTypeName("int[2][4096]")] 68 | public _table_e__FixedBuffer table; 69 | 70 | [NativeTypeName("unsigned char[8192]")] 71 | public _stack_e__FixedBuffer stack; 72 | 73 | [NativeTypeName("unsigned char *")] 74 | public byte* stack_pointer; 75 | 76 | public int code_size; 77 | 78 | public int set_code_size; 79 | 80 | public int max_code; 81 | 82 | public int max_code_size; 83 | 84 | public int clear_code; 85 | 86 | public int end_code; 87 | 88 | public int curbit; 89 | 90 | public int lastbit; 91 | 92 | public int last_byte; 93 | 94 | public int firstcode; 95 | 96 | public int oldcode; 97 | 98 | [NativeTypeName("bool")] 99 | public byte zero_data_block; 100 | 101 | [NativeTypeName("bool")] 102 | public byte get_done; 103 | 104 | [NativeTypeName("bool")] 105 | public byte clear_image; 106 | 107 | [InlineArray(4)] 108 | public partial struct _buf_e__FixedBuffer 109 | { 110 | public byte e0; 111 | } 112 | 113 | [InlineArray(2 * 4096)] 114 | public partial struct _table_e__FixedBuffer 115 | { 116 | public int e0_0; 117 | } 118 | 119 | [InlineArray(8192)] 120 | public partial struct _stack_e__FixedBuffer 121 | { 122 | public byte e0; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_encoder_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_encoder_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* id; 7 | 8 | [NativeTypeName("enum obs_encoder_type")] 9 | public obs_encoder_type type; 10 | 11 | [NativeTypeName("const char *")] 12 | public sbyte* codec; 13 | 14 | [NativeTypeName("const char *(*)(void *)")] 15 | public delegate* unmanaged[Cdecl] get_name; 16 | 17 | [NativeTypeName("void *(*)(obs_data_t *, obs_encoder_t *)")] 18 | public delegate* unmanaged[Cdecl] create; 19 | 20 | [NativeTypeName("void (*)(void *)")] 21 | public delegate* unmanaged[Cdecl] destroy; 22 | 23 | [NativeTypeName("bool (*)(void *, struct encoder_frame *, struct encoder_packet *, bool *)")] 24 | public delegate* unmanaged[Cdecl] encode; 25 | 26 | [NativeTypeName("size_t (*)(void *)")] 27 | public delegate* unmanaged[Cdecl] get_frame_size; 28 | 29 | [NativeTypeName("void (*)(obs_data_t *)")] 30 | public delegate* unmanaged[Cdecl] get_defaults; 31 | 32 | [NativeTypeName("obs_properties_t *(*)(void *)")] 33 | public delegate* unmanaged[Cdecl] get_properties; 34 | 35 | [NativeTypeName("bool (*)(void *, obs_data_t *)")] 36 | public delegate* unmanaged[Cdecl] update; 37 | 38 | [NativeTypeName("bool (*)(void *, uint8_t **, size_t *)")] 39 | public delegate* unmanaged[Cdecl] get_extra_data; 40 | 41 | [NativeTypeName("bool (*)(void *, uint8_t **, size_t *)")] 42 | public delegate* unmanaged[Cdecl] get_sei_data; 43 | 44 | [NativeTypeName("void (*)(void *, struct audio_convert_info *)")] 45 | public delegate* unmanaged[Cdecl] get_audio_info; 46 | 47 | [NativeTypeName("void (*)(void *, struct video_scale_info *)")] 48 | public delegate* unmanaged[Cdecl] get_video_info; 49 | 50 | public void* type_data; 51 | 52 | [NativeTypeName("void (*)(void *)")] 53 | public delegate* unmanaged[Cdecl] free_type_data; 54 | 55 | [NativeTypeName("uint32_t")] 56 | public uint caps; 57 | 58 | [NativeTypeName("void (*)(obs_data_t *, void *)")] 59 | public delegate* unmanaged[Cdecl] get_defaults2; 60 | 61 | [NativeTypeName("obs_properties_t *(*)(void *, void *)")] 62 | public delegate* unmanaged[Cdecl] get_properties2; 63 | 64 | [NativeTypeName("bool (*)(void *, uint32_t, int64_t, uint64_t, uint64_t *, struct encoder_packet *, bool *)")] 65 | public delegate* unmanaged[Cdecl] encode_texture; 66 | 67 | [NativeTypeName("bool (*)(void *, struct encoder_texture *, int64_t, uint64_t, uint64_t *, struct encoder_packet *, bool *)")] 68 | public delegate* unmanaged[Cdecl] encode_texture2; 69 | } 70 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsSignal.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsSignal 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("signal_handler_t *")] 9 | public static extern signal_handler* signal_handler_create(); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | public static extern void signal_handler_destroy([NativeTypeName("signal_handler_t *")] signal_handler* handler); 13 | 14 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 15 | [return: NativeTypeName("bool")] 16 | public static extern byte signal_handler_add([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("const char *")] sbyte* signal_decl); 17 | 18 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 19 | public static extern void signal_handler_connect([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("const char *")] sbyte* signal, [NativeTypeName("signal_callback_t")] delegate* unmanaged[Cdecl] callback, void* data); 20 | 21 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 22 | public static extern void signal_handler_connect_ref([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("const char *")] sbyte* signal, [NativeTypeName("signal_callback_t")] delegate* unmanaged[Cdecl] callback, void* data); 23 | 24 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 25 | public static extern void signal_handler_disconnect([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("const char *")] sbyte* signal, [NativeTypeName("signal_callback_t")] delegate* unmanaged[Cdecl] callback, void* data); 26 | 27 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 28 | public static extern void signal_handler_connect_global([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("global_signal_callback_t")] delegate* unmanaged[Cdecl] callback, void* data); 29 | 30 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 31 | public static extern void signal_handler_disconnect_global([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("global_signal_callback_t")] delegate* unmanaged[Cdecl] callback, void* data); 32 | 33 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 34 | public static extern void signal_handler_remove_current(); 35 | 36 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 37 | public static extern void signal_handler_signal([NativeTypeName("signal_handler_t *")] signal_handler* handler, [NativeTypeName("const char *")] sbyte* signal, [NativeTypeName("calldata_t *")] calldata* @params); 38 | } 39 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsMatrix3.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsMatrix3 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void matrix3_from_quat([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct quat *")] System.Numerics.Quaternion* q); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void matrix3_from_axisang([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct axisang *")] axisang* aa); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void matrix3_from_matrix4([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern void matrix3_mul([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m1, [NativeTypeName("const struct matrix3 *")] matrix3* m2); 18 | 19 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 20 | public static extern void matrix3_rotate([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m, [NativeTypeName("const struct quat *")] System.Numerics.Quaternion* q); 21 | 22 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 23 | public static extern void matrix3_rotate_aa([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m, [NativeTypeName("const struct axisang *")] axisang* aa); 24 | 25 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 26 | public static extern void matrix3_scale([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 27 | 28 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 29 | public static extern void matrix3_transpose([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m); 30 | 31 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 32 | public static extern void matrix3_inv([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m); 33 | 34 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 35 | public static extern void matrix3_mirror([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m, [NativeTypeName("const struct plane *")] plane* p); 36 | 37 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 38 | public static extern void matrix3_mirrorv([NativeTypeName("struct matrix3 *")] matrix3* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 39 | } 40 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsMissingFiles.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsMissingFiles 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | [return: NativeTypeName("obs_missing_files_t *")] 9 | public static extern obs_missing_files* obs_missing_files_create(); 10 | 11 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 12 | [return: NativeTypeName("obs_missing_file_t *")] 13 | public static extern obs_missing_file* obs_missing_file_create([NativeTypeName("const char *")] sbyte* path, [NativeTypeName("obs_missing_file_cb")] delegate* unmanaged[Cdecl] callback, int src_type, void* src, void* data); 14 | 15 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 16 | public static extern void obs_missing_files_add_file([NativeTypeName("obs_missing_files_t *")] obs_missing_files* files, [NativeTypeName("obs_missing_file_t *")] obs_missing_file* file); 17 | 18 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 19 | [return: NativeTypeName("size_t")] 20 | public static extern nuint obs_missing_files_count([NativeTypeName("obs_missing_files_t *")] obs_missing_files* files); 21 | 22 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 23 | [return: NativeTypeName("obs_missing_file_t *")] 24 | public static extern obs_missing_file* obs_missing_files_get_file([NativeTypeName("obs_missing_files_t *")] obs_missing_files* files, int idx); 25 | 26 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 27 | public static extern void obs_missing_files_destroy([NativeTypeName("obs_missing_files_t *")] obs_missing_files* files); 28 | 29 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 30 | public static extern void obs_missing_files_append([NativeTypeName("obs_missing_files_t *")] obs_missing_files* dst, [NativeTypeName("obs_missing_files_t *")] obs_missing_files* src); 31 | 32 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 33 | public static extern void obs_missing_file_issue_callback([NativeTypeName("obs_missing_file_t *")] obs_missing_file* file, [NativeTypeName("const char *")] sbyte* new_path); 34 | 35 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 36 | [return: NativeTypeName("const char *")] 37 | public static extern sbyte* obs_missing_file_get_path([NativeTypeName("obs_missing_file_t *")] obs_missing_file* file); 38 | 39 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 40 | [return: NativeTypeName("const char *")] 41 | public static extern sbyte* obs_missing_file_get_source_name([NativeTypeName("obs_missing_file_t *")] obs_missing_file* file); 42 | 43 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 44 | public static extern void obs_missing_file_release([NativeTypeName("obs_missing_file_t *")] obs_missing_file* file); 45 | 46 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 47 | public static extern void obs_missing_file_destroy([NativeTypeName("obs_missing_file_t *")] obs_missing_file* file); 48 | } 49 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_service_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_service_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* id; 7 | 8 | [NativeTypeName("const char *(*)(void *)")] 9 | public delegate* unmanaged[Cdecl] get_name; 10 | 11 | [NativeTypeName("void *(*)(obs_data_t *, obs_service_t *)")] 12 | public delegate* unmanaged[Cdecl] create; 13 | 14 | [NativeTypeName("void (*)(void *)")] 15 | public delegate* unmanaged[Cdecl] destroy; 16 | 17 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 18 | public delegate* unmanaged[Cdecl] activate; 19 | 20 | [NativeTypeName("void (*)(void *)")] 21 | public delegate* unmanaged[Cdecl] deactivate; 22 | 23 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 24 | public delegate* unmanaged[Cdecl] update; 25 | 26 | [NativeTypeName("void (*)(obs_data_t *)")] 27 | public delegate* unmanaged[Cdecl] get_defaults; 28 | 29 | [NativeTypeName("obs_properties_t *(*)(void *)")] 30 | public delegate* unmanaged[Cdecl] get_properties; 31 | 32 | [NativeTypeName("bool (*)(void *, obs_output_t *)")] 33 | public delegate* unmanaged[Cdecl] initialize; 34 | 35 | [NativeTypeName("const char *(*)(void *)")] 36 | public delegate* unmanaged[Cdecl] get_url; 37 | 38 | [NativeTypeName("const char *(*)(void *)")] 39 | public delegate* unmanaged[Cdecl] get_key; 40 | 41 | [NativeTypeName("const char *(*)(void *)")] 42 | public delegate* unmanaged[Cdecl] get_username; 43 | 44 | [NativeTypeName("const char *(*)(void *)")] 45 | public delegate* unmanaged[Cdecl] get_password; 46 | 47 | [NativeTypeName("bool (*)()")] 48 | public delegate* unmanaged[Cdecl] deprecated_1; 49 | 50 | [NativeTypeName("void (*)(void *, obs_data_t *, obs_data_t *)")] 51 | public delegate* unmanaged[Cdecl] apply_encoder_settings; 52 | 53 | public void* type_data; 54 | 55 | [NativeTypeName("void (*)(void *)")] 56 | public delegate* unmanaged[Cdecl] free_type_data; 57 | 58 | [NativeTypeName("const char *(*)(void *)")] 59 | public delegate* unmanaged[Cdecl] get_output_type; 60 | 61 | [NativeTypeName("void (*)(void *, struct obs_service_resolution **, size_t *)")] 62 | public delegate* unmanaged[Cdecl] get_supported_resolutions; 63 | 64 | [NativeTypeName("void (*)(void *, int *)")] 65 | public delegate* unmanaged[Cdecl] get_max_fps; 66 | 67 | [NativeTypeName("void (*)(void *, int *, int *)")] 68 | public delegate* unmanaged[Cdecl] get_max_bitrate; 69 | 70 | [NativeTypeName("const char **(*)(void *)")] 71 | public delegate* unmanaged[Cdecl] get_supported_video_codecs; 72 | 73 | [NativeTypeName("const char *(*)(void *)")] 74 | public delegate* unmanaged[Cdecl] get_protocol; 75 | 76 | [NativeTypeName("const char **(*)(void *)")] 77 | public delegate* unmanaged[Cdecl] get_supported_audio_codecs; 78 | 79 | [NativeTypeName("const char *(*)(void *, uint32_t)")] 80 | public delegate* unmanaged[Cdecl] get_connect_info; 81 | 82 | [NativeTypeName("bool (*)(void *)")] 83 | public delegate* unmanaged[Cdecl] can_try_to_connect; 84 | } 85 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/gs_effect_param.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace ObsInterop; 5 | 6 | public unsafe partial struct gs_effect_param 7 | { 8 | [NativeTypeName("char *")] 9 | public sbyte* name; 10 | 11 | [NativeTypeName("enum effect_section")] 12 | public effect_section section; 13 | 14 | [NativeTypeName("enum gs_shader_param_type")] 15 | public gs_shader_param_type type; 16 | 17 | [NativeTypeName("bool")] 18 | public byte changed; 19 | 20 | [NativeTypeName("__AnonymousRecord_effect_L54_C2")] 21 | public _cur_val_e__Union cur_val; 22 | 23 | [NativeTypeName("__AnonymousRecord_effect_L55_C2")] 24 | public _default_val_e__Union default_val; 25 | 26 | [NativeTypeName("gs_effect_t *")] 27 | public gs_effect* effect; 28 | 29 | [NativeTypeName("gs_samplerstate_t *")] 30 | public gs_sampler_state* next_sampler; 31 | 32 | public gs_effect_param_array_t annotations; 33 | 34 | [StructLayout(LayoutKind.Explicit)] 35 | public unsafe partial struct _cur_val_e__Union 36 | { 37 | [FieldOffset(0)] 38 | [NativeTypeName("struct darray")] 39 | public darray da; 40 | 41 | [FieldOffset(0)] 42 | [NativeTypeName("__AnonymousRecord_effect_L54_C2")] 43 | public _Anonymous_e__Struct Anonymous; 44 | 45 | [UnscopedRef] 46 | public ref byte* array 47 | { 48 | get 49 | { 50 | return ref Anonymous.array; 51 | } 52 | } 53 | 54 | [UnscopedRef] 55 | public ref nuint num 56 | { 57 | get 58 | { 59 | return ref Anonymous.num; 60 | } 61 | } 62 | 63 | [UnscopedRef] 64 | public ref nuint capacity 65 | { 66 | get 67 | { 68 | return ref Anonymous.capacity; 69 | } 70 | } 71 | 72 | public unsafe partial struct _Anonymous_e__Struct 73 | { 74 | [NativeTypeName("uint8_t *")] 75 | public byte* array; 76 | 77 | [NativeTypeName("size_t")] 78 | public nuint num; 79 | 80 | [NativeTypeName("size_t")] 81 | public nuint capacity; 82 | } 83 | } 84 | 85 | [StructLayout(LayoutKind.Explicit)] 86 | public unsafe partial struct _default_val_e__Union 87 | { 88 | [FieldOffset(0)] 89 | [NativeTypeName("struct darray")] 90 | public darray da; 91 | 92 | [FieldOffset(0)] 93 | [NativeTypeName("__AnonymousRecord_effect_L55_C2")] 94 | public _Anonymous_e__Struct Anonymous; 95 | 96 | [UnscopedRef] 97 | public ref byte* array 98 | { 99 | get 100 | { 101 | return ref Anonymous.array; 102 | } 103 | } 104 | 105 | [UnscopedRef] 106 | public ref nuint num 107 | { 108 | get 109 | { 110 | return ref Anonymous.num; 111 | } 112 | } 113 | 114 | [UnscopedRef] 115 | public ref nuint capacity 116 | { 117 | get 118 | { 119 | return ref Anonymous.capacity; 120 | } 121 | } 122 | 123 | public unsafe partial struct _Anonymous_e__Struct 124 | { 125 | [NativeTypeName("uint8_t *")] 126 | public byte* array; 127 | 128 | [NativeTypeName("size_t")] 129 | public nuint num; 130 | 131 | [NativeTypeName("size_t")] 132 | public nuint capacity; 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsImageFile.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsImageFile 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void gs_image_file_init([NativeTypeName("gs_image_file_t *")] gs_image_file* image, [NativeTypeName("const char *")] sbyte* file); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void gs_image_file_free([NativeTypeName("gs_image_file_t *")] gs_image_file* image); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void gs_image_file_init_texture([NativeTypeName("gs_image_file_t *")] gs_image_file* image); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | [return: NativeTypeName("bool")] 18 | public static extern byte gs_image_file_tick([NativeTypeName("gs_image_file_t *")] gs_image_file* image, [NativeTypeName("uint64_t")] ulong elapsed_time_ns); 19 | 20 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 21 | public static extern void gs_image_file_update_texture([NativeTypeName("gs_image_file_t *")] gs_image_file* image); 22 | 23 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 24 | public static extern void gs_image_file2_init([NativeTypeName("gs_image_file2_t *")] gs_image_file2* if2, [NativeTypeName("const char *")] sbyte* file); 25 | 26 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 27 | [return: NativeTypeName("bool")] 28 | public static extern byte gs_image_file2_tick([NativeTypeName("gs_image_file2_t *")] gs_image_file2* if2, [NativeTypeName("uint64_t")] ulong elapsed_time_ns); 29 | 30 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 31 | public static extern void gs_image_file2_update_texture([NativeTypeName("gs_image_file2_t *")] gs_image_file2* if2); 32 | 33 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 34 | public static extern void gs_image_file3_init([NativeTypeName("gs_image_file3_t *")] gs_image_file3* if3, [NativeTypeName("const char *")] sbyte* file, [NativeTypeName("enum gs_image_alpha_mode")] gs_image_alpha_mode alpha_mode); 35 | 36 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 37 | [return: NativeTypeName("bool")] 38 | public static extern byte gs_image_file3_tick([NativeTypeName("gs_image_file3_t *")] gs_image_file3* if3, [NativeTypeName("uint64_t")] ulong elapsed_time_ns); 39 | 40 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 41 | public static extern void gs_image_file3_update_texture([NativeTypeName("gs_image_file3_t *")] gs_image_file3* if3); 42 | 43 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 44 | public static extern void gs_image_file4_init([NativeTypeName("gs_image_file4_t *")] gs_image_file4* if4, [NativeTypeName("const char *")] sbyte* file, [NativeTypeName("enum gs_image_alpha_mode")] gs_image_alpha_mode alpha_mode); 45 | 46 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 47 | [return: NativeTypeName("bool")] 48 | public static extern byte gs_image_file4_tick([NativeTypeName("gs_image_file4_t *")] gs_image_file4* if4, [NativeTypeName("uint64_t")] ulong elapsed_time_ns); 49 | 50 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 51 | public static extern void gs_image_file4_update_texture([NativeTypeName("gs_image_file4_t *")] gs_image_file4* if4); 52 | } 53 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsAudio.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsAudio 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern int audio_output_open([NativeTypeName("audio_t **")] audio_output** audio, [NativeTypeName("struct audio_output_info *")] audio_output_info* info); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void audio_output_close([NativeTypeName("audio_t *")] audio_output* audio); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | [return: NativeTypeName("bool")] 15 | public static extern byte audio_output_connect([NativeTypeName("audio_t *")] audio_output* video, [NativeTypeName("size_t")] nuint mix_idx, [NativeTypeName("const struct audio_convert_info *")] audio_convert_info* conversion, [NativeTypeName("audio_output_callback_t")] delegate* unmanaged[Cdecl] callback, void* param4); 16 | 17 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 18 | public static extern void audio_output_disconnect([NativeTypeName("audio_t *")] audio_output* video, [NativeTypeName("size_t")] nuint mix_idx, [NativeTypeName("audio_output_callback_t")] delegate* unmanaged[Cdecl] callback, void* param3); 19 | 20 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 21 | [return: NativeTypeName("bool")] 22 | public static extern byte audio_output_active([NativeTypeName("const audio_t *")] audio_output* audio); 23 | 24 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 25 | [return: NativeTypeName("size_t")] 26 | public static extern nuint audio_output_get_block_size([NativeTypeName("const audio_t *")] audio_output* audio); 27 | 28 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 29 | [return: NativeTypeName("size_t")] 30 | public static extern nuint audio_output_get_planes([NativeTypeName("const audio_t *")] audio_output* audio); 31 | 32 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 33 | [return: NativeTypeName("size_t")] 34 | public static extern nuint audio_output_get_channels([NativeTypeName("const audio_t *")] audio_output* audio); 35 | 36 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 37 | [return: NativeTypeName("uint32_t")] 38 | public static extern uint audio_output_get_sample_rate([NativeTypeName("const audio_t *")] audio_output* audio); 39 | 40 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 41 | [return: NativeTypeName("const struct audio_output_info *")] 42 | public static extern audio_output_info* audio_output_get_info([NativeTypeName("const audio_t *")] audio_output* audio); 43 | 44 | [NativeTypeName("#define MAX_AUDIO_MIXES 6")] 45 | public const int MAX_AUDIO_MIXES = 6; 46 | 47 | [NativeTypeName("#define MAX_AUDIO_CHANNELS 8")] 48 | public const int MAX_AUDIO_CHANNELS = 8; 49 | 50 | [NativeTypeName("#define MAX_DEVICE_INPUT_CHANNELS 64")] 51 | public const int MAX_DEVICE_INPUT_CHANNELS = 64; 52 | 53 | [NativeTypeName("#define AUDIO_OUTPUT_FRAMES 1024")] 54 | public const int AUDIO_OUTPUT_FRAMES = 1024; 55 | 56 | [NativeTypeName("#define TOTAL_AUDIO_SIZE (MAX_AUDIO_MIXES * MAX_AUDIO_CHANNELS * AUDIO_OUTPUT_FRAMES * sizeof(float))")] 57 | public const ulong TOTAL_AUDIO_SIZE = (6 * 8 * 1024 * 4); 58 | 59 | [NativeTypeName("#define AUDIO_OUTPUT_SUCCESS 0")] 60 | public const int AUDIO_OUTPUT_SUCCESS = 0; 61 | 62 | [NativeTypeName("#define AUDIO_OUTPUT_INVALIDPARAM -1")] 63 | public const int AUDIO_OUTPUT_INVALIDPARAM = -1; 64 | 65 | [NativeTypeName("#define AUDIO_OUTPUT_FAIL -2")] 66 | public const int AUDIO_OUTPUT_FAIL = -2; 67 | } 68 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsMatrix4.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsMatrix4 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void matrix4_from_matrix3([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix3 *")] matrix3* m); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void matrix4_from_quat([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct quat *")] System.Numerics.Quaternion* q); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void matrix4_from_axisang([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct axisang *")] axisang* aa); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern void matrix4_mul([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m1, [NativeTypeName("const struct matrix4 *")] matrix4* m2); 18 | 19 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 20 | public static extern float matrix4_determinant([NativeTypeName("const struct matrix4 *")] matrix4* m); 21 | 22 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 23 | public static extern void matrix4_translate3v([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 24 | 25 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 26 | public static extern void matrix4_translate4v([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m, [NativeTypeName("const struct vec4 *")] System.Numerics.Vector4* v); 27 | 28 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 29 | public static extern void matrix4_rotate([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m, [NativeTypeName("const struct quat *")] System.Numerics.Quaternion* q); 30 | 31 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 32 | public static extern void matrix4_rotate_aa([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m, [NativeTypeName("const struct axisang *")] axisang* aa); 33 | 34 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 35 | public static extern void matrix4_scale([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 36 | 37 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 38 | [return: NativeTypeName("bool")] 39 | public static extern byte matrix4_inv([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m); 40 | 41 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 42 | public static extern void matrix4_transpose([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct matrix4 *")] matrix4* m); 43 | 44 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 45 | public static extern void matrix4_translate3v_i([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v, [NativeTypeName("const struct matrix4 *")] matrix4* m); 46 | 47 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 48 | public static extern void matrix4_translate4v_i([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct vec4 *")] System.Numerics.Vector4* v, [NativeTypeName("const struct matrix4 *")] matrix4* m); 49 | 50 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 51 | public static extern void matrix4_rotate_i([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct quat *")] System.Numerics.Quaternion* q, [NativeTypeName("const struct matrix4 *")] matrix4* m); 52 | 53 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 54 | public static extern void matrix4_rotate_aa_i([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct axisang *")] axisang* aa, [NativeTypeName("const struct matrix4 *")] matrix4* m); 55 | 56 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 57 | public static extern void matrix4_scale_i([NativeTypeName("struct matrix4 *")] matrix4* dst, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v, [NativeTypeName("const struct matrix4 *")] matrix4* m); 58 | } 59 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/ObsBounds.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace ObsInterop; 4 | 5 | public static unsafe partial class ObsBounds 6 | { 7 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 8 | public static extern void bounds_move([NativeTypeName("struct bounds *")] bounds* dst, [NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 9 | 10 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 11 | public static extern void bounds_scale([NativeTypeName("struct bounds *")] bounds* dst, [NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 12 | 13 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 14 | public static extern void bounds_merge([NativeTypeName("struct bounds *")] bounds* dst, [NativeTypeName("const struct bounds *")] bounds* b1, [NativeTypeName("const struct bounds *")] bounds* b2); 15 | 16 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 17 | public static extern void bounds_merge_point([NativeTypeName("struct bounds *")] bounds* dst, [NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* v); 18 | 19 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 20 | public static extern void bounds_get_point([NativeTypeName("struct vec3 *")] System.Numerics.Vector3* dst, [NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("unsigned int")] uint i); 21 | 22 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 23 | public static extern void bounds_get_center([NativeTypeName("struct vec3 *")] System.Numerics.Vector3* dst, [NativeTypeName("const struct bounds *")] bounds* b); 24 | 25 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 26 | public static extern void bounds_transform([NativeTypeName("struct bounds *")] bounds* dst, [NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct matrix4 *")] matrix4* m); 27 | 28 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 29 | public static extern void bounds_transform3x4([NativeTypeName("struct bounds *")] bounds* dst, [NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct matrix3 *")] matrix3* m); 30 | 31 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 32 | [return: NativeTypeName("bool")] 33 | public static extern byte bounds_intersection_ray([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* orig, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* dir, float* t); 34 | 35 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 36 | [return: NativeTypeName("bool")] 37 | public static extern byte bounds_intersection_line([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* p1, [NativeTypeName("const struct vec3 *")] System.Numerics.Vector3* p2, float* t); 38 | 39 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 40 | [return: NativeTypeName("bool")] 41 | public static extern byte bounds_plane_test([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct plane *")] plane* p); 42 | 43 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 44 | [return: NativeTypeName("bool")] 45 | public static extern byte bounds_under_plane([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct plane *")] plane* p); 46 | 47 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 48 | [return: NativeTypeName("bool")] 49 | public static extern byte bounds_intersects([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct bounds *")] bounds* test, float epsilon); 50 | 51 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 52 | [return: NativeTypeName("bool")] 53 | public static extern byte bounds_intersects_obb([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct bounds *")] bounds* test, [NativeTypeName("const struct matrix4 *")] matrix4* m, float epsilon); 54 | 55 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 56 | [return: NativeTypeName("bool")] 57 | public static extern byte bounds_intersects_obb3x4([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct bounds *")] bounds* test, [NativeTypeName("const struct matrix3 *")] matrix3* m, float epsilon); 58 | 59 | [DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)] 60 | public static extern float bounds_min_dist([NativeTypeName("const struct bounds *")] bounds* b, [NativeTypeName("const struct plane *")] plane* p); 61 | 62 | [NativeTypeName("#define BOUNDS_OUTSIDE 1")] 63 | public const int BOUNDS_OUTSIDE = 1; 64 | 65 | [NativeTypeName("#define BOUNDS_INSIDE 2")] 66 | public const int BOUNDS_INSIDE = 2; 67 | 68 | [NativeTypeName("#define BOUNDS_PARTIAL 3")] 69 | public const int BOUNDS_PARTIAL = 3; 70 | } 71 | -------------------------------------------------------------------------------- /NetObsBindings/ObsInterop/Generated/obs_source_info.cs: -------------------------------------------------------------------------------- 1 | namespace ObsInterop; 2 | 3 | public unsafe partial struct obs_source_info 4 | { 5 | [NativeTypeName("const char *")] 6 | public sbyte* id; 7 | 8 | [NativeTypeName("enum obs_source_type")] 9 | public obs_source_type type; 10 | 11 | [NativeTypeName("uint32_t")] 12 | public uint output_flags; 13 | 14 | [NativeTypeName("const char *(*)(void *)")] 15 | public delegate* unmanaged[Cdecl] get_name; 16 | 17 | [NativeTypeName("void *(*)(obs_data_t *, obs_source_t *)")] 18 | public delegate* unmanaged[Cdecl] create; 19 | 20 | [NativeTypeName("void (*)(void *)")] 21 | public delegate* unmanaged[Cdecl] destroy; 22 | 23 | [NativeTypeName("uint32_t (*)(void *)")] 24 | public delegate* unmanaged[Cdecl] get_width; 25 | 26 | [NativeTypeName("uint32_t (*)(void *)")] 27 | public delegate* unmanaged[Cdecl] get_height; 28 | 29 | [NativeTypeName("void (*)(obs_data_t *)")] 30 | public delegate* unmanaged[Cdecl] get_defaults; 31 | 32 | [NativeTypeName("obs_properties_t *(*)(void *)")] 33 | public delegate* unmanaged[Cdecl] get_properties; 34 | 35 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 36 | public delegate* unmanaged[Cdecl] update; 37 | 38 | [NativeTypeName("void (*)(void *)")] 39 | public delegate* unmanaged[Cdecl] activate; 40 | 41 | [NativeTypeName("void (*)(void *)")] 42 | public delegate* unmanaged[Cdecl] deactivate; 43 | 44 | [NativeTypeName("void (*)(void *)")] 45 | public delegate* unmanaged[Cdecl] show; 46 | 47 | [NativeTypeName("void (*)(void *)")] 48 | public delegate* unmanaged[Cdecl] hide; 49 | 50 | [NativeTypeName("void (*)(void *, float)")] 51 | public delegate* unmanaged[Cdecl] video_tick; 52 | 53 | [NativeTypeName("void (*)(void *, gs_effect_t *)")] 54 | public delegate* unmanaged[Cdecl] video_render; 55 | 56 | [NativeTypeName("struct obs_source_frame *(*)(void *, struct obs_source_frame *)")] 57 | public delegate* unmanaged[Cdecl] filter_video; 58 | 59 | [NativeTypeName("struct obs_audio_data *(*)(void *, struct obs_audio_data *)")] 60 | public delegate* unmanaged[Cdecl] filter_audio; 61 | 62 | [NativeTypeName("void (*)(void *, obs_source_enum_proc_t, void *)")] 63 | public delegate* unmanaged[Cdecl], void*, void> enum_active_sources; 64 | 65 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 66 | public delegate* unmanaged[Cdecl] save; 67 | 68 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 69 | public delegate* unmanaged[Cdecl] load; 70 | 71 | [NativeTypeName("void (*)(void *, const struct obs_mouse_event *, int32_t, bool, uint32_t)")] 72 | public delegate* unmanaged[Cdecl] mouse_click; 73 | 74 | [NativeTypeName("void (*)(void *, const struct obs_mouse_event *, bool)")] 75 | public delegate* unmanaged[Cdecl] mouse_move; 76 | 77 | [NativeTypeName("void (*)(void *, const struct obs_mouse_event *, int, int)")] 78 | public delegate* unmanaged[Cdecl] mouse_wheel; 79 | 80 | [NativeTypeName("void (*)(void *, bool)")] 81 | public delegate* unmanaged[Cdecl] focus; 82 | 83 | [NativeTypeName("void (*)(void *, const struct obs_key_event *, bool)")] 84 | public delegate* unmanaged[Cdecl] key_click; 85 | 86 | [NativeTypeName("void (*)(void *, obs_source_t *)")] 87 | public delegate* unmanaged[Cdecl] filter_remove; 88 | 89 | public void* type_data; 90 | 91 | [NativeTypeName("void (*)(void *)")] 92 | public delegate* unmanaged[Cdecl] free_type_data; 93 | 94 | [NativeTypeName("bool (*)(void *, uint64_t *, struct obs_source_audio_mix *, uint32_t, size_t, size_t)")] 95 | public delegate* unmanaged[Cdecl] audio_render; 96 | 97 | [NativeTypeName("void (*)(void *, obs_source_enum_proc_t, void *)")] 98 | public delegate* unmanaged[Cdecl], void*, void> enum_all_sources; 99 | 100 | [NativeTypeName("void (*)(void *)")] 101 | public delegate* unmanaged[Cdecl] transition_start; 102 | 103 | [NativeTypeName("void (*)(void *)")] 104 | public delegate* unmanaged[Cdecl] transition_stop; 105 | 106 | [NativeTypeName("void (*)(void *, obs_data_t *)")] 107 | public delegate* unmanaged[Cdecl] get_defaults2; 108 | 109 | [NativeTypeName("obs_properties_t *(*)(void *, void *)")] 110 | public delegate* unmanaged[Cdecl] get_properties2; 111 | 112 | [NativeTypeName("bool (*)(void *, uint64_t *, struct audio_output_data *, size_t, size_t)")] 113 | public delegate* unmanaged[Cdecl] audio_mix; 114 | 115 | [NativeTypeName("enum obs_icon_type")] 116 | public obs_icon_type icon_type; 117 | 118 | [NativeTypeName("void (*)(void *, bool)")] 119 | public delegate* unmanaged[Cdecl] media_play_pause; 120 | 121 | [NativeTypeName("void (*)(void *)")] 122 | public delegate* unmanaged[Cdecl] media_restart; 123 | 124 | [NativeTypeName("void (*)(void *)")] 125 | public delegate* unmanaged[Cdecl] media_stop; 126 | 127 | [NativeTypeName("void (*)(void *)")] 128 | public delegate* unmanaged[Cdecl] media_next; 129 | 130 | [NativeTypeName("void (*)(void *)")] 131 | public delegate* unmanaged[Cdecl] media_previous; 132 | 133 | [NativeTypeName("int64_t (*)(void *)")] 134 | public delegate* unmanaged[Cdecl] media_get_duration; 135 | 136 | [NativeTypeName("int64_t (*)(void *)")] 137 | public delegate* unmanaged[Cdecl] media_get_time; 138 | 139 | [NativeTypeName("void (*)(void *, int64_t)")] 140 | public delegate* unmanaged[Cdecl] media_set_time; 141 | 142 | [NativeTypeName("enum obs_media_state (*)(void *)")] 143 | public delegate* unmanaged[Cdecl] media_get_state; 144 | 145 | [NativeTypeName("uint32_t")] 146 | public uint version; 147 | 148 | [NativeTypeName("const char *")] 149 | public sbyte* unversioned_id; 150 | 151 | [NativeTypeName("obs_missing_files_t *(*)(void *)")] 152 | public delegate* unmanaged[Cdecl] missing_files; 153 | 154 | [NativeTypeName("enum gs_color_space (*)(void *, size_t, const enum gs_color_space *)")] 155 | public delegate* unmanaged[Cdecl] video_get_color_space; 156 | 157 | [NativeTypeName("void (*)(void *, obs_source_t *)")] 158 | public delegate* unmanaged[Cdecl] filter_add; 159 | } 160 | -------------------------------------------------------------------------------- /generate_bindings.ps1: -------------------------------------------------------------------------------- 1 | function Get-ObsClassName { 2 | param ($ObsHeaderName) 3 | 4 | $moduleNameParts = [System.IO.Path]::GetFileNameWithoutExtension($ObsHeaderName).Replace("-io", "").Split("-") 5 | 6 | for ($i = 0; $i -lt $moduleNameParts.Length; $i++) 7 | { 8 | $moduleNameParts[$i] = (Get-Culture).TextInfo.ToTitleCase($moduleNameParts[$i]) 9 | } 10 | 11 | $moduleName = -Join $moduleNameParts 12 | 13 | if (!$moduleName.StartsWith("Obs")) { 14 | $moduleName = "Obs" + $moduleName; 15 | } 16 | 17 | $moduleName 18 | } 19 | 20 | $config = "multi-file", "generate-file-scoped-namespaces", "generate-helper-types", "exclude-funcs-with-body", "generate-macro-bindings", "latest-codegen" 21 | $replacements = "vec2=@System.Numerics.Vector2", "vec3=@System.Numerics.Vector3", "vec4=@System.Numerics.Vector4", "half=@Half", "__m128=@System.Runtime.Intrinsics.Vector128", "quat=@System.Numerics.Quaternion", "_iobuf*=@nint","stat*=@nint" 22 | $excludes = @( 23 | "blogva", "blog", <# this method uses __arglist (variable argument list in C) but it is not fully supported in .NET (e.g. on Linux it just crashes) #> 24 | "ARCH_BITS", <# manually implemented for .NET #> 25 | "S__LINE__", "INT_CUR_LINE", "FILE_LINE" <# macroses for line and file in C, doesnt't work well in C# #> 26 | ) 27 | 28 | $obsModuleTracersals = @( 29 | ".\obs-studio\libobs\obs-source.h", 30 | ".\obs-studio\libobs\obs.h", 31 | ".\obs-studio\libobs\obs-missing-files.h", 32 | ".\obs-studio\libobs\obs-output.h", 33 | ".\obs-studio\libobs\obs-interaction.h", 34 | ".\obs-studio\libobs\obs-encoder.h", 35 | ".\obs-studio\libobs\obs-service.h", 36 | ".\obs-studio\libobs\obs-properties.h", 37 | ".\obs-studio\libobs\obs-data.h", 38 | ".\obs-studio\libobs\callback\proc.h", 39 | ".\obs-studio\libobs\callback\signal.h", 40 | ".\obs-studio\libobs\callback\calldata.h" 41 | ); 42 | 43 | $outputFolder = ".\NetObsBindings\ObsInterop\Generated" 44 | rm $outputFolder -Confirm:$false -Force -Recurse 45 | mkdir $outputFolder 46 | 47 | foreach ($obsModuleTracersal in $obsModuleTracersals) 48 | { 49 | Write-Host "----Generating bindings for file ""$obsModuleTracersal""" 50 | 51 | $moduleName = Get-ObsClassName $obsModuleTracersal 52 | 53 | ClangSharpPInvokeGenerator ` 54 | -c $config ` 55 | --file .\obs-studio\libobs\obs-module.h <# file we want to generate bindings for #> ` 56 | --traverse $obsModuleTracersal <# file we want to generate bindings for #> ` 57 | -n ObsInterop <# namespace of the bindings #> ` 58 | --methodClassName $moduleName <# class name where to put methods #> ` 59 | --libraryPath obs <# name of the DLL #> ` 60 | -o $outputFolder <# output folder #> ` 61 | -r $replacements ` 62 | --exclude $excludes 63 | } 64 | 65 | $mediaLibraries = @( 66 | ".\obs-studio\libobs\media-io\audio-io.h", 67 | ".\obs-studio\libobs\media-io\video-io.h", 68 | ".\obs-studio\libobs\media-io\frame-rate.h", 69 | ".\obs-studio\libobs\media-io\audio-resampler.h", 70 | ".\obs-studio\libobs\media-io\format-conversion.h", 71 | ".\obs-studio\libobs\media-io\media-remux.h", 72 | ".\obs-studio\libobs\media-io\video-frame.h", 73 | ".\obs-studio\libobs\media-io\video-scaler.h" 74 | ); 75 | 76 | foreach ($mediaLibrary in $mediaLibraries) 77 | { 78 | Write-Host "----Generating bindings for file ""$mediaLibrary""" 79 | 80 | $moduleName = Get-ObsClassName $mediaLibrary 81 | 82 | ClangSharpPInvokeGenerator ` 83 | -c $config ` 84 | --file .\generate\media-io\obs-media-io.h ` 85 | --traverse $mediaLibrary <# file we want to generate bindings for #> ` 86 | --include-directory .\obs-studio\libobs ` 87 | -n ObsInterop <# namespace of the bindings #> ` 88 | --methodClassName $moduleName <# class name where to put methods #> ` 89 | --libraryPath obs <# name of the DLL #> ` 90 | -o $outputFolder <# output folder #> ` 91 | -r $replacements ` 92 | --exclude $excludes 93 | } 94 | 95 | $graphicsLibraries = @( 96 | ".\obs-studio\libobs\graphics\graphics.h", 97 | ".\obs-studio\libobs\graphics\input.h", 98 | ".\obs-studio\libobs\graphics\axisang.h", 99 | ".\obs-studio\libobs\graphics\bounds.h", 100 | ".\obs-studio\libobs\graphics\device-exports.h", 101 | ".\obs-studio\libobs\graphics\effect.h", 102 | ".\obs-studio\libobs\graphics\image-file.h", 103 | ".\obs-studio\libobs\graphics\math-defs.h", 104 | ".\obs-studio\libobs\graphics\math-extra.h", 105 | ".\obs-studio\libobs\graphics\matrix3.h", 106 | ".\obs-studio\libobs\graphics\matrix4.h", 107 | ".\obs-studio\libobs\graphics\plane.h", 108 | ".\obs-studio\libobs\graphics\srgb.h", 109 | ".\obs-studio\libobs\graphics\libnsgif\libnsgif.h" 110 | ); 111 | 112 | foreach ($graphicsLibrary in $graphicsLibraries) 113 | { 114 | Write-Host "----Generating bindings for file ""$graphicsLibrary""" 115 | 116 | $moduleName = Get-ObsClassName $graphicsLibrary 117 | 118 | ClangSharpPInvokeGenerator ` 119 | -c $config ` 120 | --file .\generate\graphics\obs-graphics.h ` 121 | --traverse $graphicsLibrary <# file we want to generate bindings for #> ` 122 | --include-directory .\obs-studio\libobs ` 123 | -n ObsInterop <# namespace of the bindings #> ` 124 | --methodClassName $moduleName <# class name where to put methods #> ` 125 | --libraryPath obs <# name of the DLL #> ` 126 | -o $outputFolder <# output folder #> ` 127 | -r $replacements ` 128 | --exclude $excludes 129 | } 130 | 131 | $utilLibraries = @( 132 | ".\obs-studio\libobs\util\text-lookup.h", 133 | ".\obs-studio\libobs\util\profiler.h", 134 | ".\obs-studio\libobs\util\base.h", 135 | ".\obs-studio\libobs\util\bmem.h", 136 | ".\obs-studio\libobs\util\platform.h" 137 | ); 138 | 139 | foreach ($utilLibrary in $utilLibraries) 140 | { 141 | Write-Host "----Generating bindings for file ""$utilLibrary""" 142 | 143 | $moduleName = Get-ObsClassName $utilLibrary 144 | 145 | ClangSharpPInvokeGenerator ` 146 | -c $config ` 147 | --file .\generate\util\obs-util.h ` 148 | --traverse $utilLibrary <# file we want to generate bindings for #> ` 149 | --include-directory .\obs-studio\libobs ` 150 | -n ObsInterop <# namespace of the bindings #> ` 151 | --methodClassName $moduleName <# class name where to put methods #> ` 152 | --libraryPath obs <# name of the DLL #> ` 153 | -o $outputFolder <# output folder #> ` 154 | -r $replacements ` 155 | --exclude $excludes 156 | } 157 | 158 | ClangSharpPInvokeGenerator ` 159 | -c $config ` 160 | --file .\obs-studio\frontend\api\obs-frontend-api.h <# file we want to generate bindings for #> ` 161 | --file .\obs-studio\libobs\util\darray.h ` 162 | --include-directory .\obs-studio\libobs ` 163 | --include-directory .\obs-studio\libobs\util ` 164 | -n ObsInterop <# namespace of the bindings #> ` 165 | --methodClassName ObsFrontendApi <# class name where to put methods #> ` 166 | --libraryPath obs-frontend-api <# name of the DLL #> ` 167 | -o $outputFolder <# output folder #> ` 168 | -r $replacements ` 169 | --exclude $excludes 170 | 171 | rm $outputFolder\System.Numerics.Quaternion.cs <# This file is wrongly generated by ClangSharpGenerator #> --------------------------------------------------------------------------------