rework samsung profile

pull/702/head
Luke Pulverenti 11 years ago
parent 85aa11e926
commit ca37afb3a5

@ -1211,71 +1211,75 @@ namespace MediaBrowser.Api.Playback
if (i == 0)
{
request.DeviceId = val;
// Device profile name
}
else if (i == 1)
{
request.MediaSourceId = val;
request.DeviceId = val;
}
else if (i == 2)
{
request.Static = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
request.MediaSourceId = val;
}
else if (i == 3)
{
request.Static = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
}
else if (i == 4)
{
if (videoRequest != null)
{
videoRequest.VideoCodec = (VideoCodecs)Enum.Parse(typeof(VideoCodecs), val, true);
}
}
else if (i == 4)
else if (i == 5)
{
request.AudioCodec = (AudioCodecs)Enum.Parse(typeof(AudioCodecs), val, true);
}
else if (i == 5)
else if (i == 6)
{
if (videoRequest != null)
{
videoRequest.AudioStreamIndex = int.Parse(val, UsCulture);
}
}
else if (i == 6)
else if (i == 7)
{
if (videoRequest != null)
{
videoRequest.SubtitleStreamIndex = int.Parse(val, UsCulture);
}
}
else if (i == 7)
else if (i == 8)
{
if (videoRequest != null)
{
videoRequest.VideoBitRate = int.Parse(val, UsCulture);
}
}
else if (i == 8)
else if (i == 9)
{
request.AudioBitRate = int.Parse(val, UsCulture);
}
else if (i == 9)
else if (i == 10)
{
request.MaxAudioChannels = int.Parse(val, UsCulture);
}
else if (i == 10)
else if (i == 11)
{
if (videoRequest != null)
{
request.StartTimeTicks = long.Parse(val, UsCulture);
}
}
else if (i == 11)
else if (i == 12)
{
if (videoRequest != null)
{
videoRequest.Profile = val;
}
}
else if (i == 12)
else if (i == 13)
{
if (videoRequest != null)
{

@ -43,6 +43,7 @@ namespace MediaBrowser.Controller.Dlna
public string ModelNumber { get; set; }
public string ModelUrl { get; set; }
public bool IgnoreTranscodeByteRangeRequests { get; set; }
public bool SupportsAlbumArtInDidl { get; set; }
/// <summary>
/// Controls the content of the X_DLNADOC element in the urn:schemas-dlna-org:device-1-0 namespace.

@ -29,208 +29,8 @@ namespace MediaBrowser.Dlna
{
var list = new List<DeviceProfile>();
//list.Add(new DeviceProfile
//{
// Name = "Samsung TV (B Series)",
// ClientType = "DLNA",
// Identification = new DeviceIdentification
// {
// FriendlyName = "^TV$",
// ModelNumber = @"1\.0",
// ModelName = "Samsung DTV DMR"
// },
// TranscodingProfiles = new[]
// {
// new TranscodingProfile
// {
// Container = "mp3",
// Type = DlnaProfileType.Audio,
// },
// new TranscodingProfile
// {
// Container = "ts",
// Type = DlnaProfileType.Video
// }
// },
// DirectPlayProfiles = new[]
// {
// new DirectPlayProfile
// {
// Container = "mp3",
// Type = DlnaProfileType.Audio,
// },
// new DirectPlayProfile
// {
// Container = "mkv",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "avi",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "mp4",
// Type = DlnaProfileType.Video
// }
// },
// MediaProfiles = new[]
// {
// new MediaProfile
// {
// Container ="avi",
// MimeType = "video/x-msvideo",
// Type = DlnaProfileType.Video
// },
// new MediaProfile
// {
// Container ="mkv",
// MimeType = "video/x-mkv",
// Type = DlnaProfileType.Video
// }
// }
//});
//list.Add(new DeviceProfile
//{
// Name = "Samsung TV (E/F-series)",
// ClientType = "DLNA",
// Identification = new DeviceIdentification
// {
// FriendlyName = @"(^\[TV\][A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung|(^\[TV\]Samsung [A-Z]{2}\d{2}(E|F)[A-Z]?\d{3,4}.*)",
// ModelNumber = @"(1\.0)|(AllShare1\.0)"
// },
// TranscodingProfiles = new[]
// {
// new TranscodingProfile
// {
// Container = "mp3",
// Type = DlnaProfileType.Audio
// },
// new TranscodingProfile
// {
// Container = "ts",
// Type = DlnaProfileType.Video
// }
// },
// DirectPlayProfiles = new[]
// {
// new DirectPlayProfile
// {
// Container = "mp3",
// Type = DlnaProfileType.Audio
// },
// new DirectPlayProfile
// {
// Container = "mkv",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "avi",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "mp4",
// Type = DlnaProfileType.Video
// }
// },
// MediaProfiles = new[]
// {
// new MediaProfile
// {
// Container ="avi",
// MimeType = "video/x-msvideo",
// Type = DlnaProfileType.Video
// },
// new MediaProfile
// {
// Container ="mkv",
// MimeType = "video/x-mkv",
// Type = DlnaProfileType.Video
// }
// }
//});
//list.Add(new DeviceProfile
//{
// Name = "Samsung TV (C/D-series)",
// ClientType = "DLNA",
// Identification = new DeviceIdentification
// {
// FriendlyName = @"(^TV-\d{2}C\d{3}.*)|(^\[TV\][A-Z]{2}\d{2}(D)[A-Z]?\d{3,4}.*)|^\[TV\] Samsung",
// ModelNumber = @"(1\.0)|(AllShare1\.0)"
// },
// TranscodingProfiles = new[]
// {
// new TranscodingProfile
// {
// Container = "mp3",
// Type = DlnaProfileType.Audio
// },
// new TranscodingProfile
// {
// Container = "ts",
// Type = DlnaProfileType.Video
// }
// },
// DirectPlayProfiles = new[]
// {
// new DirectPlayProfile
// {
// Container = "mp3",
// Type = DlnaProfileType.Audio
// },
// new DirectPlayProfile
// {
// Container = "mkv",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "avi",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "mp4",
// Type = DlnaProfileType.Video
// }
// },
// MediaProfiles = new[]
// {
// new MediaProfile
// {
// Container ="avi",
// MimeType = "video/x-msvideo",
// Type = DlnaProfileType.Video
// },
// new MediaProfile
// {
// Container ="mkv",
// MimeType = "video/x-mkv",
// Type = DlnaProfileType.Video
// }
// }
//});
list.Add(new SamsungSmartTvProfile());
list.Add(new Xbox360Profile());
list.Add(new XboxOneProfile());
@ -245,87 +45,12 @@ namespace MediaBrowser.Dlna
list.Add(new PanasonicVieraProfile());
//list.Add(new DeviceProfile
//{
// Name = "Philips (2010-)",
// ClientType = "DLNA",
// Identification = new DeviceIdentification
// {
// FriendlyName = ".*PHILIPS.*",
// ModelName = "WD TV HD Live"
// },
// DirectPlayProfiles = new[]
// {
// new DirectPlayProfile
// {
// Container = "mp3,wma",
// Type = DlnaProfileType.Audio
// },
// new DirectPlayProfile
// {
// Container = "avi",
// Type = DlnaProfileType.Video
// },
// new DirectPlayProfile
// {
// Container = "mkv",
// Type = DlnaProfileType.Video
// }
// },
// MediaProfiles = new[]
// {
// new MediaProfile
// {
// Container ="avi",
// MimeType = "video/avi",
// Type = DlnaProfileType.Video
// },
// new MediaProfile
// {
// Container ="mkv",
// MimeType = "video/x-matroska",
// Type = DlnaProfileType.Video
// }
// }
//});
list.Add(new WdtvLiveProfile());
//list.Add(new DeviceProfile
//{
// // Linksys DMA2100us does not need any transcoding of the formats we support statically
// Name = "Linksys DMA2100",
// ClientType = "DLNA",
// Identification = new DeviceIdentification
// {
// ModelName = "DMA2100us"
// },
// DirectPlayProfiles = new[]
// {
// new DirectPlayProfile
// {
// Container = "mp3,flac,m4a,wma",
// Type = DlnaProfileType.Audio
// },
// new DirectPlayProfile
// {
// Container = "avi,mp4,mkv,ts",
// Type = DlnaProfileType.Video
// }
// }
//});
list.Add(new DenonAvrProfile());
list.Add(new LinksysDMA2100Profile());
foreach (var item in list)
{
//_xmlSerializer.SerializeToFile(item, "d:\\" + _fileSystem.GetValidFilename(item.Name) + ".xml");

@ -83,7 +83,9 @@
<Compile Include="PlayTo\uPnpNamespaces.cs" />
<Compile Include="Profiles\DefaultProfile.cs" />
<Compile Include="Profiles\DenonAvrProfile.cs" />
<Compile Include="Profiles\LinksysDMA2100Profile.cs" />
<Compile Include="Profiles\PanasonicVieraProfile.cs" />
<Compile Include="Profiles\SamsungSmartTvProfile.cs" />
<Compile Include="Profiles\SonyBravia2010Profile.cs" />
<Compile Include="Profiles\SonyBravia2011Profile.cs" />
<Compile Include="Profiles\SonyBravia2012Profile.cs" />

@ -6,6 +6,16 @@ namespace MediaBrowser.Dlna.Profiles
{
public DefaultProfile()
{
ProtocolInfo = "DLNA";
ClientType = "DLNA";
Manufacturer = "Media Browser";
ModelDescription = "Media Browser";
ModelName = "Media Browser";
ModelNumber = "Media Browser";
ModelUrl = "http://mediabrowser3.com/";
ManufacturerUrl = "http://mediabrowser3.com/";
TranscodingProfiles = new[]
{
new TranscodingProfile

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public DenonAvrProfile()
{
Name = "Denon AVR";
ClientType = "DLNA";
Identification = new DeviceIdentification
{

@ -0,0 +1,33 @@
using MediaBrowser.Controller.Dlna;
namespace MediaBrowser.Dlna.Profiles
{
public class LinksysDMA2100Profile : DefaultProfile
{
public LinksysDMA2100Profile()
{
// Linksys DMA2100us does not need any transcoding of the formats we support statically
Name = "Linksys DMA2100";
Identification = new DeviceIdentification
{
ModelName = "DMA2100us"
};
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
Container = "mp3,flac,m4a,wma",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
Container = "avi,mp4,mkv,ts",
Type = DlnaProfileType.Video
}
};
}
}
}

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public PanasonicVieraProfile()
{
Name = "Panasonic Viera";
ClientType = "DLNA";
Identification = new DeviceIdentification
{

@ -0,0 +1,315 @@
using MediaBrowser.Controller.Dlna;
namespace MediaBrowser.Dlna.Profiles
{
public class SamsungSmartTvProfile : DefaultProfile
{
public SamsungSmartTvProfile()
{
Name = "Samsung Smart TV";
SupportsAlbumArtInDidl = true;
Identification = new DeviceIdentification
{
ModelUrl = "samsung.com"
};
TranscodingProfiles = new[]
{
new TranscodingProfile
{
Container = "mp3",
AudioCodec = "mp3",
Type = DlnaProfileType.Audio
},
new TranscodingProfile
{
Container = "ts",
AudioCodec = "ac3",
VideoCodec = "h264",
Type = DlnaProfileType.Video
},
new TranscodingProfile
{
Container = "jpeg",
Type = DlnaProfileType.Photo
}
};
DirectPlayProfiles = new[]
{
new DirectPlayProfile
{
Container = "asf",
VideoCodec = "h264,mpeg4,mjpeg",
AudioCodec = "mp3,ac3,wmav2,wmapro,wmavoice",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "avi",
VideoCodec = "h264,mpeg4,mjpeg",
AudioCodec = "mp3,ac3,dca",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "mkv",
VideoCodec = "h264,mpeg4,mjpeg4",
AudioCodec = "mp3,ac3,dca,aac",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "mp4",
VideoCodec = "h264,mpeg4",
AudioCodec = "mp3,aac",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "3gpp",
VideoCodec = "h264,mpeg4",
AudioCodec = "aac,he-aac",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "mpg,mpeg",
VideoCodec = "mpeg1video,mpeg2video,h264",
AudioCodec = "ac3,mp2,mp3,aac",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "vro,vob",
VideoCodec = "mpeg1video,mpeg2video",
AudioCodec = "ac3,mp2,mp3",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "ts",
VideoCodec = "mpeg2video,h264,vc1",
AudioCodec = "ac3,aac,mp3,eac3",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "asf",
VideoCodec = "wmv2,wmv3",
AudioCodec = "wmav2,wmavoice",
Type = DlnaProfileType.Video
},
new DirectPlayProfile
{
Container = "mp3",
AudioCodec = "mp3",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
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 = "mpeg2video",
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"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoBitrate,
Value = "30720000"
}
}
},
new CodecProfile
{
Type = CodecType.VideoCodec,
Codec = "mpeg4",
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"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoBitrate,
Value = "8192000"
}
}
},
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"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoBitrate,
Value = "37500000"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoLevel,
Value = "41"
}
}
},
new CodecProfile
{
Type = CodecType.VideoCodec,
Codec = "wmv2,wmv3,vc1",
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"
},
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoBitrate,
Value = "25600000"
}
}
},
new CodecProfile
{
Type = CodecType.VideoAudioCodec,
Codec = "ac3,wmav2,dca,aac,mp3",
Conditions = new[]
{
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.AudioChannels,
Value = "6"
}
}
}
};
MediaProfiles = new[]
{
new MediaProfile
{
Container = "mkv",
MimeType = "video/x-mkv",
Type = DlnaProfileType.Video
}
};
}
}
}

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public SonyBravia2010Profile()
{
Name = "Sony Bravia (2010)";
ClientType = "DLNA";
Identification = new DeviceIdentification
{

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public SonyBravia2011Profile()
{
Name = "Sony Bravia (2011)";
ClientType = "DLNA";
Identification = new DeviceIdentification
{

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public SonyBravia2012Profile()
{
Name = "Sony Bravia (2012)";
ClientType = "DLNA";
Identification = new DeviceIdentification
{

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public SonyBravia2013Profile()
{
Name = "Sony Bravia (2013)";
ClientType = "DLNA";
Identification = new DeviceIdentification
{

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public WdtvLiveProfile()
{
Name = "WDTV Live";
ClientType = "DLNA";
TimelineOffsetSeconds = 5;
IgnoreTranscodeByteRangeRequests = true;

@ -1,5 +1,4 @@
using MediaBrowser.Controller.Dlna;
using System.Collections.Generic;
namespace MediaBrowser.Dlna.Profiles
{
@ -8,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public Xbox360Profile()
{
Name = "Xbox 360";
ClientType = "DLNA";
ModelName = "Windows Media Player Sharing";
ModelNumber = "12.0";

@ -7,7 +7,6 @@ namespace MediaBrowser.Dlna.Profiles
public XboxOneProfile()
{
Name = "Xbox One";
ClientType = "DLNA";
Identification = new DeviceIdentification
{
@ -38,11 +37,6 @@ namespace MediaBrowser.Dlna.Profiles
{
Container = "mp3",
Type = DlnaProfileType.Audio
},
new DirectPlayProfile
{
Container = "avi",
Type = DlnaProfileType.Video
}
};

Loading…
Cancel
Save