Code cleanup, 2022 edition
This commit is contained in:
parent
a5f66216c9
commit
b3ed309192
|
@ -1,8 +1,8 @@
|
||||||
using LinqToDB.Mapping;
|
using LinqToDB.Mapping;
|
||||||
|
|
||||||
namespace RTMPDash.DataModels.Tables {
|
namespace RTMPDash.DataModels.Tables;
|
||||||
[Table(Name = "Invites")]
|
|
||||||
public class Invite {
|
[Table(Name = "Invites")]
|
||||||
|
public class Invite {
|
||||||
[Column(Name = "Code"), PrimaryKey, NotNull] public string Code { get; set; }
|
[Column(Name = "Code"), PrimaryKey, NotNull] public string Code { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class ContentModel : PageModel {
|
|
||||||
|
public class ContentModel : PageModel {
|
||||||
public void OnGet() { }
|
public void OnGet() { }
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class CreditsModel : PageModel {
|
|
||||||
|
public class CreditsModel : PageModel {
|
||||||
public void OnGet() { }
|
public void OnGet() { }
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -2,9 +2,10 @@ using System.Diagnostics;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true), IgnoreAntiforgeryToken]
|
|
||||||
public class ErrorModel : PageModel {
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true), IgnoreAntiforgeryToken]
|
||||||
|
public class ErrorModel : PageModel {
|
||||||
public string RequestId { get; set; }
|
public string RequestId { get; set; }
|
||||||
|
|
||||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||||
|
@ -12,5 +13,4 @@ namespace RTMPDash.Pages {
|
||||||
public void OnGet() {
|
public void OnGet() {
|
||||||
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class IndexModel : PageModel {
|
|
||||||
|
public class IndexModel : PageModel {
|
||||||
public void OnGet() { }
|
public void OnGet() { }
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -8,25 +8,23 @@ using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using RTMPDash.DataModels;
|
using RTMPDash.DataModels;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class LoginModel : PageModel {
|
|
||||||
|
public class LoginModel : PageModel {
|
||||||
public void OnPost() {
|
public void OnPost() {
|
||||||
if (!Request.HasFormContentType
|
if (!Request.HasFormContentType || string.IsNullOrWhiteSpace(Request.Form["user"]) || string.IsNullOrWhiteSpace(Request.Form["pass"]))
|
||||||
|| string.IsNullOrWhiteSpace(Request.Form["user"])
|
|
||||||
|| string.IsNullOrWhiteSpace(Request.Form["pass"]))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using var db = new AppDb.DbConn();
|
using var db = new AppDb.DbConn();
|
||||||
var user = db.Users.FirstOrDefault(p => p.Username == Request.Form["user"].ToString()
|
var user = db.Users.FirstOrDefault(p => p.Username == Request.Form["user"].ToString() && p.Password == Request.Form["pass"].ToString().Sha256());
|
||||||
&& p.Password == Request.Form["pass"].ToString().Sha256());
|
|
||||||
if (user == null)
|
if (user == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
HttpContext.Session.SetString("authenticatedUser", user.Username);
|
HttpContext.Session.SetString("authenticatedUser", user.Username);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class StringExtensions {
|
public static class StringExtensions {
|
||||||
public static string Sha256(this string rawData) {
|
public static string Sha256(this string rawData) {
|
||||||
// Create a SHA256
|
// Create a SHA256
|
||||||
using var sha256Hash = SHA256.Create();
|
using var sha256Hash = SHA256.Create();
|
||||||
|
@ -55,8 +53,7 @@ namespace RTMPDash.Pages {
|
||||||
|
|
||||||
public static string UrlEncode(this string plainText) => HttpUtility.UrlEncode(plainText);
|
public static string UrlEncode(this string plainText) => HttpUtility.UrlEncode(plainText);
|
||||||
|
|
||||||
public static string Delimit(this string input, int max) =>
|
public static string Delimit(this string input, int max) => input.PadRight(max, ' ').Substring(0, max).TrimEnd();
|
||||||
input.PadRight(max, ' ').Substring(0, max).TrimEnd();
|
|
||||||
|
|
||||||
public static string Bash(this string cmd) {
|
public static string Bash(this string cmd) {
|
||||||
var escapedArgs = cmd.Replace("\"", "\\\"");
|
var escapedArgs = cmd.Replace("\"", "\\\"");
|
||||||
|
@ -75,5 +72,4 @@ namespace RTMPDash.Pages {
|
||||||
process.WaitForExit();
|
process.WaitForExit();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,9 +1,9 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class LogoutModel : PageModel {
|
|
||||||
|
public class LogoutModel : PageModel {
|
||||||
public void OnGet() {
|
public void OnGet() {
|
||||||
HttpContext.Session.Clear();
|
HttpContext.Session.Clear();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class PrivacyModel : PageModel {
|
|
||||||
|
public class PrivacyModel : PageModel {
|
||||||
public void OnGet() { }
|
public void OnGet() { }
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class StatsModel : PageModel {
|
|
||||||
|
public class StatsModel : PageModel {
|
||||||
public void OnGet() { }
|
public void OnGet() { }
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
namespace RTMPDash.Pages {
|
namespace RTMPDash.Pages;
|
||||||
public class ProfileModel : PageModel {
|
|
||||||
|
public class ProfileModel : PageModel {
|
||||||
public new string User { get; set; }
|
public new string User { get; set; }
|
||||||
|
|
||||||
public void OnGet(string user) {
|
public void OnGet(string user) {
|
||||||
User = user;
|
User = user;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"iisSettings": {
|
"iisSettings": {
|
||||||
"windowsAuthentication": false,
|
"windowsAuthentication": false,
|
||||||
"anonymousAuthentication": true,
|
"anonymousAuthentication": true
|
||||||
},
|
},
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"RTMPDash": {
|
"RTMPDash": {
|
||||||
|
|
|
@ -6,14 +6,68 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="linq2db" Version="3.2.3" />
|
<PackageReference Include="linq2db" Version="3.2.3"/>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.2"/>
|
||||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1" />
|
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="5.0.1"/>
|
||||||
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.7" />
|
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.7"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_ContentIncludedByDefault Remove="Areas\Identity\Pages\_ViewStart.cshtml" />
|
<_ContentIncludedByDefault Remove="Areas\Identity\Pages\_ViewStart.cshtml"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\css\dark-mode.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\css\site.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\favicon.ico"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\js\dark-mode-switch.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\js\site.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-grid.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-grid.css.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-grid.min.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-grid.min.css.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-reboot.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-reboot.css.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-reboot.min.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap-reboot.min.css.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap.css.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap.min.css"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\css\bootstrap.min.css.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.bundle.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.bundle.js.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.bundle.min.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.bundle.min.js.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.js.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.min.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\dist\js\bootstrap.min.js.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\bootstrap\LICENSE"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation-unobtrusive\jquery.validate.unobtrusive.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation-unobtrusive\jquery.validate.unobtrusive.min.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation-unobtrusive\LICENSE.txt"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation\dist\additional-methods.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation\dist\additional-methods.min.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation\dist\jquery.validate.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation\dist\jquery.validate.min.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery-validation\LICENSE.md"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery\dist\jquery.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery\dist\jquery.min.js"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery\dist\jquery.min.map"/>
|
||||||
|
<_ContentIncludedByDefault Remove="wwwroot\lib\jquery\LICENSE.txt"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="wwwroot\**"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Remove="wwwroot\**"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="wwwroot\**"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Remove="wwwroot\**"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -5,8 +5,9 @@ using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
|
|
||||||
namespace RTMPDash {
|
namespace RTMPDash;
|
||||||
public class Startup {
|
|
||||||
|
public class Startup {
|
||||||
public Startup(IConfiguration configuration) => Configuration = configuration;
|
public Startup(IConfiguration configuration) => Configuration = configuration;
|
||||||
|
|
||||||
public IConfiguration Configuration { get; }
|
public IConfiguration Configuration { get; }
|
||||||
|
@ -61,5 +62,4 @@ namespace RTMPDash {
|
||||||
endpoints.MapControllers();
|
endpoints.MapControllers();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -4,33 +4,26 @@ using System.Net;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using RTMPDash.DataModels;
|
using RTMPDash.DataModels;
|
||||||
|
|
||||||
namespace RTMPDash {
|
namespace RTMPDash;
|
||||||
public static class StreamUtils {
|
|
||||||
|
public static class StreamUtils {
|
||||||
private static readonly XmlSerializer Serializer = new(typeof(StatsObject));
|
private static readonly XmlSerializer Serializer = new(typeof(StatsObject));
|
||||||
|
|
||||||
public static bool IsLive(string user, StatsObject stats) => stats.Server.Applications
|
public static bool IsLive(string user, StatsObject stats) => stats.Server.Applications.First(p => p.Name == "ingress").MethodLive.Streams.Any(p => p.Name == user);
|
||||||
.First(p => p.Name == "ingress")
|
|
||||||
.MethodLive.Streams.Any(p => p.Name == user);
|
|
||||||
|
|
||||||
public static bool IsLive(string user, string target, StatsObject stats) => stats.Server.Applications
|
public static bool IsLive(string user, string target, StatsObject stats) => stats.Server.Applications.First(p => p.Name == "ingress")
|
||||||
.First(p => p.Name == "ingress")
|
|
||||||
.MethodLive.Streams
|
.MethodLive.Streams
|
||||||
.Any(p => p.Name == user && p.Clients.Any(c => c.Address == target.Replace("rtmp://", "")));
|
.Any(p => p.Name == user && p.Clients.Any(c => c.Address == target.Replace("rtmp://", "")));
|
||||||
|
|
||||||
public static long GetClientTime(string user, StatsObject stats) =>
|
public static long GetClientTime(string user, StatsObject stats) =>
|
||||||
long.Parse(stats.Server.Applications.First(p => p.Name == "ingress")
|
long.Parse(stats.Server.Applications.First(p => p.Name == "ingress").MethodLive.Streams.First(p => p.Name == user).Time);
|
||||||
.MethodLive.Streams.First(p => p.Name == user)
|
|
||||||
.Time);
|
|
||||||
|
|
||||||
public static int CountLiveRestreams(string user, StatsObject stats) {
|
public static int CountLiveRestreams(string user, StatsObject stats) {
|
||||||
var db = new AppDb.DbConn();
|
var db = new AppDb.DbConn();
|
||||||
var dbUser = db.Users.First(p => p.Username == user);
|
var dbUser = db.Users.First(p => p.Username == user);
|
||||||
return dbUser.RestreamTargets.Split(",")
|
return dbUser.RestreamTargets.Split(",")
|
||||||
.Count(target => stats.Server.Applications.First(p => p.Name == "ingress")
|
.Count(target => stats.Server.Applications.First(p => p.Name == "ingress")
|
||||||
.MethodLive.Streams
|
.MethodLive.Streams.Any(p => p.Name == user && p.Clients.Any(c => c.Address == target.Replace("rtmp://", ""))));
|
||||||
.Any(p => p.Name == user
|
|
||||||
&& p.Clients.Any(c => c.Address
|
|
||||||
== target.Replace("rtmp://", ""))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int CountLiveRestreams(string user, string privateAccesskey, StatsObject stats) {
|
public static int CountLiveRestreams(string user, string privateAccesskey, StatsObject stats) {
|
||||||
|
@ -38,26 +31,19 @@ namespace RTMPDash {
|
||||||
var dbUser = db.Users.First(p => p.Username == user);
|
var dbUser = db.Users.First(p => p.Username == user);
|
||||||
return dbUser.RestreamTargets.Split(",")
|
return dbUser.RestreamTargets.Split(",")
|
||||||
.Count(target => stats.Server.Applications.First(p => p.Name == "ingress")
|
.Count(target => stats.Server.Applications.First(p => p.Name == "ingress")
|
||||||
.MethodLive.Streams
|
.MethodLive.Streams.Any(p => p.Name == privateAccesskey && p.Clients.Any(c => c.Address == target.Replace("rtmp://", ""))));
|
||||||
.Any(p => p.Name == privateAccesskey
|
|
||||||
&& p.Clients.Any(c => c.Address
|
|
||||||
== target.Replace("rtmp://", ""))));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<string> ListLiveUsers() => GetStatsObject().Server.Applications.First(p => p.Name == "ingress").MethodLive.Streams.Select(p => p.Name).ToList();
|
||||||
public static List<string> ListLiveUsers() => GetStatsObject()
|
|
||||||
.Server.Applications.First(p => p.Name == "ingress")
|
|
||||||
.MethodLive.Streams.Select(p => p.Name)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
public static StatsObject GetStatsObject() {
|
public static StatsObject GetStatsObject() {
|
||||||
var obj = (StatsObject) Serializer.Deserialize(new WebClient().OpenRead("http://127.0.0.1:8080")!);
|
var obj = (StatsObject)Serializer.Deserialize(new WebClient().OpenRead("http://127.0.0.1:8080")!);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "rtmp")]
|
[XmlRoot(ElementName = "rtmp")]
|
||||||
public class StatsObject {
|
public class StatsObject {
|
||||||
[XmlElement(ElementName = "nginx_version", IsNullable = true)]
|
[XmlElement(ElementName = "nginx_version", IsNullable = true)]
|
||||||
public string NginxVersion { get; set; }
|
public string NginxVersion { get; set; }
|
||||||
|
|
||||||
|
@ -73,27 +59,27 @@ namespace RTMPDash {
|
||||||
[XmlElement(ElementName = "bytes_in", IsNullable = true)] public string BytesIn { get; set; }
|
[XmlElement(ElementName = "bytes_in", IsNullable = true)] public string BytesIn { get; set; }
|
||||||
[XmlElement(ElementName = "bw_out", IsNullable = true)] public string BwOut { get; set; }
|
[XmlElement(ElementName = "bw_out", IsNullable = true)] public string BwOut { get; set; }
|
||||||
[XmlElement(ElementName = "bytes_out", IsNullable = true)] public string BytesOut { get; set; }
|
[XmlElement(ElementName = "bytes_out", IsNullable = true)] public string BytesOut { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "server", IsNullable = true)]
|
[XmlRoot(ElementName = "server", IsNullable = true)]
|
||||||
public class Server {
|
public class Server {
|
||||||
[XmlElement(ElementName = "application", IsNullable = true)] public List<Application> Applications { get; set; }
|
[XmlElement(ElementName = "application", IsNullable = true)] public List<Application> Applications { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "application", IsNullable = true)]
|
[XmlRoot(ElementName = "application", IsNullable = true)]
|
||||||
public class Application {
|
public class Application {
|
||||||
[XmlElement(ElementName = "live", IsNullable = true)] public MethodLive MethodLive { get; set; }
|
[XmlElement(ElementName = "live", IsNullable = true)] public MethodLive MethodLive { get; set; }
|
||||||
[XmlElement(ElementName = "name", IsNullable = true)] public string Name { get; set; }
|
[XmlElement(ElementName = "name", IsNullable = true)] public string Name { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "live", IsNullable = true)]
|
[XmlRoot(ElementName = "live", IsNullable = true)]
|
||||||
public class MethodLive {
|
public class MethodLive {
|
||||||
[XmlElement(ElementName = "stream", IsNullable = true)] public List<Stream> Streams { get; set; }
|
[XmlElement(ElementName = "stream", IsNullable = true)] public List<Stream> Streams { get; set; }
|
||||||
[XmlElement(ElementName = "nclients", IsNullable = true)] public string NoClients { get; set; }
|
[XmlElement(ElementName = "nclients", IsNullable = true)] public string NoClients { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "stream", IsNullable = true)]
|
[XmlRoot(ElementName = "stream", IsNullable = true)]
|
||||||
public class Stream {
|
public class Stream {
|
||||||
[XmlElement(ElementName = "client", IsNullable = true)] public List<Client> Clients { get; set; }
|
[XmlElement(ElementName = "client", IsNullable = true)] public List<Client> Clients { get; set; }
|
||||||
[XmlElement(ElementName = "meta", IsNullable = true)] public Meta Meta { get; set; }
|
[XmlElement(ElementName = "meta", IsNullable = true)] public Meta Meta { get; set; }
|
||||||
[XmlElement(ElementName = "name", IsNullable = true)] public string Name { get; set; }
|
[XmlElement(ElementName = "name", IsNullable = true)] public string Name { get; set; }
|
||||||
|
@ -108,10 +94,10 @@ namespace RTMPDash {
|
||||||
[XmlElement(ElementName = "nclients", IsNullable = true)] public string NoClients { get; set; }
|
[XmlElement(ElementName = "nclients", IsNullable = true)] public string NoClients { get; set; }
|
||||||
[XmlElement(ElementName = "active", IsNullable = true)] public object Active { get; set; }
|
[XmlElement(ElementName = "active", IsNullable = true)] public object Active { get; set; }
|
||||||
[XmlElement(ElementName = "publishing", IsNullable = true)] public object Publishing { get; set; }
|
[XmlElement(ElementName = "publishing", IsNullable = true)] public object Publishing { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "client", IsNullable = true)]
|
[XmlRoot(ElementName = "client", IsNullable = true)]
|
||||||
public class Client {
|
public class Client {
|
||||||
[XmlElement(ElementName = "id", IsNullable = true)] public string Id { get; set; }
|
[XmlElement(ElementName = "id", IsNullable = true)] public string Id { get; set; }
|
||||||
[XmlElement(ElementName = "address", IsNullable = true)] public string Address { get; set; }
|
[XmlElement(ElementName = "address", IsNullable = true)] public string Address { get; set; }
|
||||||
[XmlElement(ElementName = "port", IsNullable = true)] public string Port { get; set; }
|
[XmlElement(ElementName = "port", IsNullable = true)] public string Port { get; set; }
|
||||||
|
@ -125,16 +111,16 @@ namespace RTMPDash {
|
||||||
[XmlElement(ElementName = "timestamp", IsNullable = true)] public string Timestamp { get; set; }
|
[XmlElement(ElementName = "timestamp", IsNullable = true)] public string Timestamp { get; set; }
|
||||||
[XmlElement(ElementName = "active", IsNullable = true)] public object Active { get; set; }
|
[XmlElement(ElementName = "active", IsNullable = true)] public object Active { get; set; }
|
||||||
[XmlElement(ElementName = "publishing", IsNullable = true)] public object Publishing { get; set; }
|
[XmlElement(ElementName = "publishing", IsNullable = true)] public object Publishing { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "meta", IsNullable = true)]
|
[XmlRoot(ElementName = "meta", IsNullable = true)]
|
||||||
public class Meta {
|
public class Meta {
|
||||||
[XmlElement(ElementName = "video", IsNullable = true)] public Video Video { get; set; }
|
[XmlElement(ElementName = "video", IsNullable = true)] public Video Video { get; set; }
|
||||||
[XmlElement(ElementName = "audio", IsNullable = true)] public Audio Audio { get; set; }
|
[XmlElement(ElementName = "audio", IsNullable = true)] public Audio Audio { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "video", IsNullable = true)]
|
[XmlRoot(ElementName = "video", IsNullable = true)]
|
||||||
public class Video {
|
public class Video {
|
||||||
[XmlElement(ElementName = "width", IsNullable = true)] public string Width { get; set; }
|
[XmlElement(ElementName = "width", IsNullable = true)] public string Width { get; set; }
|
||||||
[XmlElement(ElementName = "height", IsNullable = true)] public string Height { get; set; }
|
[XmlElement(ElementName = "height", IsNullable = true)] public string Height { get; set; }
|
||||||
[XmlElement(ElementName = "frame_rate", IsNullable = true)] public string FrameRate { get; set; }
|
[XmlElement(ElementName = "frame_rate", IsNullable = true)] public string FrameRate { get; set; }
|
||||||
|
@ -142,13 +128,12 @@ namespace RTMPDash {
|
||||||
[XmlElement(ElementName = "profile", IsNullable = true)] public string Profile { get; set; }
|
[XmlElement(ElementName = "profile", IsNullable = true)] public string Profile { get; set; }
|
||||||
[XmlElement(ElementName = "compat", IsNullable = true)] public string Compat { get; set; }
|
[XmlElement(ElementName = "compat", IsNullable = true)] public string Compat { get; set; }
|
||||||
[XmlElement(ElementName = "level", IsNullable = true)] public string Level { get; set; }
|
[XmlElement(ElementName = "level", IsNullable = true)] public string Level { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[XmlRoot(ElementName = "audio", IsNullable = true)]
|
[XmlRoot(ElementName = "audio", IsNullable = true)]
|
||||||
public class Audio {
|
public class Audio {
|
||||||
[XmlElement(ElementName = "codec", IsNullable = true)] public string Codec { get; set; }
|
[XmlElement(ElementName = "codec", IsNullable = true)] public string Codec { get; set; }
|
||||||
[XmlElement(ElementName = "profile", IsNullable = true)] public string Profile { get; set; }
|
[XmlElement(ElementName = "profile", IsNullable = true)] public string Profile { get; set; }
|
||||||
[XmlElement(ElementName = "channels", IsNullable = true)] public string Channels { get; set; }
|
[XmlElement(ElementName = "channels", IsNullable = true)] public string Channels { get; set; }
|
||||||
[XmlElement(ElementName = "sample_rate", IsNullable = true)] public string SampleRate { get; set; }
|
[XmlElement(ElementName = "sample_rate", IsNullable = true)] public string SampleRate { get; set; }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue