From 0e63c4a2c6dec8dfa260501fb7d73750261ea7b7 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sat, 25 Nov 2023 18:39:02 +0800 Subject: + init --- Assembly_Firstpass/Steamworks/SteamVideo.cs | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Assembly_Firstpass/Steamworks/SteamVideo.cs (limited to 'Assembly_Firstpass/Steamworks/SteamVideo.cs') diff --git a/Assembly_Firstpass/Steamworks/SteamVideo.cs b/Assembly_Firstpass/Steamworks/SteamVideo.cs new file mode 100644 index 0000000..9c8d287 --- /dev/null +++ b/Assembly_Firstpass/Steamworks/SteamVideo.cs @@ -0,0 +1,35 @@ +using System; +using System.Runtime.InteropServices; + +namespace Steamworks; + +public static class SteamVideo +{ + public static void GetVideoURL(AppId_t unVideoAppID) + { + InteropHelp.TestIfAvailableClient(); + NativeMethods.ISteamVideo_GetVideoURL(CSteamAPIContext.GetSteamVideo(), unVideoAppID); + } + + public static bool IsBroadcasting(out int pnNumViewers) + { + InteropHelp.TestIfAvailableClient(); + return NativeMethods.ISteamVideo_IsBroadcasting(CSteamAPIContext.GetSteamVideo(), out pnNumViewers); + } + + public static void GetOPFSettings(AppId_t unVideoAppID) + { + InteropHelp.TestIfAvailableClient(); + NativeMethods.ISteamVideo_GetOPFSettings(CSteamAPIContext.GetSteamVideo(), unVideoAppID); + } + + public static bool GetOPFStringForApp(AppId_t unVideoAppID, out string pchBuffer, ref int pnBufferSize) + { + InteropHelp.TestIfAvailableClient(); + IntPtr intPtr = Marshal.AllocHGlobal(pnBufferSize); + bool flag = NativeMethods.ISteamVideo_GetOPFStringForApp(CSteamAPIContext.GetSteamVideo(), unVideoAppID, intPtr, ref pnBufferSize); + pchBuffer = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null); + Marshal.FreeHGlobal(intPtr); + return flag; + } +} -- cgit v1.1-26-g67d0