CloudSyncProfile.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. };
  39. ContainerProfiles = new ContainerProfile[] { };
  40. CodecProfiles = new[]
  41. {
  42. new CodecProfile
  43. {
  44. Type = CodecType.Video,
  45. Conditions = new []
  46. {
  47. new ProfileCondition
  48. {
  49. Condition = ProfileConditionType.LessThanEqual,
  50. Property = ProfileConditionValue.VideoBitDepth,
  51. Value = "8",
  52. IsRequired = false
  53. },
  54. new ProfileCondition
  55. {
  56. Condition = ProfileConditionType.LessThanEqual,
  57. Property = ProfileConditionValue.Height,
  58. Value = "1080",
  59. IsRequired = false
  60. },
  61. new ProfileCondition
  62. {
  63. Condition = ProfileConditionType.LessThanEqual,
  64. Property = ProfileConditionValue.RefFrames,
  65. Value = "12",
  66. IsRequired = false
  67. }
  68. }
  69. }
  70. };
  71. SubtitleProfiles = new[]
  72. {
  73. new SubtitleProfile
  74. {
  75. Format = "srt",
  76. Method = SubtitleDeliveryMethod.External
  77. }
  78. };
  79. TranscodingProfiles = new[]
  80. {
  81. new TranscodingProfile
  82. {
  83. Container = "mp3",
  84. AudioCodec = "mp3",
  85. Type = DlnaProfileType.Audio,
  86. Context = EncodingContext.Static
  87. },
  88. new TranscodingProfile
  89. {
  90. Container = "mp4",
  91. Type = DlnaProfileType.Video,
  92. AudioCodec = "aac",
  93. VideoCodec = "h264",
  94. Context = EncodingContext.Static
  95. },
  96. new TranscodingProfile
  97. {
  98. Container = "jpeg",
  99. Type = DlnaProfileType.Photo,
  100. Context = EncodingContext.Static
  101. }
  102. };
  103. }
  104. }
  105. }