isteamvideo.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // This file is provided under The MIT License as part of Steamworks.NET.
  2. // Copyright (c) 2013-2019 Riley Labrecque
  3. // Please see the included LICENSE.txt for additional information.
  4. // This file is automatically generated.
  5. // Changes to this file will be reverted when you update Steamworks.NET
  6. #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
  7. #define DISABLESTEAMWORKS
  8. #endif
  9. #if !DISABLESTEAMWORKS
  10. using System.Runtime.InteropServices;
  11. using IntPtr = System.IntPtr;
  12. namespace Steamworks {
  13. public static class SteamVideo {
  14. /// <summary>
  15. /// <para> Get a URL suitable for streaming the given Video app ID's video</para>
  16. /// </summary>
  17. public static void GetVideoURL(AppId_t unVideoAppID) {
  18. InteropHelp.TestIfAvailableClient();
  19. NativeMethods.ISteamVideo_GetVideoURL(CSteamAPIContext.GetSteamVideo(), unVideoAppID);
  20. }
  21. /// <summary>
  22. /// <para> returns true if user is uploading a live broadcast</para>
  23. /// </summary>
  24. public static bool IsBroadcasting(out int pnNumViewers) {
  25. InteropHelp.TestIfAvailableClient();
  26. return NativeMethods.ISteamVideo_IsBroadcasting(CSteamAPIContext.GetSteamVideo(), out pnNumViewers);
  27. }
  28. /// <summary>
  29. /// <para> Get the OPF Details for 360 Video Playback</para>
  30. /// </summary>
  31. public static void GetOPFSettings(AppId_t unVideoAppID) {
  32. InteropHelp.TestIfAvailableClient();
  33. NativeMethods.ISteamVideo_GetOPFSettings(CSteamAPIContext.GetSteamVideo(), unVideoAppID);
  34. }
  35. public static bool GetOPFStringForApp(AppId_t unVideoAppID, out string pchBuffer, ref int pnBufferSize) {
  36. InteropHelp.TestIfAvailableClient();
  37. IntPtr pchBuffer2 = Marshal.AllocHGlobal((int)pnBufferSize);
  38. bool ret = NativeMethods.ISteamVideo_GetOPFStringForApp(CSteamAPIContext.GetSteamVideo(), unVideoAppID, pchBuffer2, ref pnBufferSize);
  39. pchBuffer = ret ? InteropHelp.PtrToStringUTF8(pchBuffer2) : null;
  40. Marshal.FreeHGlobal(pchBuffer2);
  41. return ret;
  42. }
  43. }
  44. }
  45. #endif // !DISABLESTEAMWORKS