From 87aee1625da956669bce724177821378f4f3158c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 23 Mar 2014 15:36:25 -0400 Subject: [PATCH] add new device profiles --- MediaBrowser.Api/SearchService.cs | 9 +- MediaBrowser.Api/SessionsService.cs | 27 +- MediaBrowser.Api/SystemService.cs | 11 +- MediaBrowser.Api/TvShowsService.cs | 17 +- MediaBrowser.Api/UserService.cs | 27 +- MediaBrowser.Controller/Dlna/CodecProfile.cs | 4 +- MediaBrowser.Controller/Dlna/MediaProfile.cs | 7 + MediaBrowser.Dlna/DlnaManager.cs | 5 + MediaBrowser.Dlna/MediaBrowser.Dlna.csproj | 3 + .../PlayTo/PlaylistItemFactory.cs | 11 + .../Profiles/SonyBlurayPlayer2013Profile.cs | 180 ++++++++++++ .../Profiles/SonyBlurayPlayerProfile.cs | 261 ++++++++++++++++++ .../Profiles/SonyBravia2010Profile.cs | 57 +++- .../Profiles/SonyBravia2011Profile.cs | 79 ++++-- .../Profiles/SonyBravia2012Profile.cs | 55 +++- .../Profiles/SonyBravia2013Profile.cs | 50 +++- MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs | 233 ++++++++++++++++ MediaBrowser.Dlna/Profiles/XboxOneProfile.cs | 2 +- 18 files changed, 940 insertions(+), 98 deletions(-) create mode 100644 MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs create mode 100644 MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs create mode 100644 MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs diff --git a/MediaBrowser.Api/SearchService.cs b/MediaBrowser.Api/SearchService.cs index f46c6b8e30..662c728e46 100644 --- a/MediaBrowser.Api/SearchService.cs +++ b/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.Entities; using MediaBrowser.Controller.Entities.Audio; @@ -8,6 +7,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Model.Entities; using MediaBrowser.Model.Search; using ServiceStack; +using System; using System.Linq; using System.Threading.Tasks; @@ -16,8 +16,7 @@ namespace MediaBrowser.Api /// /// Class GetSearchHints /// - [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 { /// @@ -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)] public string IncludeItemTypes { get; set; } - + public GetSearchHints() { IncludeArtists = true; diff --git a/MediaBrowser.Api/SessionsService.cs b/MediaBrowser.Api/SessionsService.cs index e73e3490ec..070fe9e598 100644 --- a/MediaBrowser.Api/SessionsService.cs +++ b/MediaBrowser.Api/SessionsService.cs @@ -14,8 +14,7 @@ namespace MediaBrowser.Api /// /// Class GetSessions /// - [Route("/Sessions", "GET")] - [Api(("Gets a list of sessions"))] + [Route("/Sessions", "GET", Summary = "Gets a list of sessions")] public class GetSessions : IReturn> { /// @@ -35,8 +34,7 @@ namespace MediaBrowser.Api /// /// Class BrowseTo /// - [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 { /// @@ -77,8 +75,7 @@ namespace MediaBrowser.Api 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 { /// @@ -110,8 +107,7 @@ namespace MediaBrowser.Api 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 { /// @@ -135,8 +131,7 @@ namespace MediaBrowser.Api 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 { /// @@ -154,8 +149,7 @@ namespace MediaBrowser.Api 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 { /// @@ -175,8 +169,7 @@ namespace MediaBrowser.Api 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 { [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; } } - [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 { [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; } } - [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 { /// diff --git a/MediaBrowser.Api/SystemService.cs b/MediaBrowser.Api/SystemService.cs index 9f5f3716ec..2f0741434a 100644 --- a/MediaBrowser.Api/SystemService.cs +++ b/MediaBrowser.Api/SystemService.cs @@ -8,8 +8,7 @@ namespace MediaBrowser.Api /// /// Class GetSystemInfo /// - [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 { @@ -18,18 +17,16 @@ namespace MediaBrowser.Api /// /// Class RestartApplication /// - [Route("/System/Restart", "POST")] - [Api(("Restarts the application, if needed"))] + [Route("/System/Restart", "POST", Summary = "Restarts the application, if needed")] public class RestartApplication { } - [Route("/System/Shutdown", "POST")] - [Api(("Shuts down the application"))] + [Route("/System/Shutdown", "POST", Summary = "Shuts down the application")] public class ShutdownApplication { } - + /// /// Class SystemInfoService /// diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs index a805b7b551..7fa586a7d7 100644 --- a/MediaBrowser.Api/TvShowsService.cs +++ b/MediaBrowser.Api/TvShowsService.cs @@ -17,8 +17,7 @@ namespace MediaBrowser.Api /// /// Class GetNextUpEpisodes /// - [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, IHasItemFields { /// @@ -53,8 +52,7 @@ namespace MediaBrowser.Api 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, IHasItemFields { /// @@ -86,14 +84,12 @@ namespace MediaBrowser.Api 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 { } - [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, IHasItemFields { /// @@ -129,8 +125,7 @@ namespace MediaBrowser.Api 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, IHasItemFields { /// @@ -320,7 +315,7 @@ namespace MediaBrowser.Api return 0; }) - .ThenByDescending(i =>i.Item2) + .ThenByDescending(i => i.Item2) .ThenByDescending(i => i.Item1.PremiereDate ?? DateTime.MinValue) .Select(i => i.Item1); } diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs index 18c3bd0962..2f1b161078 100644 --- a/MediaBrowser.Api/UserService.cs +++ b/MediaBrowser.Api/UserService.cs @@ -17,8 +17,7 @@ namespace MediaBrowser.Api /// /// Class GetUsers /// - [Route("/Users", "GET")] - [Api(Description = "Gets a list of users")] + [Route("/Users", "GET", Summary = "Gets a list of users")] public class GetUsers : IReturn> { [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; } } - [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> { } @@ -37,8 +35,7 @@ namespace MediaBrowser.Api /// /// Class GetUser /// - [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 { /// @@ -52,8 +49,7 @@ namespace MediaBrowser.Api /// /// Class DeleteUser /// - [Route("/Users/{Id}", "DELETE")] - [Api(Description = "Deletes a user")] + [Route("/Users/{Id}", "DELETE", Summary = "Deletes a user")] public class DeleteUser : IReturnVoid { /// @@ -67,8 +63,7 @@ namespace MediaBrowser.Api /// /// Class AuthenticateUser /// - [Route("/Users/{Id}/Authenticate", "POST")] - [Api(Description = "Authenticates a user")] + [Route("/Users/{Id}/Authenticate", "POST", Summary = "Authenticates a user")] public class AuthenticateUser : IReturn { /// @@ -89,8 +84,7 @@ namespace MediaBrowser.Api /// /// Class AuthenticateUser /// - [Route("/Users/AuthenticateByName", "POST")] - [Api(Description = "Authenticates a user")] + [Route("/Users/AuthenticateByName", "POST", Summary = "Authenticates a user")] public class AuthenticateUserByName : IReturn { /// @@ -111,8 +105,7 @@ namespace MediaBrowser.Api /// /// Class UpdateUserPassword /// - [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 { /// @@ -143,8 +136,7 @@ namespace MediaBrowser.Api /// /// Class UpdateUser /// - [Route("/Users/{Id}", "POST")] - [Api(Description = "Updates a user")] + [Route("/Users/{Id}", "POST", Summary = "Updates a user")] public class UpdateUser : UserDto, IReturnVoid { } @@ -152,8 +144,7 @@ namespace MediaBrowser.Api /// /// Class CreateUser /// - [Route("/Users", "POST")] - [Api(Description = "Creates a user")] + [Route("/Users", "POST", Summary = "Creates a user")] public class CreateUser : UserDto, IReturn { } diff --git a/MediaBrowser.Controller/Dlna/CodecProfile.cs b/MediaBrowser.Controller/Dlna/CodecProfile.cs index 1dc7f21396..5621c7ef23 100644 --- a/MediaBrowser.Controller/Dlna/CodecProfile.cs +++ b/MediaBrowser.Controller/Dlna/CodecProfile.cs @@ -61,6 +61,8 @@ namespace MediaBrowser.Controller.Dlna VideoBitrate, VideoFramerate, VideoLevel, - VideoProfile + VideoPacketLength, + VideoProfile, + VideoTimestamp } } diff --git a/MediaBrowser.Controller/Dlna/MediaProfile.cs b/MediaBrowser.Controller/Dlna/MediaProfile.cs index 5fa41b18aa..1d2613face 100644 --- a/MediaBrowser.Controller/Dlna/MediaProfile.cs +++ b/MediaBrowser.Controller/Dlna/MediaProfile.cs @@ -13,6 +13,13 @@ namespace MediaBrowser.Controller.Dlna public string OrgPn { get; set; } public string MimeType { get; set; } + public ProfileCondition[] Conditions { get; set; } + + public MediaProfile() + { + Conditions = new ProfileCondition[] {}; + } + public List GetAudioCodecs() { return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList(); diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.cs index d4fdf92d8d..25a82f5290 100644 --- a/MediaBrowser.Dlna/DlnaManager.cs +++ b/MediaBrowser.Dlna/DlnaManager.cs @@ -34,6 +34,8 @@ namespace MediaBrowser.Dlna list.Add(new Xbox360Profile()); list.Add(new XboxOneProfile()); + + list.Add(new SonyPs3Profile()); list.Add(new SonyBravia2010Profile()); @@ -43,6 +45,9 @@ namespace MediaBrowser.Dlna list.Add(new SonyBravia2013Profile()); + list.Add(new SonyBlurayPlayer2013Profile()); + list.Add(new SonyBlurayPlayerProfile()); + list.Add(new PanasonicVieraProfile()); list.Add(new WdtvLiveProfile()); diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj index c370882463..31eed483fe 100644 --- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj +++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj @@ -86,10 +86,13 @@ + + + diff --git a/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs b/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs index 31f15b1c31..e4c49a224c 100644 --- a/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs +++ b/MediaBrowser.Dlna/PlayTo/PlaylistItemFactory.cs @@ -251,6 +251,11 @@ namespace MediaBrowser.Dlna.PlayTo /// Unexpected ProfileConditionType 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) { var profile = videoStream == null ? null : videoStream.Profile; @@ -346,6 +351,12 @@ namespace MediaBrowser.Dlna.PlayTo return videoStream == null ? null : videoStream.Width; case ProfileConditionValue.VideoLevel: 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: throw new InvalidOperationException("Unexpected Property"); } diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs new file mode 100644 index 0000000000..49aa47027a --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayer2013Profile.cs @@ -0,0 +1,180 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBlurayPlayer2013Profile : DefaultProfile + { + public SonyBlurayPlayer2013Profile() + { + Identification = new DeviceIdentification + { + FriendlyName = @"Blu-ray Disc Player", + Manufacturer = "Sony", + ModelNumber = "BDP-2013" + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + Manufacturer = "Microsoft Corporation"; + + ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + + new TranscodingProfile + { + Container = "ts", + VideoCodec = "h264", + AudioCodec = "ac3", + Type = DlnaProfileType.Video + }, + + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg1video,mpeg2video,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "ac3,mp3,mp2,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp4", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,aac,pcm,mp3", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mkv", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,dca,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "mp4", + AudioCodec = "aac", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + 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 CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + } + } + } + }; + + 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" + } + } + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs new file mode 100644 index 0000000000..5121726706 --- /dev/null +++ b/MediaBrowser.Dlna/Profiles/SonyBlurayPlayerProfile.cs @@ -0,0 +1,261 @@ +using MediaBrowser.Controller.Dlna; + +namespace MediaBrowser.Dlna.Profiles +{ + public class SonyBlurayPlayerProfile : DefaultProfile + { + public SonyBlurayPlayerProfile() + { + Identification = new DeviceIdentification + { + FriendlyName = @"Blu-ray Disc Player", + Manufacturer = "Sony", + + Headers = new[] + { + new HttpHeaderInfo + { + Name = "X-AV-Client-Info", + Value = @"(Blu-ray Disc Player|Home Theater System|Home Theatre System|Media Player)", + Match = HeaderMatchType.Regex + }, + + new HttpHeaderInfo + { + Name = "X-AV-Physical-Unit-Info", + Value = @"(Blu-ray Disc Player|Home Theater System|Home Theatre System|Media Player)", + Match = HeaderMatchType.Regex + } + } + }; + + ModelName = "Windows Media Player Sharing"; + ModelNumber = "3.0"; + Manufacturer = "Microsoft Corporation"; + + ProtocolInfo = "http-get:*:video/divx:DLNA.ORG_PN=MATROSKA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mp4:DLNA.ORG_PN=AVC_MP4_MP_SD_AAC_MULT5;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=1:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/mp4:DLNA.ORG_PN=AAC_ISO_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/vnd.dlna.adts:DLNA.ORG_PN=AAC_ADTS_320;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/flac:DLNA.ORG_PN=FLAC;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:audio/ogg:DLNA.ORG_PN=OGG;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/png:DLNA.ORG_PN=PNG_TN;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:image/gif:DLNA.ORG_PN=GIF_LRG;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_EU_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_NA_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_SD_KO_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_KO_ISO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.dlna.mpeg-tts:DLNA.ORG_PN=MPEG_TS_JP_T;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-flv:DLNA.ORG_PN=FLV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-dvr:DLNA.ORG_PN=DVR_MS;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/wtv:DLNA.ORG_PN=WTV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/ogg:DLNA.ORG_PN=OGV;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/vnd.rn-realvideo:DLNA.ORG_PN=REAL_VIDEO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L2_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L3_WMA;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_P2_3GPP_SP_L0B_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_3GPP_P0_L10_AMR;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:video/3gpp:DLNA.ORG_PN=MPEG4_H263_MP4_P0_L10_AAC;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000"; + + TranscodingProfiles = new[] + { + new TranscodingProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + + new TranscodingProfile + { + Container = "ts", + VideoCodec = "mpeg2video", + AudioCodec = "ac3", + Type = DlnaProfileType.Video + }, + + new TranscodingProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + DirectPlayProfiles = new[] + { + new DirectPlayProfile + { + Container = "ts", + VideoCodec = "mpeg1video,mpeg2video,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mpeg", + VideoCodec = "mpeg1video,mpeg2video", + AudioCodec = "ac3,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "avi,mp4", + VideoCodec = "mpeg4,h264", + AudioCodec = "ac3,aac,mp3,pcm", + Type = DlnaProfileType.Video + }, + new DirectPlayProfile + { + Container = "mp3", + AudioCodec = "mp3", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "asf", + AudioCodec = "wmav2,wmapro,wmavoice", + Type = DlnaProfileType.Audio + }, + new DirectPlayProfile + { + Container = "jpeg", + Type = DlnaProfileType.Photo + } + }; + + 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.VideoLevel, + Value = "41", + IsRequired = false + }, + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.VideoBitrate, + Value = "15360000", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "ac3", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "6", + IsRequired = false + } + } + }, + + new CodecProfile + { + Type = CodecType.VideoAudioCodec, + Codec = "aac", + Conditions = new [] + { + new ProfileCondition + { + Condition = ProfileConditionType.LessThanEqual, + Property = ProfileConditionValue.AudioChannels, + Value = "2", + IsRequired = false + } + } + } + }; + + 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" + } + } + } + }; + + MediaProfiles = new[] + { + new MediaProfile + { + Container = "ts", + VideoCodec = "h264,mpeg4,vc1", + AudioCodec = "ac3,aac,mp3", + 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 = "avi", + MimeType = "video/mpeg", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mkv", + MimeType = "video/vnd.dlna.mpeg-tts", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "ts", + MimeType = "video/vnd.dlna.mpeg-tts", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mp4", + MimeType = "video/mpeg", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mpeg", + MimeType = "video/mpeg", + Type = DlnaProfileType.Video + }, + + new MediaProfile + { + Container = "mp3", + MimeType = "audio/mpeg", + Type = DlnaProfileType.Audio + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs index 010a18c8d1..042cc0a965 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -13,7 +13,7 @@ namespace MediaBrowser.Dlna.Profiles FriendlyName = @"KDL-\d{2}[EHLNPB]X\d[01]\d.*", Manufacturer = "Sony", - Headers = new [] + Headers = new[] { new HttpHeaderInfo { @@ -91,16 +91,61 @@ namespace MediaBrowser.Dlna.Profiles { 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 }, 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 } }; diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs index 50fd6e2567..401c40c362 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/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[] { 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[] { new CodecProfile diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs index b476d9c3f6..2d24c406e3 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs @@ -121,16 +121,61 @@ namespace MediaBrowser.Dlna.Profiles { 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 }, 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 } }; diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs index ccb655adda..10f7129581 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs @@ -177,33 +177,65 @@ namespace MediaBrowser.Dlna.Profiles { 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 { - 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 }, new MediaProfile { 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 }, 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[] { new CodecProfile diff --git a/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs b/MediaBrowser.Dlna/Profiles/SonyPs3Profile.cs new file mode 100644 index 0000000000..e5fc1ed073 --- /dev/null +++ b/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 + } + }; + } + } +} diff --git a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs index db45029a47..0daa5d7a2a 100644 --- a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs +++ b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs @@ -35,7 +35,7 @@ namespace MediaBrowser.Dlna.Profiles { new DirectPlayProfile { - Container = "mp3", + Container = "mp3,wma", Type = DlnaProfileType.Audio } };