add new device profiles

This commit is contained in:
Luke Pulverenti 2014-03-23 15:36:25 -04:00
parent ca37afb3a5
commit 87aee1625d
18 changed files with 940 additions and 98 deletions

View file

@ -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
/// <summary>
/// Class GetSearchHints
/// </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>
{
/// <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)]
public string IncludeItemTypes { get; set; }
public GetSearchHints()
{
IncludeArtists = true;

View file

@ -14,8 +14,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class GetSessions
/// </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>>
{
/// <summary>
@ -35,8 +34,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class BrowseTo
/// </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
{
/// <summary>
@ -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
{
/// <summary>
@ -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
{
/// <summary>
@ -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
{
/// <summary>
@ -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
{
/// <summary>
@ -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
{
/// <summary>

View file

@ -8,8 +8,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class GetSystemInfo
/// </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>
{
@ -18,18 +17,16 @@ namespace MediaBrowser.Api
/// <summary>
/// Class RestartApplication
/// </summary>
[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
{
}
/// <summary>
/// Class SystemInfoService
/// </summary>

View file

@ -17,8 +17,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class GetNextUpEpisodes
/// </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
{
/// <summary>
@ -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<ItemsResult>, IHasItemFields
{
/// <summary>
@ -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<ItemsResult>, IHasItemFields
{
/// <summary>
@ -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<ItemsResult>, IHasItemFields
{
/// <summary>
@ -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);
}

View file

@ -17,8 +17,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class GetUsers
/// </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>>
{
[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<List<UserDto>>
{
}
@ -37,8 +35,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class GetUser
/// </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>
{
/// <summary>
@ -52,8 +49,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class DeleteUser
/// </summary>
[Route("/Users/{Id}", "DELETE")]
[Api(Description = "Deletes a user")]
[Route("/Users/{Id}", "DELETE", Summary = "Deletes a user")]
public class DeleteUser : IReturnVoid
{
/// <summary>
@ -67,8 +63,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class AuthenticateUser
/// </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>
{
/// <summary>
@ -89,8 +84,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class AuthenticateUser
/// </summary>
[Route("/Users/AuthenticateByName", "POST")]
[Api(Description = "Authenticates a user")]
[Route("/Users/AuthenticateByName", "POST", Summary = "Authenticates a user")]
public class AuthenticateUserByName : IReturn<AuthenticationResult>
{
/// <summary>
@ -111,8 +105,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class UpdateUserPassword
/// </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
{
/// <summary>
@ -143,8 +136,7 @@ namespace MediaBrowser.Api
/// <summary>
/// Class UpdateUser
/// </summary>
[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
/// <summary>
/// Class CreateUser
/// </summary>
[Route("/Users", "POST")]
[Api(Description = "Creates a user")]
[Route("/Users", "POST", Summary = "Creates a user")]
public class CreateUser : UserDto, IReturn<UserDto>
{
}

View file

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

View file

@ -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<string> GetAudioCodecs()
{
return (AudioCodec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();

View file

@ -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());

View file

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

View file

@ -251,6 +251,11 @@ namespace MediaBrowser.Dlna.PlayTo
/// <exception cref="System.InvalidOperationException">Unexpected ProfileConditionType</exception>
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");
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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
}
};

View file

@ -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

View file

@ -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
}
};

View file

@ -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

View file

@ -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
}
};
}
}
}

View file

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