PlayToConfiguration.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. namespace MediaBrowser.Dlna.PlayTo.Configuration
  2. {
  3. public class PlayToConfiguration
  4. {
  5. private static readonly string[] _supportedStaticFormats = { "mp3", "flac", "m4a", "wma", "avi", "mp4", "mkv", "ts" };
  6. public static string[] SupportedStaticFormats
  7. {
  8. get
  9. {
  10. return _supportedStaticFormats;
  11. }
  12. }
  13. private static readonly DlnaProfile[] _profiles = GetDefaultProfiles();
  14. public static DlnaProfile[] Profiles
  15. {
  16. get
  17. {
  18. return _profiles;
  19. }
  20. }
  21. private static DlnaProfile[] GetDefaultProfiles()
  22. {
  23. var profile0 = new DlnaProfile
  24. {
  25. Name = "Samsung TV (B Series) [Profile]",
  26. ClientType = "DLNA",
  27. FriendlyName = "^TV$",
  28. ModelNumber = @"1\.0",
  29. ModelName = "Samsung DTV DMR",
  30. TranscodeSettings = new[]
  31. {
  32. new TranscodeSettings {Container = "mkv", MimeType = "x-mkv"},
  33. new TranscodeSettings {Container = "flac", TargetContainer = "mp3"},
  34. new TranscodeSettings {Container = "m4a", TargetContainer = "mp3"}
  35. }
  36. };
  37. var profile1 = new DlnaProfile
  38. {
  39. Name = "Samsung TV (E/F-series) [Profile]",
  40. ClientType = "DLNA",
  41. FriendlyName = @"(^\[TV\][A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung",
  42. ModelNumber = @"(1\.0)|(AllShare1\.0)",
  43. TranscodeSettings = new[]
  44. {
  45. new TranscodeSettings {Container = "mkv", MimeType = "x-mkv"},
  46. new TranscodeSettings {Container = "flac", TargetContainer = "mp3"},
  47. new TranscodeSettings {Container = "m4a", TargetContainer = "mp3"}
  48. }
  49. };
  50. var profile2 = new DlnaProfile
  51. {
  52. Name = "Samsung TV (C/D-series) [Profile]",
  53. ClientType = "DLNA",
  54. FriendlyName = @"(^TV-\d{2}C\d{3}.*)|(^\[TV\][A-Z]{2}\d{2}(D)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung",
  55. ModelNumber = @"(1\.0)|(AllShare1\.0)",
  56. TranscodeSettings = new[]
  57. {
  58. new TranscodeSettings {Container = "mkv", MimeType = "x-mkv"},
  59. new TranscodeSettings {Container = "flac", TargetContainer = "mp3"},
  60. new TranscodeSettings {Container = "m4a", TargetContainer = "mp3"}
  61. }
  62. };
  63. var profile3 = new DlnaProfile
  64. {
  65. Name = "Xbox 360 [Profile]",
  66. ClientType = "DLNA",
  67. ModelName = "Xbox 360",
  68. TranscodeSettings = new[]
  69. {
  70. new TranscodeSettings {Container = "mkv", TargetContainer = "ts"},
  71. new TranscodeSettings {Container = "flac", TargetContainer = "mp3"},
  72. new TranscodeSettings {Container = "m4a", TargetContainer = "mp3"}
  73. }
  74. };
  75. var profile4 = new DlnaProfile
  76. {
  77. Name = "Xbox One [Profile]",
  78. ModelName = "Xbox One",
  79. ClientType = "DLNA",
  80. FriendlyName = "Xbox-SystemOS",
  81. TranscodeSettings = new[]
  82. {
  83. new TranscodeSettings {Container = "mkv", TargetContainer = "ts"},
  84. new TranscodeSettings {Container = "flac", TargetContainer = "mp3"},
  85. new TranscodeSettings {Container = "m4a", TargetContainer = "mp3"}
  86. }
  87. };
  88. var profile5 = new DlnaProfile
  89. {
  90. Name = "Sony Bravia TV (2012)",
  91. ClientType = "TV",
  92. FriendlyName = @"BRAVIA KDL-\d{2}[A-Z]X\d5(\d|G).*",
  93. TranscodeSettings = TranscodeSettings.GetDefaultTranscodingSettings()
  94. };
  95. //WDTV does not need any transcoding of the formats we support statically
  96. var profile6 = new DlnaProfile
  97. {
  98. Name = "WDTV Live [Profile]",
  99. ClientType = "DLNA",
  100. ModelName = "WD TV HD Live",
  101. TranscodeSettings = new TranscodeSettings[] { }
  102. };
  103. var profile7 = new DlnaProfile
  104. {
  105. //Linksys DMA2100us does not need any transcoding of the formats we support statically
  106. Name = "Linksys DMA2100 [Profile]",
  107. ClientType = "DLNA",
  108. ModelName = "DMA2100us",
  109. TranscodeSettings = new TranscodeSettings[] { }
  110. };
  111. return new[]
  112. {
  113. profile0,
  114. profile1,
  115. profile2,
  116. profile3,
  117. profile4,
  118. profile5,
  119. profile6,
  120. profile7
  121. };
  122. }
  123. }
  124. }