Skip to content

Commit

Permalink
Upgrade to OBS 30.0.2 and include the obs version inside the lib version
Browse files Browse the repository at this point in the history
  • Loading branch information
kostya9 committed Dec 11, 2023
1 parent f5d4415 commit 469c168
Show file tree
Hide file tree
Showing 22 changed files with 239 additions and 233 deletions.
2 changes: 1 addition & 1 deletion NetObsBindings/NetObsBindings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<PropertyGroup>
<PackageVersion>0.0.1.38-alpha</PackageVersion>
<PackageVersion>30.0.2.0</PackageVersion>

<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<ProjectUrl>https://github.com/kostya9/NetObsBindings</ProjectUrl>
Expand Down
2 changes: 1 addition & 1 deletion NetObsBindings/Obs.Version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ namespace ObsInterop;

public static partial class Obs
{
public static readonly Version Version = new Version(29, 1, 3);
public static readonly Version Version = new Version(30, 0, 2);
}
55 changes: 55 additions & 0 deletions NetObsBindings/ObsInterop/Obs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_add_module_path([NativeTypeName("const char *")] sbyte* bin, [NativeTypeName("const char *")] sbyte* data);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_add_safe_module([NativeTypeName("const char *")] sbyte* name);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_load_all_modules();

Expand Down Expand Up @@ -404,6 +407,9 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_add_raw_video_callback([NativeTypeName("const struct video_scale_info *")] video_scale_info* conversion, [NativeTypeName("void (*)(void *, struct video_data *)")] delegate* unmanaged[Cdecl]<void*, video_data*, void> callback, void* param2);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_add_raw_video_callback2([NativeTypeName("const struct video_scale_info *")] video_scale_info* conversion, [NativeTypeName("uint32_t")] uint frame_rate_divisor, [NativeTypeName("void (*)(void *, struct video_data *)")] delegate* unmanaged[Cdecl]<void*, video_data*, void> callback, void* param3);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_remove_raw_video_callback([NativeTypeName("void (*)(void *, struct video_data *)")] delegate* unmanaged[Cdecl]<void*, video_data*, void> callback, void* param1);

Expand Down Expand Up @@ -704,6 +710,12 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_source_filter_set_order([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("obs_source_t *")] obs_source* filter, [NativeTypeName("enum obs_order_movement")] obs_order_movement movement);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern int obs_source_filter_get_index([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("obs_source_t *")] obs_source* filter);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_source_filter_set_index([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("obs_source_t *")] obs_source* filter, [NativeTypeName("size_t")] nuint index);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("obs_data_t *")]
public static extern obs_data* obs_source_get_settings([NativeTypeName("const obs_source_t *")] obs_source* source);
Expand Down Expand Up @@ -864,6 +876,12 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_source_set_push_to_talk_delay([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("uint64_t")] ulong delay);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_source_add_audio_pause_callback([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("signal_callback_t")] delegate* unmanaged[Cdecl]<void*, calldata*, void> callback, void* param2);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_source_remove_audio_pause_callback([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("signal_callback_t")] delegate* unmanaged[Cdecl]<void*, calldata*, void> callback, void* param2);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_source_add_audio_capture_callback([NativeTypeName("obs_source_t *")] obs_source* source, [NativeTypeName("obs_source_audio_capture_t")] delegate* unmanaged[Cdecl]<void*, obs_source*, audio_data*, byte, void> callback, void* param2);

Expand Down Expand Up @@ -1665,13 +1683,20 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_output_set_video_encoder([NativeTypeName("obs_output_t *")] obs_output* output, [NativeTypeName("obs_encoder_t *")] obs_encoder* encoder);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_output_set_video_encoder2([NativeTypeName("obs_output_t *")] obs_output* output, [NativeTypeName("obs_encoder_t *")] obs_encoder* encoder, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_output_set_audio_encoder([NativeTypeName("obs_output_t *")] obs_output* output, [NativeTypeName("obs_encoder_t *")] obs_encoder* encoder, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("obs_encoder_t *")]
public static extern obs_encoder* obs_output_get_video_encoder([NativeTypeName("const obs_output_t *")] obs_output* output);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("obs_encoder_t *")]
public static extern obs_encoder* obs_output_get_video_encoder2([NativeTypeName("const obs_output_t *")] obs_output* output, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("obs_encoder_t *")]
public static extern obs_encoder* obs_output_get_audio_encoder([NativeTypeName("const obs_output_t *")] obs_output* output, [NativeTypeName("size_t")] nuint idx);
Expand Down Expand Up @@ -1699,14 +1724,25 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_output_set_preferred_size([NativeTypeName("obs_output_t *")] obs_output* output, [NativeTypeName("uint32_t")] uint width, [NativeTypeName("uint32_t")] uint height);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_output_set_preferred_size2([NativeTypeName("obs_output_t *")] obs_output* output, [NativeTypeName("uint32_t")] uint width, [NativeTypeName("uint32_t")] uint height, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("uint32_t")]
public static extern uint obs_output_get_width([NativeTypeName("const obs_output_t *")] obs_output* output);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("uint32_t")]
public static extern uint obs_output_get_width2([NativeTypeName("const obs_output_t *")] obs_output* output, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("uint32_t")]
public static extern uint obs_output_get_height([NativeTypeName("const obs_output_t *")] obs_output* output);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("uint32_t")]
public static extern uint obs_output_get_height2([NativeTypeName("const obs_output_t *")] obs_output* output, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("const char *")]
public static extern sbyte* obs_output_get_id([NativeTypeName("const obs_output_t *")] obs_output* output);
Expand Down Expand Up @@ -1870,6 +1906,13 @@ public static unsafe partial class Obs
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_encoder_set_scaled_size([NativeTypeName("obs_encoder_t *")] obs_encoder* encoder, [NativeTypeName("uint32_t")] uint width, [NativeTypeName("uint32_t")] uint height);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_encoder_set_gpu_scale_type([NativeTypeName("obs_encoder_t *")] obs_encoder* encoder, [NativeTypeName("enum obs_scale_type")] obs_scale_type gpu_scale_type);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte obs_encoder_set_frame_rate_divisor([NativeTypeName("obs_encoder_t *")] obs_encoder* encoder, [NativeTypeName("uint32_t")] uint divisor);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte obs_encoder_scaling_enabled([NativeTypeName("const obs_encoder_t *")] obs_encoder* encoder);
Expand All @@ -1882,6 +1925,18 @@ public static unsafe partial class Obs
[return: NativeTypeName("uint32_t")]
public static extern uint obs_encoder_get_height([NativeTypeName("const obs_encoder_t *")] obs_encoder* encoder);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte obs_encoder_gpu_scaling_enabled([NativeTypeName("obs_encoder_t *")] obs_encoder* encoder);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("enum obs_scale_type")]
public static extern obs_scale_type obs_encoder_get_scale_type([NativeTypeName("obs_encoder_t *")] obs_encoder* encoder);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("uint32_t")]
public static extern uint obs_encoder_get_frame_rate_divisor([NativeTypeName("const obs_encoder_t *")] obs_encoder* encoder);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("uint32_t")]
public static extern uint obs_encoder_get_sample_rate([NativeTypeName("const obs_encoder_t *")] obs_encoder* encoder);
Expand Down
6 changes: 0 additions & 6 deletions NetObsBindings/ObsInterop/ObsEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@ public static unsafe partial class ObsEffect
{
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void effect_param_parse_property([NativeTypeName("gs_eparam_t *")] gs_effect_param* param0, [NativeTypeName("const char *")] sbyte* property);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void effect_upload_params([NativeTypeName("gs_effect_t *")] gs_effect* effect, [NativeTypeName("bool")] byte changed_only);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void effect_upload_shader_params([NativeTypeName("gs_effect_t *")] gs_effect* effect, [NativeTypeName("gs_shader_t *")] gs_shader* shader, [NativeTypeName("struct darray *")] darray* pass_params, [NativeTypeName("bool")] byte changed_only);
}
13 changes: 13 additions & 0 deletions NetObsBindings/ObsInterop/ObsFrontendApi.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Runtime.InteropServices;

namespace ObsInterop;
Expand Down Expand Up @@ -98,8 +99,20 @@ public static unsafe partial class ObsFrontendApi
public static extern void obs_frontend_add_tools_menu_item([NativeTypeName("const char *")] sbyte* name, [NativeTypeName("obs_frontend_cb")] delegate* unmanaged[Cdecl]<void*, void> callback, void* private_data);

[DllImport("obs-frontend-api", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[Obsolete]
public static extern void* obs_frontend_add_dock(void* dock);

[DllImport("obs-frontend-api", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte obs_frontend_add_dock_by_id([NativeTypeName("const char *")] sbyte* id, [NativeTypeName("const char *")] sbyte* title, void* widget);

[DllImport("obs-frontend-api", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_frontend_remove_dock([NativeTypeName("const char *")] sbyte* id);

[DllImport("obs-frontend-api", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte obs_frontend_add_custom_qdock([NativeTypeName("const char *")] sbyte* id, void* dock);

[DllImport("obs-frontend-api", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_frontend_add_event_callback([NativeTypeName("obs_frontend_event_cb")] delegate* unmanaged[Cdecl]<obs_frontend_event, void*, void> callback, void* private_data);

Expand Down
4 changes: 4 additions & 0 deletions NetObsBindings/ObsInterop/ObsGraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,10 @@ public static unsafe partial class ObsGraphics
[return: NativeTypeName("uint32_t")]
public static extern uint gs_get_adapter_count();

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte gs_can_adapter_fast_clear();

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("gs_texture_t *")]
public static extern gs_texture* gs_texture_create_gdi([NativeTypeName("uint32_t")] uint width, [NativeTypeName("uint32_t")] uint height);
Expand Down
12 changes: 12 additions & 0 deletions NetObsBindings/ObsInterop/ObsOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ public static unsafe partial class ObsOutput
[NativeTypeName("#define OBS_OUTPUT_CAN_PAUSE (1 << 5)")]
public const int OBS_OUTPUT_CAN_PAUSE = (1 << 5);

[NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK_AUDIO OBS_OUTPUT_MULTI_TRACK")]
public const int OBS_OUTPUT_MULTI_TRACK_AUDIO = (1 << 4);

[NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK_VIDEO (1 << 6)")]
public const int OBS_OUTPUT_MULTI_TRACK_VIDEO = (1 << 6);

[NativeTypeName("#define OBS_OUTPUT_MULTI_TRACK_AV (OBS_OUTPUT_MULTI_TRACK_AUDIO | OBS_OUTPUT_MULTI_TRACK_VIDEO)")]
public const int OBS_OUTPUT_MULTI_TRACK_AV = ((1 << 4) | (1 << 6));

[NativeTypeName("#define MAX_OUTPUT_AUDIO_ENCODERS 6")]
public const int MAX_OUTPUT_AUDIO_ENCODERS = 6;

[NativeTypeName("#define MAX_OUTPUT_VIDEO_ENCODERS 6")]
public const int MAX_OUTPUT_VIDEO_ENCODERS = 6;
}
11 changes: 11 additions & 0 deletions NetObsBindings/ObsInterop/ObsProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ public static unsafe partial class ObsProperties
[return: NativeTypeName("size_t")]
public static extern nuint obs_property_list_add_float([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("const char *")] sbyte* name, double val);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("size_t")]
public static extern nuint obs_property_list_add_bool([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("bool")] byte val);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_property_list_insert_string([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("size_t")] nuint idx, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("const char *")] sbyte* val);

Expand All @@ -286,6 +290,9 @@ public static unsafe partial class ObsProperties
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_property_list_insert_float([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("size_t")] nuint idx, [NativeTypeName("const char *")] sbyte* name, double val);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_property_list_insert_bool([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("size_t")] nuint idx, [NativeTypeName("const char *")] sbyte* name, [NativeTypeName("bool")] byte val);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void obs_property_list_item_disable([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("size_t")] nuint idx, [NativeTypeName("bool")] byte disabled);

Expand Down Expand Up @@ -315,6 +322,10 @@ public static unsafe partial class ObsProperties
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern double obs_property_list_item_float([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte obs_property_list_item_bool([NativeTypeName("obs_property_t *")] obs_property* p, [NativeTypeName("size_t")] nuint idx);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("enum obs_editable_list_type")]
public static extern obs_editable_list_type obs_property_editable_list_type([NativeTypeName("obs_property_t *")] obs_property* p);
Expand Down
11 changes: 11 additions & 0 deletions NetObsBindings/ObsInterop/ObsVideo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public static unsafe partial class ObsVideo
[return: NativeTypeName("bool")]
public static extern byte video_output_connect([NativeTypeName("video_t *")] video_output* video, [NativeTypeName("const struct video_scale_info *")] video_scale_info* conversion, [NativeTypeName("void (*)(void *, struct video_data *)")] delegate* unmanaged[Cdecl]<void*, video_data*, void> callback, void* param3);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("bool")]
public static extern byte video_output_connect2([NativeTypeName("video_t *")] video_output* video, [NativeTypeName("const struct video_scale_info *")] video_scale_info* conversion, [NativeTypeName("uint32_t")] uint frame_rate_divisor, [NativeTypeName("void (*)(void *, struct video_data *)")] delegate* unmanaged[Cdecl]<void*, video_data*, void> callback, void* param4);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void video_output_disconnect([NativeTypeName("video_t *")] video_output* video, [NativeTypeName("void (*)(void *, struct video_data *)")] delegate* unmanaged[Cdecl]<void*, video_data*, void> callback, void* param2);

Expand Down Expand Up @@ -90,6 +94,13 @@ public static unsafe partial class ObsVideo
[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void video_output_inc_texture_skipped_frames([NativeTypeName("video_t *")] video_output* video);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: NativeTypeName("video_t *")]
public static extern video_output* video_output_create_with_frame_rate_divisor([NativeTypeName("video_t *")] video_output* video, [NativeTypeName("uint32_t")] uint divisor);

[DllImport("obs", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void video_output_free_frame_rate_divisor([NativeTypeName("video_t *")] video_output* video);

[NativeTypeName("#define VIDEO_OUTPUT_SUCCESS 0")]
public const int VIDEO_OUTPUT_SUCCESS = 0;

Expand Down
Loading

0 comments on commit 469c168

Please sign in to comment.