瀏覽代碼

add new device profiles

Luke Pulverenti 11 年之前
父節點
當前提交
87aee1625d

+ 4 - 5
MediaBrowser.Api/SearchService.cs

@@ -1,5 +1,4 @@
-using System;
-using MediaBrowser.Controller.Drawing;
+using MediaBrowser.Controller.Drawing;
 using MediaBrowser.Controller.Dto;
 using MediaBrowser.Controller.Dto;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Entities.Audio;
 using MediaBrowser.Controller.Entities.Audio;
@@ -8,6 +7,7 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Search;
 using MediaBrowser.Model.Search;
 using ServiceStack;
 using ServiceStack;
+using System;
 using System.Linq;
 using System.Linq;
 using System.Threading.Tasks;
 using System.Threading.Tasks;
 
 
@@ -16,8 +16,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class GetSearchHints
     /// Class GetSearchHints
     /// </summary>
     /// </summary>
-    [Route("/Search/Hints", "GET")]
-    [Api(Description = "Gets search hints based on a search term")]
+    [Route("/Search/Hints", "GET", Summary = "Gets search hints based on a search term")]
     public class GetSearchHints : IReturn<SearchHintResult>
     public class GetSearchHints : IReturn<SearchHintResult>
     {
     {
         /// <summary>
         /// <summary>
@@ -66,7 +65,7 @@ namespace MediaBrowser.Api
 
 
         [ApiMember(Name = "IncludeItemTypes", Description = "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
         [ApiMember(Name = "IncludeItemTypes", Description = "Optional. If specified, results will be filtered based on item type. This allows multiple, comma delimeted.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET", AllowMultiple = true)]
         public string IncludeItemTypes { get; set; }
         public string IncludeItemTypes { get; set; }
-        
+
         public GetSearchHints()
         public GetSearchHints()
         {
         {
             IncludeArtists = true;
             IncludeArtists = true;

+ 9 - 18
MediaBrowser.Api/SessionsService.cs

@@ -14,8 +14,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class GetSessions
     /// Class GetSessions
     /// </summary>
     /// </summary>
-    [Route("/Sessions", "GET")]
-    [Api(("Gets a list of sessions"))]
+    [Route("/Sessions", "GET", Summary = "Gets a list of sessions")]
     public class GetSessions : IReturn<List<SessionInfoDto>>
     public class GetSessions : IReturn<List<SessionInfoDto>>
     {
     {
         /// <summary>
         /// <summary>
@@ -35,8 +34,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class BrowseTo
     /// Class BrowseTo
     /// </summary>
     /// </summary>
-    [Route("/Sessions/{Id}/Viewing", "POST")]
-    [Api(("Instructs a session to browse to an item or view"))]
+    [Route("/Sessions/{Id}/Viewing", "POST", Summary = "Instructs a session to browse to an item or view")]
     public class BrowseTo : IReturnVoid
     public class BrowseTo : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -77,8 +75,7 @@ namespace MediaBrowser.Api
         public string Context { get; set; }
         public string Context { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/Playing", "POST")]
-    [Api(("Instructs a session to play an item"))]
+    [Route("/Sessions/{Id}/Playing", "POST", Summary = "Instructs a session to play an item")]
     public class Play : IReturnVoid
     public class Play : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -110,8 +107,7 @@ namespace MediaBrowser.Api
         public PlayCommand PlayCommand { get; set; }
         public PlayCommand PlayCommand { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/Playing/{Command}", "POST")]
-    [Api(("Issues a playstate command to a client"))]
+    [Route("/Sessions/{Id}/Playing/{Command}", "POST", Summary = "Issues a playstate command to a client")]
     public class SendPlaystateCommand : IReturnVoid
     public class SendPlaystateCommand : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -135,8 +131,7 @@ namespace MediaBrowser.Api
         public PlaystateCommand Command { get; set; }
         public PlaystateCommand Command { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/System/{Command}", "POST")]
-    [Api(("Issues a system command to a client"))]
+    [Route("/Sessions/{Id}/System/{Command}", "POST", Summary = "Issues a system command to a client")]
     public class SendSystemCommand : IReturnVoid
     public class SendSystemCommand : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -154,8 +149,7 @@ namespace MediaBrowser.Api
         public SystemCommand Command { get; set; }
         public SystemCommand Command { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/Message", "POST")]
-    [Api(("Issues a command to a client to display a message to the user"))]
+    [Route("/Sessions/{Id}/Message", "POST", Summary = "Issues a command to a client to display a message to the user")]
     public class SendMessageCommand : IReturnVoid
     public class SendMessageCommand : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -175,8 +169,7 @@ namespace MediaBrowser.Api
         public long? TimeoutMs { get; set; }
         public long? TimeoutMs { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/Users/{UserId}", "POST")]
-    [Api(("Adds an additional user to a session"))]
+    [Route("/Sessions/{Id}/Users/{UserId}", "POST", Summary = "Adds an additional user to a session")]
     public class AddUserToSession : IReturnVoid
     public class AddUserToSession : IReturnVoid
     {
     {
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
@@ -186,8 +179,7 @@ namespace MediaBrowser.Api
         public Guid UserId { get; set; }
         public Guid UserId { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/Users/{UserId}", "DELETE")]
-    [Api(("Removes an additional user from a session"))]
+    [Route("/Sessions/{Id}/Users/{UserId}", "DELETE", Summary = "Removes an additional user from a session")]
     public class RemoveUserFromSession : IReturnVoid
     public class RemoveUserFromSession : IReturnVoid
     {
     {
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
         [ApiMember(Name = "Id", Description = "Session Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "POST")]
@@ -197,8 +189,7 @@ namespace MediaBrowser.Api
         public Guid UserId { get; set; }
         public Guid UserId { get; set; }
     }
     }
 
 
-    [Route("/Sessions/{Id}/Capabilities", "POST")]
-    [Api(("Updates capabilities for a device"))]
+    [Route("/Sessions/{Id}/Capabilities", "POST", Summary = "Updates capabilities for a device")]
     public class PostCapabilities : IReturnVoid
     public class PostCapabilities : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>

+ 4 - 7
MediaBrowser.Api/SystemService.cs

@@ -8,8 +8,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class GetSystemInfo
     /// Class GetSystemInfo
     /// </summary>
     /// </summary>
-    [Route("/System/Info", "GET")]
-    [Api(Description = "Gets information about the server")]
+    [Route("/System/Info", "GET", Summary = "Gets information about the server")]
     public class GetSystemInfo : IReturn<SystemInfo>
     public class GetSystemInfo : IReturn<SystemInfo>
     {
     {
 
 
@@ -18,18 +17,16 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class RestartApplication
     /// Class RestartApplication
     /// </summary>
     /// </summary>
-    [Route("/System/Restart", "POST")]
-    [Api(("Restarts the application, if needed"))]
+    [Route("/System/Restart", "POST", Summary = "Restarts the application, if needed")]
     public class RestartApplication
     public class RestartApplication
     {
     {
     }
     }
 
 
-    [Route("/System/Shutdown", "POST")]
-    [Api(("Shuts down the application"))]
+    [Route("/System/Shutdown", "POST", Summary = "Shuts down the application")]
     public class ShutdownApplication
     public class ShutdownApplication
     {
     {
     }
     }
-    
+
     /// <summary>
     /// <summary>
     /// Class SystemInfoService
     /// Class SystemInfoService
     /// </summary>
     /// </summary>

+ 6 - 11
MediaBrowser.Api/TvShowsService.cs

@@ -17,8 +17,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class GetNextUpEpisodes
     /// Class GetNextUpEpisodes
     /// </summary>
     /// </summary>
-    [Route("/Shows/NextUp", "GET")]
-    [Api(("Gets a list of next up episodes"))]
+    [Route("/Shows/NextUp", "GET", Summary = "Gets a list of next up episodes")]
     public class GetNextUpEpisodes : IReturn<ItemsResult>, IHasItemFields
     public class GetNextUpEpisodes : IReturn<ItemsResult>, IHasItemFields
     {
     {
         /// <summary>
         /// <summary>
@@ -53,8 +52,7 @@ namespace MediaBrowser.Api
         public string SeriesId { get; set; }
         public string SeriesId { get; set; }
     }
     }
 
 
-    [Route("/Shows/Upcoming", "GET")]
-    [Api(("Gets a list of upcoming episodes"))]
+    [Route("/Shows/Upcoming", "GET", Summary = "Gets a list of upcoming episodes")]
     public class GetUpcomingEpisodes : IReturn<ItemsResult>, IHasItemFields
     public class GetUpcomingEpisodes : IReturn<ItemsResult>, IHasItemFields
     {
     {
         /// <summary>
         /// <summary>
@@ -86,14 +84,12 @@ namespace MediaBrowser.Api
         public string Fields { get; set; }
         public string Fields { get; set; }
     }
     }
 
 
-    [Route("/Shows/{Id}/Similar", "GET")]
-    [Api(Description = "Finds tv shows similar to a given one.")]
+    [Route("/Shows/{Id}/Similar", "GET", Summary = "Finds tv shows similar to a given one.")]
     public class GetSimilarShows : BaseGetSimilarItemsFromItem
     public class GetSimilarShows : BaseGetSimilarItemsFromItem
     {
     {
     }
     }
 
 
-    [Route("/Shows/{Id}/Episodes", "GET")]
-    [Api(Description = "Gets episodes for a tv season")]
+    [Route("/Shows/{Id}/Episodes", "GET", Summary = "Gets episodes for a tv season")]
     public class GetEpisodes : IReturn<ItemsResult>, IHasItemFields
     public class GetEpisodes : IReturn<ItemsResult>, IHasItemFields
     {
     {
         /// <summary>
         /// <summary>
@@ -129,8 +125,7 @@ namespace MediaBrowser.Api
         public string AdjacentTo { get; set; }
         public string AdjacentTo { get; set; }
     }
     }
 
 
-    [Route("/Shows/{Id}/Seasons", "GET")]
-    [Api(Description = "Gets seasons for a tv series")]
+    [Route("/Shows/{Id}/Seasons", "GET", Summary = "Gets seasons for a tv series")]
     public class GetSeasons : IReturn<ItemsResult>, IHasItemFields
     public class GetSeasons : IReturn<ItemsResult>, IHasItemFields
     {
     {
         /// <summary>
         /// <summary>
@@ -320,7 +315,7 @@ namespace MediaBrowser.Api
 
 
                     return 0;
                     return 0;
                 })
                 })
-                .ThenByDescending(i =>i.Item2)
+                .ThenByDescending(i => i.Item2)
                 .ThenByDescending(i => i.Item1.PremiereDate ?? DateTime.MinValue)
                 .ThenByDescending(i => i.Item1.PremiereDate ?? DateTime.MinValue)
                 .Select(i => i.Item1);
                 .Select(i => i.Item1);
         }
         }

+ 9 - 18
MediaBrowser.Api/UserService.cs

@@ -17,8 +17,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class GetUsers
     /// Class GetUsers
     /// </summary>
     /// </summary>
-    [Route("/Users", "GET")]
-    [Api(Description = "Gets a list of users")]
+    [Route("/Users", "GET", Summary = "Gets a list of users")]
     public class GetUsers : IReturn<List<UserDto>>
     public class GetUsers : IReturn<List<UserDto>>
     {
     {
         [ApiMember(Name = "IsHidden", Description = "Optional filter by IsHidden=true or false", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
         [ApiMember(Name = "IsHidden", Description = "Optional filter by IsHidden=true or false", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "GET")]
@@ -28,8 +27,7 @@ namespace MediaBrowser.Api
         public bool? IsDisabled { get; set; }
         public bool? IsDisabled { get; set; }
     }
     }
 
 
-    [Route("/Users/Public", "GET")]
-    [Api(Description = "Gets a list of publicly visible users for display on a login screen.")]
+    [Route("/Users/Public", "GET", Summary = "Gets a list of publicly visible users for display on a login screen.")]
     public class GetPublicUsers : IReturn<List<UserDto>>
     public class GetPublicUsers : IReturn<List<UserDto>>
     {
     {
     }
     }
@@ -37,8 +35,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class GetUser
     /// Class GetUser
     /// </summary>
     /// </summary>
-    [Route("/Users/{Id}", "GET")]
-    [Api(Description = "Gets a user by Id")]
+    [Route("/Users/{Id}", "GET", Summary = "Gets a user by Id")]
     public class GetUser : IReturn<UserDto>
     public class GetUser : IReturn<UserDto>
     {
     {
         /// <summary>
         /// <summary>
@@ -52,8 +49,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class DeleteUser
     /// Class DeleteUser
     /// </summary>
     /// </summary>
-    [Route("/Users/{Id}", "DELETE")]
-    [Api(Description = "Deletes a user")]
+    [Route("/Users/{Id}", "DELETE", Summary = "Deletes a user")]
     public class DeleteUser : IReturnVoid
     public class DeleteUser : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -67,8 +63,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class AuthenticateUser
     /// Class AuthenticateUser
     /// </summary>
     /// </summary>
-    [Route("/Users/{Id}/Authenticate", "POST")]
-    [Api(Description = "Authenticates a user")]
+    [Route("/Users/{Id}/Authenticate", "POST", Summary = "Authenticates a user")]
     public class AuthenticateUser : IReturn<AuthenticationResult>
     public class AuthenticateUser : IReturn<AuthenticationResult>
     {
     {
         /// <summary>
         /// <summary>
@@ -89,8 +84,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class AuthenticateUser
     /// Class AuthenticateUser
     /// </summary>
     /// </summary>
-    [Route("/Users/AuthenticateByName", "POST")]
-    [Api(Description = "Authenticates a user")]
+    [Route("/Users/AuthenticateByName", "POST", Summary = "Authenticates a user")]
     public class AuthenticateUserByName : IReturn<AuthenticationResult>
     public class AuthenticateUserByName : IReturn<AuthenticationResult>
     {
     {
         /// <summary>
         /// <summary>
@@ -111,8 +105,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class UpdateUserPassword
     /// Class UpdateUserPassword
     /// </summary>
     /// </summary>
-    [Route("/Users/{Id}/Password", "POST")]
-    [Api(Description = "Updates a user's password")]
+    [Route("/Users/{Id}/Password", "POST", Summary = "Updates a user's password")]
     public class UpdateUserPassword : IReturnVoid
     public class UpdateUserPassword : IReturnVoid
     {
     {
         /// <summary>
         /// <summary>
@@ -143,8 +136,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class UpdateUser
     /// Class UpdateUser
     /// </summary>
     /// </summary>
-    [Route("/Users/{Id}", "POST")]
-    [Api(Description = "Updates a user")]
+    [Route("/Users/{Id}", "POST", Summary = "Updates a user")]
     public class UpdateUser : UserDto, IReturnVoid
     public class UpdateUser : UserDto, IReturnVoid
     {
     {
     }
     }
@@ -152,8 +144,7 @@ namespace MediaBrowser.Api
     /// <summary>
     /// <summary>
     /// Class CreateUser
     /// Class CreateUser
     /// </summary>
     /// </summary>
-    [Route("/Users", "POST")]
-    [Api(Description = "Creates a user")]
+    [Route("/Users", "POST", Summary = "Creates a user")]
     public class CreateUser : UserDto, IReturn<UserDto>
     public class CreateUser : UserDto, IReturn<UserDto>
     {
     {
     }
     }

+ 3 - 1
MediaBrowser.Controller/Dlna/CodecProfile.cs

@@ -61,6 +61,8 @@ namespace MediaBrowser.Controller.Dlna
         VideoBitrate,
         VideoBitrate,
         VideoFramerate,
         VideoFramerate,
         VideoLevel,
         VideoLevel,
-        VideoProfile
+        VideoPacketLength,
+        VideoProfile,
+        VideoTimestamp
     }
     }
 }
 }

+ 7 - 0
MediaBrowser.Controller/Dlna/MediaProfile.cs

@@ -13,6 +13,13 @@ namespace MediaBrowser.Controller.Dlna
         public string OrgPn { get; set; }
         public string OrgPn { get; set; }
         public string MimeType { get; set; }
         public string MimeType { get; set; }
 
 
+        public ProfileCondition[] Conditions { get; set; }
+
+        public MediaProfile()
+        {
+            Conditions = new ProfileCondition[] {};
+        }
+        
         public List<string> GetAudioCodecs()
         public List<string> GetAudioCodecs()
         {
         {
             return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
             return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();

+ 5 - 0
MediaBrowser.Dlna/DlnaManager.cs

@@ -34,6 +34,8 @@ namespace MediaBrowser.Dlna
             list.Add(new Xbox360Profile());
             list.Add(new Xbox360Profile());
 
 
             list.Add(new XboxOneProfile());
             list.Add(new XboxOneProfile());
+
+            list.Add(new SonyPs3Profile());
             
             
             list.Add(new SonyBravia2010Profile());
             list.Add(new SonyBravia2010Profile());
 
 
@@ -43,6 +45,9 @@ namespace MediaBrowser.Dlna
 
 
             list.Add(new SonyBravia2013Profile());
             list.Add(new SonyBravia2013Profile());
 
 
+            list.Add(new SonyBlurayPlayer2013Profile());
+            list.Add(new SonyBlurayPlayerProfile());
+     
             list.Add(new PanasonicVieraProfile());
             list.Add(new PanasonicVieraProfile());
 
 
             list.Add(new WdtvLiveProfile());
             list.Add(new WdtvLiveProfile());

+ 3 - 0
MediaBrowser.Dlna/MediaBrowser.Dlna.csproj

@@ -86,10 +86,13 @@
     <Compile Include="Profiles\LinksysDMA2100Profile.cs" />
     <Compile Include="Profiles\LinksysDMA2100Profile.cs" />
     <Compile Include="Profiles\PanasonicVieraProfile.cs" />
     <Compile Include="Profiles\PanasonicVieraProfile.cs" />
     <Compile Include="Profiles\SamsungSmartTvProfile.cs" />
     <Compile Include="Profiles\SamsungSmartTvProfile.cs" />
+    <Compile Include="Profiles\SonyBlurayPlayer2013Profile.cs" />
+    <Compile Include="Profiles\SonyBlurayPlayerProfile.cs" />
     <Compile Include="Profiles\SonyBravia2010Profile.cs" />
     <Compile Include="Profiles\SonyBravia2010Profile.cs" />
     <Compile Include="Profiles\SonyBravia2011Profile.cs" />
     <Compile Include="Profiles\SonyBravia2011Profile.cs" />
     <Compile Include="Profiles\SonyBravia2012Profile.cs" />
     <Compile Include="Profiles\SonyBravia2012Profile.cs" />
     <Compile Include="Profiles\SonyBravia2013Profile.cs" />
     <Compile Include="Profiles\SonyBravia2013Profile.cs" />
+    <Compile Include="Profiles\SonyPs3Profile.cs" />
     <Compile Include="Profiles\WdtvLiveProfile.cs" />
     <Compile Include="Profiles\WdtvLiveProfile.cs" />
     <Compile Include="Profiles\Xbox360Profile.cs" />
     <Compile Include="Profiles\Xbox360Profile.cs" />
     <Compile Include="Profiles\XboxOneProfile.cs" />
     <Compile Include="Profiles\XboxOneProfile.cs" />

+ 11 - 0
MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs

@@ -251,6 +251,11 @@ namespace MediaBrowser.Dlna.PlayTo
         /// <exception cref="System.InvalidOperationException">Unexpected ProfileConditionType</exception>
         /// <exception cref="System.InvalidOperationException">Unexpected ProfileConditionType</exception>
         private bool IsConditionSatisfied(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream)
         private bool IsConditionSatisfied(ProfileCondition condition, string mediaPath, MediaStream videoStream, MediaStream audioStream)
         {
         {
+            if (condition.Property == ProfileConditionValue.Has64BitOffsets)
+            {
+                // TODO: Determine how to evaluate this
+            }
+
             if (condition.Property == ProfileConditionValue.VideoProfile)
             if (condition.Property == ProfileConditionValue.VideoProfile)
             {
             {
                 var profile = videoStream == null ? null : videoStream.Profile;
                 var profile = videoStream == null ? null : videoStream.Profile;
@@ -346,6 +351,12 @@ namespace MediaBrowser.Dlna.PlayTo
                     return videoStream == null ? null : videoStream.Width;
                     return videoStream == null ? null : videoStream.Width;
                 case ProfileConditionValue.VideoLevel:
                 case ProfileConditionValue.VideoLevel:
                     return videoStream == null ? null : ConvertToLong(videoStream.Level);
                     return videoStream == null ? null : ConvertToLong(videoStream.Level);
+                case ProfileConditionValue.VideoPacketLength:
+                    // TODO: Determine how to get this
+                    return null;
+                case ProfileConditionValue.VideoTimestamp:
+                    // TODO: Determine how to get this
+                    return null;
                 default:
                 default:
                     throw new InvalidOperationException("Unexpected Property");
                     throw new InvalidOperationException("Unexpected Property");
             }
             }

文件差異過大導致無法顯示
+ 19 - 0
MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs


文件差異過大導致無法顯示
+ 35 - 0
MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs


+ 51 - 6
MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs

@@ -13,7 +13,7 @@ namespace MediaBrowser.Dlna.Profiles
                 FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*",
                 FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*",
                 Manufacturer = "Sony",
                 Manufacturer = "Sony",
 
 
-                Headers = new []
+                Headers = new[]
                 {
                 {
                     new HttpHeaderInfo
                     new HttpHeaderInfo
                     {
                     {
@@ -91,16 +91,61 @@ namespace MediaBrowser.Dlna.Profiles
             {
             {
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "avi",
-                    MimeType = "video/avi",
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"},
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/mpeg",
+                    OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
                     Type = DlnaProfileType.Video
                     Type = DlnaProfileType.Video
                 },
                 },
 
 
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "asf",
-                    MimeType = "video/x-ms-wmv",
-                    Type = DlnaProfileType.Audio
+                    Container = "ts",
+                    VideoCodec="mpeg2video",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
+                    Type = DlnaProfileType.Video
+                },
+
+                new MediaProfile
+                {
+                    Container = "mpeg",
+                    VideoCodec="mpeg1video,mpeg2video",
+                    MimeType = "video/mpeg",
+                    OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
+                    Type = DlnaProfileType.Video
                 }
                 }
             };
             };
 
 

+ 62 - 17
MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs

@@ -105,23 +105,6 @@ namespace MediaBrowser.Dlna.Profiles
                 }
                 }
             };
             };
 
 
-            MediaProfiles = new[]
-            {
-                new MediaProfile
-                {
-                    Container = "avi",
-                    MimeType = "video/avi",
-                    Type = DlnaProfileType.Video
-                },
-
-                new MediaProfile
-                {
-                    Container = "asf",
-                    MimeType = "video/x-ms-wmv",
-                    Type = DlnaProfileType.Audio
-                }
-            };
-
             ContainerProfiles = new[]
             ContainerProfiles = new[]
             {
             {
                 new ContainerProfile
                 new ContainerProfile
@@ -146,6 +129,68 @@ namespace MediaBrowser.Dlna.Profiles
                 }
                 }
             };
             };
 
 
+            MediaProfiles = new[]
+            {
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"},
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/mpeg",
+                    OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
+                    Type = DlnaProfileType.Video
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="mpeg2video",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
+                    Type = DlnaProfileType.Video
+                },
+
+                new MediaProfile
+                {
+                    Container = "mpeg",
+                    VideoCodec="mpeg1video,mpeg2video",
+                    MimeType = "video/mpeg",
+                    OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
+                    Type = DlnaProfileType.Video
+                }
+            };
+
             CodecProfiles = new[]
             CodecProfiles = new[]
             {
             {
                 new CodecProfile
                 new CodecProfile

+ 50 - 5
MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs

@@ -121,16 +121,61 @@ namespace MediaBrowser.Dlna.Profiles
             {
             {
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "avi",
-                    MimeType = "video/avi",
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"},
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/mpeg",
+                    OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
                     Type = DlnaProfileType.Video
                     Type = DlnaProfileType.Video
                 },
                 },
 
 
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "asf",
-                    MimeType = "video/x-ms-wmv",
-                    Type = DlnaProfileType.Audio
+                    Container = "ts",
+                    VideoCodec="mpeg2video",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
+                    Type = DlnaProfileType.Video
+                },
+
+                new MediaProfile
+                {
+                    Container = "mpeg",
+                    VideoCodec="mpeg1video,mpeg2video",
+                    MimeType = "video/mpeg",
+                    OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
+                    Type = DlnaProfileType.Video
                 }
                 }
             };
             };
 
 

+ 41 - 9
MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs

@@ -177,33 +177,65 @@ namespace MediaBrowser.Dlna.Profiles
             {
             {
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "avi",
-                    MimeType = "video/avi",
-                    Type = DlnaProfileType.Video
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3_T,AVC_TS_HD_50_AC3_T,AVC_TS_HD_60_AC3_T,AVC_TS_HD_EU_T",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="192"},
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoTimestamp, Value="1"}
+                    }
                 },
                 },
 
 
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "mp4",
-                    MimeType = "video/mp4",
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/mpeg",
+                    OrgPn="AVC_TS_HD_24_AC3_ISO,AVC_TS_HD_50_AC3_ISO,AVC_TS_HD_60_AC3_ISO,AVC_TS_HD_EU_ISO",
+                    Type = DlnaProfileType.Video,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition{ Condition= ProfileConditionType.Equals, Property= ProfileConditionValue.VideoPacketLength, Value="188"}
+                    }
+                },
+
+                new MediaProfile
+                {
+                    Container = "ts",
+                    VideoCodec="h264",
+                    AudioCodec="ac3,aac,mp3",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="AVC_TS_HD_24_AC3,AVC_TS_HD_50_AC3,AVC_TS_HD_60_AC3,AVC_TS_HD_EU",
                     Type = DlnaProfileType.Video
                     Type = DlnaProfileType.Video
                 },
                 },
 
 
                 new MediaProfile
                 new MediaProfile
                 {
                 {
                     Container = "ts",
                     Container = "ts",
-                    MimeType = "video/mpeg",
+                    VideoCodec="mpeg2video",
+                    MimeType = "video/vnd.dlna.mpeg-tts",
+                    OrgPn="MPEG_TS_SD_EU,MPEG_TS_SD_NA,MPEG_TS_SD_KO",
                     Type = DlnaProfileType.Video
                     Type = DlnaProfileType.Video
                 },
                 },
 
 
                 new MediaProfile
                 new MediaProfile
                 {
                 {
-                    Container = "wma",
-                    MimeType = "video/x-ms-wma",
-                    Type = DlnaProfileType.Audio
+                    Container = "mpeg",
+                    VideoCodec="mpeg1video,mpeg2video",
+                    MimeType = "video/mpeg",
+                    OrgPn="MPEG_PS_NTSC,MPEG_PS_PAL",
+                    Type = DlnaProfileType.Video
                 }
                 }
             };
             };
 
 
+
             CodecProfiles = new[]
             CodecProfiles = new[]
             {
             {
                 new CodecProfile
                 new CodecProfile

+ 233 - 0
MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs

@@ -0,0 +1,233 @@
+using MediaBrowser.Controller.Dlna;
+
+namespace MediaBrowser.Dlna.Profiles
+{
+    public class SonyPs3Profile : DefaultProfile
+    {
+        public SonyPs3Profile()
+        {
+            Name = "Sony Bravia (2010)";
+
+            Identification = new DeviceIdentification
+            {
+                Headers = new[]
+                {
+                    new HttpHeaderInfo
+                    {
+                        Name = "User-Agent",
+                        Value = @"PLAYSTATION 3",
+                        Match = HeaderMatchType.Substring
+                    },
+
+                    new HttpHeaderInfo
+                    {
+                        Name = "X-AV-Client-Info",
+                        Value = @"PLAYSTATION 3",
+                        Match = HeaderMatchType.Substring
+                    }
+                }
+            };
+
+            SonyAggregationFlags = "10";
+            XDlnaDoc = "DMS-1.50";
+
+            TranscodingProfiles = new[]
+            {
+                new TranscodingProfile
+                {
+                    Container = "mp3",
+                    AudioCodec = "mp3",
+                    Type = DlnaProfileType.Audio
+                },
+                new TranscodingProfile
+                {
+                    Container = "ts",
+                    VideoCodec = "h264",
+                    AudioCodec = "mp3",
+                    Type = DlnaProfileType.Video
+                },
+                new TranscodingProfile
+                {
+                    Container = "jpeg",
+                    Type = DlnaProfileType.Photo
+                }
+            };
+
+            ContainerProfiles = new[]
+            {
+                new ContainerProfile
+                {
+                    Type = DlnaProfileType.Photo,
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.Width,
+                            Value = "1920"
+                        },
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.Height,
+                            Value = "1080"
+                        }
+                    }
+                }
+            };
+
+            CodecProfiles = new[]
+            {
+                new CodecProfile
+                {
+                    Type = CodecType.VideoCodec,
+                    Codec = "h264",
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.Width,
+                            Value = "1920"
+                        },
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.Height,
+                            Value = "1080"
+                        },
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.VideoFramerate,
+                            Value = "30",
+                            IsRequired = false
+                        },
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.VideoBitrate,
+                            Value = "15360000",
+                            IsRequired = false
+                        },
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.VideoLevel,
+                            Value = "41",
+                            IsRequired = false
+                        }
+                    }
+                },
+
+                new CodecProfile
+                {
+                    Type = CodecType.VideoAudioCodec,
+                    Codec = "ac3",
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.AudioChannels,
+                            Value = "6",
+                            IsRequired = false
+                        },
+
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.AudioBitrate,
+                            Value = "640000",
+                            IsRequired = false
+                        }
+                    }
+                },
+
+                new CodecProfile
+                {
+                    Type = CodecType.VideoAudioCodec,
+                    Codec = "wmapro",
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.AudioChannels,
+                            Value = "2"
+                        }
+                    }
+                },
+
+                new CodecProfile
+                {
+                    Type = CodecType.VideoAudioCodec,
+                    Codec = "aac",
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.NotEquals,
+                            Property = ProfileConditionValue.AudioProfile,
+                            Value = "he-aac",
+                            IsRequired = false
+                        }
+                    }
+                },
+
+                new CodecProfile
+                {
+                    Type = CodecType.VideoAudioCodec,
+                    Codec = "aac",
+
+                    Conditions = new []
+                    {
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.LessThanEqual,
+                            Property = ProfileConditionValue.AudioChannels,
+                            Value = "2"
+                        },
+                        new ProfileCondition
+                        {
+                            Condition = ProfileConditionType.NotEquals,
+                            Property = ProfileConditionValue.AudioProfile,
+                            Value = "he-aac"
+                        }
+                    }
+                }
+            };
+
+            MediaProfiles = new[]
+            {
+                new MediaProfile
+                {
+                    Container = "mp4,mov",
+                    AudioCodec="aac",
+                    MimeType = "video/mp4",
+                    Type = DlnaProfileType.Video
+                },
+
+                new MediaProfile
+                {
+                    Container = "avi",
+                    MimeType = "video/divx",
+                    OrgPn="AVI",
+                    Type = DlnaProfileType.Video
+                },
+
+                new MediaProfile
+                {
+                    Container = "wav",
+                    MimeType = "audio/wav",
+                    Type = DlnaProfileType.Audio
+                }
+            };
+        }
+    }
+}

+ 1 - 1
MediaBrowser.Dlna/Profiles/XboxOneProfile.cs

@@ -35,7 +35,7 @@ namespace MediaBrowser.Dlna.Profiles
             {
             {
                 new DirectPlayProfile
                 new DirectPlayProfile
                 {
                 {
-                    Container = "mp3",
+                    Container = "mp3,wma",
                     Type = DlnaProfileType.Audio
                     Type = DlnaProfileType.Audio
                 }
                 }
             };
             };

部分文件因文件數量過多而無法顯示