CloudSyncProfile.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using MediaBrowser.Model.Dlna;
  2. namespace MediaBrowser.Server.Implementations.Sync
  3. {
  4. public class CloudSyncProfile : DeviceProfile
  5. {
  6. public CloudSyncProfile(bool supportsAc3, bool supportsDca)
  7. {
  8. Name = "Cloud Sync";
  9. MaxStreamingBitrate = 20000000;
  10. MaxStaticBitrate = 20000000;
  11. var mkvAudio = "aac,mp3";
  12. var mp4Audio = "aac";
  13. if (supportsAc3)
  14. {
  15. mkvAudio += ",ac3";
  16. mp4Audio += ",ac3";
  17. }
  18. if (supportsDca)
  19. {
  20. mkvAudio += ",dca";
  21. }
  22. DirectPlayProfiles = new[]
  23. {
  24. new DirectPlayProfile
  25. {
  26. Container = "mkv",
  27. VideoCodec = "h264,mpeg4",
  28. AudioCodec = mkvAudio,
  29. Type = DlnaProfileType.Video
  30. },
  31. new DirectPlayProfile
  32. {
  33. Container = "mp4,mov,m4v",
  34. VideoCodec = "h264,mpeg4",
  35. AudioCodec = mp4Audio,
  36. Type = DlnaProfileType.Video
  37. },
  38. new DirectPlayProfile
  39. {
  40. Container = "mp3",
  41. Type = DlnaProfileType.Audio
  42. }
  43. };
  44. ContainerProfiles = new ContainerProfile[] { };
  45. CodecProfiles = new[]
  46. {
  47. new CodecProfile
  48. {
  49. Type = CodecType.Video,
  50. Conditions = new []
  51. {
  52. new ProfileCondition
  53. {
  54. Condition = ProfileConditionType.LessThanEqual,
  55. Property = ProfileConditionValue.VideoBitDepth,
  56. Value = "8",
  57. IsRequired = false
  58. },
  59. new ProfileCondition
  60. {
  61. Condition = ProfileConditionType.LessThanEqual,
  62. Property = ProfileConditionValue.Height,
  63. Value = "1080",
  64. IsRequired = false
  65. },
  66. new ProfileCondition
  67. {
  68. Condition = ProfileConditionType.LessThanEqual,
  69. Property = ProfileConditionValue.RefFrames,
  70. Value = "12",
  71. IsRequired = false
  72. }
  73. }
  74. }
  75. };
  76. SubtitleProfiles = new[]
  77. {
  78. new SubtitleProfile
  79. {
  80. Format = "srt",
  81. Method = SubtitleDeliveryMethod.External
  82. }
  83. };
  84. TranscodingProfiles = new[]
  85. {
  86. new TranscodingProfile
  87. {
  88. Container = "mp3",
  89. AudioCodec = "mp3",
  90. Type = DlnaProfileType.Audio,
  91. Context = EncodingContext.Static
  92. },
  93. new TranscodingProfile
  94. {
  95. Container = "mp4",
  96. Type = DlnaProfileType.Video,
  97. AudioCodec = "aac",
  98. VideoCodec = "h264",
  99. Context = EncodingContext.Static
  100. },
  101. new TranscodingProfile
  102. {
  103. Container = "jpeg",
  104. Type = DlnaProfileType.Photo,
  105. Context = EncodingContext.Static
  106. }
  107. };
  108. }
  109. }
  110. }