LiveVideoEventArgs.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System;
  2. using Vinno.IUS.Common.Network.Leaf;
  3. using Vinno.vCloud.Protocol.Infrastructures;
  4. namespace Vinno.vCloud.Common.FIS.LiveVideos
  5. {
  6. public enum LiveVideoCommandType
  7. {
  8. Start, //Start push live video stream
  9. Stop //Stop push live video stream
  10. }
  11. public class ChannelData
  12. {
  13. /// <summary>
  14. /// Gets the channel id of the liveVideo channel.
  15. /// </summary>
  16. public string ChannelId { get; }
  17. /// <summary>
  18. /// Gets the url of the channel, usually is a rtmp url.
  19. /// </summary>
  20. public string Url { get; }
  21. public ChannelData(string id, string url)
  22. {
  23. ChannelId = id;
  24. Url = url;
  25. }
  26. }
  27. public class LiveVideoEventArgs : EventArgs
  28. {
  29. private readonly ClientLeaf _leaf;
  30. private string _terminalName;
  31. /// <summary>
  32. /// the viewer login source
  33. /// </summary>
  34. private readonly LoginSource _userSource;
  35. /// <summary>
  36. /// terminal login source
  37. /// </summary>
  38. private readonly LoginSource _terminalSource;
  39. /// <summary>
  40. /// Gets the terminal id which belongs to the target terminal.
  41. /// </summary>
  42. public string TerminalId { get; }
  43. /// <summary>
  44. /// Gets the user's id which send this command.
  45. /// </summary>
  46. public string UserId { get; }
  47. /// <summary>
  48. /// channel for terminal
  49. /// </summary>
  50. public ChannelData TerminalChannel { get; }
  51. /// <summary>
  52. /// channel for camera
  53. /// </summary>
  54. public ChannelData CammeraChannel { get; }
  55. /// <summary>
  56. /// Channel url for combination
  57. /// </summary>
  58. public string CombinationUrl { get; set; }
  59. /// <summary>
  60. /// Gets the command type of this event args.
  61. /// </summary>
  62. public LiveVideoCommandType CommandType { get; }
  63. public string LogPath { get; }
  64. internal LiveVideoEventArgs(ClientLeaf leaf, string terminalId, string userId, LoginSource userSource, LoginSource terminalSource, ChannelData terminalChannel, ChannelData cammeraChannel, LiveVideoCommandType commandType, string terminalName, string logPath = "")
  65. {
  66. _leaf = leaf;
  67. TerminalId = terminalId;
  68. UserId = userId;
  69. _userSource = userSource;
  70. _terminalSource = terminalSource;
  71. TerminalChannel = terminalChannel;
  72. CammeraChannel = cammeraChannel;
  73. CommandType = commandType;
  74. LogPath = logPath;
  75. _terminalName = terminalName;
  76. }
  77. internal LiveVideoEventArgs(ClientLeaf leaf, string terminalId, string userId, LoginSource terminalSource, LiveVideoCommandType commandType)
  78. {
  79. _leaf = leaf;
  80. TerminalId = terminalId;
  81. UserId = userId;
  82. _terminalSource = terminalSource;
  83. CommandType = commandType;
  84. }
  85. }
  86. }