aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Dlna
diff options
context:
space:
mode:
authortikuf <admin@nyalindee.com>2014-04-07 12:43:29 +1000
committertikuf <admin@nyalindee.com>2014-04-07 12:43:29 +1000
commit8ae71b75fb024815e165eba9b3d00ca8307caab3 (patch)
tree54274881bca0834c2ab518c51bc65160fc320db1 /MediaBrowser.Dlna
parent161e1af0eaa69e828f64d33311e3bc462852d6c4 (diff)
parent56c0d491f4c05a2c0c4f21c20e3530c039b33148 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Dlna')
-rw-r--r--MediaBrowser.Dlna/DlnaManager.cs21
-rw-r--r--MediaBrowser.Dlna/MediaBrowser.Dlna.csproj1
-rw-r--r--MediaBrowser.Dlna/PlayTo/Device.cs65
-rw-r--r--MediaBrowser.Dlna/PlayTo/DlnaController.cs81
-rw-r--r--MediaBrowser.Dlna/PlayTo/Extensions.cs7
-rw-r--r--MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs22
-rw-r--r--MediaBrowser.Dlna/PlayTo/uBaseObject.cs46
-rw-r--r--MediaBrowser.Dlna/Profiles/DefaultProfile.cs5
-rw-r--r--MediaBrowser.Dlna/Profiles/Windows81Profile.cs4
-rw-r--r--MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs200
10 files changed, 342 insertions, 110 deletions
diff --git a/MediaBrowser.Dlna/DlnaManager.cs b/MediaBrowser.Dlna/DlnaManager.cs
index e3536c3c67..7a8fd41830 100644
--- a/MediaBrowser.Dlna/DlnaManager.cs
+++ b/MediaBrowser.Dlna/DlnaManager.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Common.Configuration;
+using System.Text;
+using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Dlna;
@@ -128,11 +129,29 @@ namespace MediaBrowser.Dlna
else
{
_logger.Debug("No matching device profile found. The default will need to be used.");
+ LogUnmatchedProfile(deviceInfo);
}
return profile;
}
+ private void LogUnmatchedProfile(DeviceIdentification profile)
+ {
+ var builder = new StringBuilder();
+
+ builder.AppendLine(string.Format("DeviceDescription:{0}", profile.DeviceDescription ?? string.Empty));
+ builder.AppendLine(string.Format("FriendlyName:{0}", profile.FriendlyName ?? string.Empty));
+ builder.AppendLine(string.Format("Manufacturer:{0}", profile.Manufacturer ?? string.Empty));
+ builder.AppendLine(string.Format("ManufacturerUrl:{0}", profile.ManufacturerUrl ?? string.Empty));
+ builder.AppendLine(string.Format("ModelDescription:{0}", profile.ModelDescription ?? string.Empty));
+ builder.AppendLine(string.Format("ModelName:{0}", profile.ModelName ?? string.Empty));
+ builder.AppendLine(string.Format("ModelNumber:{0}", profile.ModelNumber ?? string.Empty));
+ builder.AppendLine(string.Format("ModelUrl:{0}", profile.ModelUrl ?? string.Empty));
+ builder.AppendLine(string.Format("SerialNumber:{0}", profile.SerialNumber ?? string.Empty));
+
+ _logger.LogMultiline("No matching device profile found. The default will need to be used.", LogSeverity.Info, builder);
+ }
+
private bool IsMatch(DeviceIdentification deviceInfo, DeviceIdentification profileInfo)
{
if (!string.IsNullOrWhiteSpace(profileInfo.DeviceDescription))
diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj
index 2ea9df5704..d1fed45729 100644
--- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj
+++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj
@@ -72,6 +72,7 @@
<Compile Include="Profiles\Foobar2000Profile.cs" />
<Compile Include="Profiles\Windows81Profile.cs" />
<Compile Include="Profiles\WindowsMediaCenterProfile.cs" />
+ <Compile Include="Profiles\WindowsPhoneProfile.cs" />
<Compile Include="Ssdp\SsdpHelper.cs" />
<Compile Include="PlayTo\SsdpHttpClient.cs" />
<Compile Include="PlayTo\StateVariable.cs" />
diff --git a/MediaBrowser.Dlna/PlayTo/Device.cs b/MediaBrowser.Dlna/PlayTo/Device.cs
index 6b7fb0ceed..fc42e45652 100644
--- a/MediaBrowser.Dlna/PlayTo/Device.cs
+++ b/MediaBrowser.Dlna/PlayTo/Device.cs
@@ -512,17 +512,15 @@ namespace MediaBrowser.Dlna.PlayTo
if (result == null || result.Document == null)
return;
- var track = result.Document.Descendants("CurrentURIMetaData").Select(i => i.Value).FirstOrDefault();
+ var track = result.Document.Descendants("CurrentURIMetaData").FirstOrDefault();
- if (String.IsNullOrEmpty(track))
+ if (track == null)
{
CurrentId = null;
return;
}
- var uPnpResponse = XElement.Parse(track);
-
- var e = uPnpResponse.Element(uPnpNamespaces.items) ?? uPnpResponse;
+ var e = track.Element(uPnpNamespaces.items) ?? track;
var uTrack = uParser.CreateObjectFromXML(new uParserObject
{
@@ -556,7 +554,7 @@ namespace MediaBrowser.Dlna.PlayTo
var durationElem = result.Document.Descendants(uPnpNamespaces.AvTransport + "GetPositionInfoResponse").Select(i => i.Element("TrackDuration")).FirstOrDefault(i => i != null);
var duration = durationElem == null ? null : durationElem.Value;
- if (!string.IsNullOrWhiteSpace(duration))
+ if (!string.IsNullOrWhiteSpace(duration) && !string.Equals(duration, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase))
{
Duration = TimeSpan.Parse(duration, UsCulture);
}
@@ -564,25 +562,22 @@ namespace MediaBrowser.Dlna.PlayTo
var positionElem = result.Document.Descendants(uPnpNamespaces.AvTransport + "GetPositionInfoResponse").Select(i => i.Element("RelTime")).FirstOrDefault(i => i != null);
var position = positionElem == null ? null : positionElem.Value;
- if (!string.IsNullOrWhiteSpace(position))
+ if (!string.IsNullOrWhiteSpace(position) && !string.Equals(position, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase))
{
Position = TimeSpan.Parse(position, UsCulture);
}
- var track = result.Document.Descendants("TrackMetaData").Select(i => i.Value)
- .FirstOrDefault();
+ var track = result.Document.Descendants("TrackMetaData").FirstOrDefault();
- if (String.IsNullOrEmpty(track))
+ if (track == null)
{
//If track is null, some vendors do this, use GetMediaInfo instead
return false;
}
- var uPnpResponse = XElement.Parse(track);
-
- var e = uPnpResponse.Element(uPnpNamespaces.items) ?? uPnpResponse;
+ var e = track.Element(uPnpNamespaces.items) ?? track;
- var uTrack = uBaseObject.Create(e);
+ var uTrack = CreateUBaseObject(e);
if (uTrack == null)
return true;
@@ -592,6 +587,48 @@ namespace MediaBrowser.Dlna.PlayTo
return true;
}
+ private static uBaseObject CreateUBaseObject(XElement container)
+ {
+ if (container == null)
+ {
+ throw new ArgumentNullException("container");
+ }
+
+ return new uBaseObject
+ {
+ Id = container.GetAttributeValue(uPnpNamespaces.Id),
+ ParentId = container.GetAttributeValue(uPnpNamespaces.ParentId),
+ Title = container.GetValue(uPnpNamespaces.title),
+ IconUrl = container.GetValue(uPnpNamespaces.Artwork),
+ SecondText = "",
+ Url = container.GetValue(uPnpNamespaces.Res),
+ ProtocolInfo = GetProtocolInfo(container),
+ MetaData = container.ToString()
+ };
+ }
+
+ private static string[] GetProtocolInfo(XElement container)
+ {
+ if (container == null)
+ {
+ throw new ArgumentNullException("container");
+ }
+
+ var resElement = container.Element(uPnpNamespaces.Res);
+
+ if (resElement != null)
+ {
+ var info = resElement.Attribute(uPnpNamespaces.ProtocolInfo);
+
+ if (info != null && !string.IsNullOrWhiteSpace(info.Value))
+ {
+ return info.Value.Split(':');
+ }
+ }
+
+ return new string[4];
+ }
+
#endregion
#region From XML
diff --git a/MediaBrowser.Dlna/PlayTo/DlnaController.cs b/MediaBrowser.Dlna/PlayTo/DlnaController.cs
index a584408c53..6edb9d6f6e 100644
--- a/MediaBrowser.Dlna/PlayTo/DlnaController.cs
+++ b/MediaBrowser.Dlna/PlayTo/DlnaController.cs
@@ -167,44 +167,46 @@ namespace MediaBrowser.Dlna.PlayTo
if (_currentItem == null || _device.IsStopped)
return;
- if (!_playbackStarted)
+ var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
+
+ if (playlistItem != null)
{
- await _sessionManager.OnPlaybackStart(new PlaybackInfo
+ if (!_playbackStarted)
{
- Item = _currentItem,
- SessionId = _session.Id,
- CanSeek = true,
- QueueableMediaTypes = new List<string> { _currentItem.MediaType }
-
- }).ConfigureAwait(false);
-
- _playbackStarted = true;
- }
-
- if ((_device.IsPlaying || _device.IsPaused))
- {
- var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
- if (playlistItem != null && playlistItem.Transcode)
- {
- await _sessionManager.OnPlaybackProgress(new Controller.Session.PlaybackProgressInfo
+ await _sessionManager.OnPlaybackStart(new PlaybackInfo
{
Item = _currentItem,
SessionId = _session.Id,
- PositionTicks = _device.Position.Ticks + playlistItem.StartPositionTicks,
- IsMuted = _device.IsMuted,
- IsPaused = _device.IsPaused
+ CanSeek = true,
+ QueueableMediaTypes = new List<string> { _currentItem.MediaType },
+ MediaSourceId = playlistItem.MediaSourceId,
+ AudioStreamIndex = playlistItem.AudioStreamIndex,
+ SubtitleStreamIndex = playlistItem.SubtitleStreamIndex
}).ConfigureAwait(false);
+
+ _playbackStarted = true;
}
- else if (_currentItem != null)
+
+ if ((_device.IsPlaying || _device.IsPaused))
{
+ var ticks = _device.Position.Ticks;
+
+ if (playlistItem.Transcode)
+ {
+ ticks += playlistItem.StartPositionTicks;
+ }
+
await _sessionManager.OnPlaybackProgress(new Controller.Session.PlaybackProgressInfo
{
Item = _currentItem,
SessionId = _session.Id,
- PositionTicks = _device.Position.Ticks,
+ PositionTicks = ticks,
IsMuted = _device.IsMuted,
- IsPaused = _device.IsPaused
+ IsPaused = _device.IsPaused,
+ MediaSourceId = playlistItem.MediaSourceId,
+ AudioStreamIndex = playlistItem.AudioStreamIndex,
+ SubtitleStreamIndex = playlistItem.SubtitleStreamIndex
}).ConfigureAwait(false);
}
@@ -284,16 +286,16 @@ namespace MediaBrowser.Dlna.PlayTo
return _device.SetPlay();
case PlaystateCommand.Seek:
- var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
- if (playlistItem != null && playlistItem.Transcode && playlistItem.MediaType == DlnaProfileType.Video && _currentItem != null)
- {
- var newItem = CreatePlaylistItem(_currentItem, command.SeekPositionTicks ?? 0, GetServerAddress());
- playlistItem.StartPositionTicks = newItem.StartPositionTicks;
- playlistItem.StreamUrl = newItem.StreamUrl;
- playlistItem.Didl = newItem.Didl;
- return _device.SetAvTransport(playlistItem.StreamUrl, GetDlnaHeaders(playlistItem), playlistItem.Didl);
-
- }
+ //var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
+ //if (playlistItem != null && playlistItem.Transcode && _currentItem != null)
+ //{
+ // var newItem = CreatePlaylistItem(_currentItem, command.SeekPositionTicks ?? 0, GetServerAddress());
+ // playlistItem.StartPositionTicks = newItem.StartPositionTicks;
+ // playlistItem.StreamUrl = newItem.StreamUrl;
+ // playlistItem.Didl = newItem.Didl;
+ // return _device.SetAvTransport(playlistItem.StreamUrl, GetDlnaHeaders(playlistItem), playlistItem.Didl);
+
+ //}
return _device.Seek(TimeSpan.FromTicks(command.SeekPositionTicks ?? 0));
@@ -324,6 +326,11 @@ namespace MediaBrowser.Dlna.PlayTo
return Task.FromResult(true);
}
+ public Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken)
+ {
+ return Task.FromResult(true);
+ }
+
public Task SendServerShutdownNotification(CancellationToken cancellationToken)
{
return Task.FromResult(true);
@@ -483,7 +490,7 @@ namespace MediaBrowser.Dlna.PlayTo
return (contentFeatures + orgOp + orgCi + dlnaflags).Trim(';');
}
-
+
private PlaylistItem GetPlaylistItem(BaseItem item, List<MediaStream> mediaStreams, DeviceProfile profile)
{
var video = item as Video;
@@ -559,10 +566,10 @@ namespace MediaBrowser.Dlna.PlayTo
_logger.Debug("{0} - SetAvTransport Uri: {1} DlnaHeaders: {2}", _device.Properties.Name, nextTrack.StreamUrl, dlnaheaders);
await _device.SetAvTransport(nextTrack.StreamUrl, dlnaheaders, nextTrack.Didl);
-
+
if (nextTrack.StartPositionTicks > 0 && !nextTrack.Transcode)
await _device.Seek(TimeSpan.FromTicks(nextTrack.StartPositionTicks));
-
+
return true;
}
diff --git a/MediaBrowser.Dlna/PlayTo/Extensions.cs b/MediaBrowser.Dlna/PlayTo/Extensions.cs
index afa7eee72e..05003a65b9 100644
--- a/MediaBrowser.Dlna/PlayTo/Extensions.cs
+++ b/MediaBrowser.Dlna/PlayTo/Extensions.cs
@@ -40,6 +40,13 @@ namespace MediaBrowser.Dlna.PlayTo
return node == null ? null : node.Value;
}
+ public static string GetAttributeValue(this XElement container, XName name)
+ {
+ var node = container.Attribute(name);
+
+ return node == null ? null : node.Value;
+ }
+
public static string GetDescendantValue(this XElement container, XName name)
{
var node = container.Descendants(name)
diff --git a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs
index 42c788d381..889ec86394 100644
--- a/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs
+++ b/MediaBrowser.Dlna/PlayTo/SsdpHttpClient.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using System;
+using System.Globalization;
using System.IO;
using System.Text;
using System.Threading.Tasks;
@@ -44,6 +45,8 @@ namespace MediaBrowser.Dlna.PlayTo
}
}
+ private readonly CultureInfo _usCulture = new CultureInfo("en-US");
+
public async Task SubscribeAsync(string url,
string ip,
int port,
@@ -58,11 +61,13 @@ namespace MediaBrowser.Dlna.PlayTo
LogRequest = _config.Configuration.DlnaOptions.EnableDebugLogging
};
- options.RequestHeaders["HOST"] = ip + ":" + port;
- options.RequestHeaders["CALLBACK"] = "<" + localIp + ":" + eventport + ">";
+ options.RequestHeaders["HOST"] = ip + ":" + port.ToString(_usCulture);
+ options.RequestHeaders["CALLBACK"] = "<" + localIp + ":" + eventport.ToString(_usCulture) + ">";
options.RequestHeaders["NT"] = "upnp:event";
- options.RequestHeaders["TIMEOUT"] = "Second - " + timeOut;
+ options.RequestHeaders["TIMEOUT"] = "Second-" + timeOut.ToString(_usCulture);
+ // TODO: Method should be SUBSCRIBE
+ // https://github.com/stormboy/node-upnp-controlpoint/blob/master/lib/upnp-service.js#L106
using (await _httpClient.Get(options).ConfigureAwait(false))
{
}
@@ -71,8 +76,9 @@ namespace MediaBrowser.Dlna.PlayTo
public async Task RespondAsync(Uri url,
string ip,
int port,
- string localIp,
- int eventport)
+ string localIp,
+ int eventport,
+ int timeOut = 3600)
{
var options = new HttpRequestOptions
{
@@ -80,10 +86,10 @@ namespace MediaBrowser.Dlna.PlayTo
UserAgent = USERAGENT
};
- options.RequestHeaders["HOST"] = ip + ":" + port;
- options.RequestHeaders["CALLBACK"] = "<" + localIp + ":" + eventport + ">";
+ options.RequestHeaders["HOST"] = ip + ":" + port.ToString(_usCulture);
+ options.RequestHeaders["CALLBACK"] = "<" + localIp + ":" + eventport.ToString(_usCulture) + ">";
options.RequestHeaders["NT"] = "upnp:event";
- options.RequestHeaders["TIMEOUT"] = "Second - 3600";
+ options.RequestHeaders["TIMEOUT"] = "Second-" + timeOut.ToString(_usCulture);
using (await _httpClient.Get(options).ConfigureAwait(false))
{
diff --git a/MediaBrowser.Dlna/PlayTo/uBaseObject.cs b/MediaBrowser.Dlna/PlayTo/uBaseObject.cs
index 5831e7dab5..f24f831473 100644
--- a/MediaBrowser.Dlna/PlayTo/uBaseObject.cs
+++ b/MediaBrowser.Dlna/PlayTo/uBaseObject.cs
@@ -1,6 +1,4 @@
-using System;
-using System.Xml.Linq;
-
+
namespace MediaBrowser.Dlna.PlayTo
{
public class uBaseObject
@@ -20,47 +18,5 @@ namespace MediaBrowser.Dlna.PlayTo
public string Url { get; set; }
public string[] ProtocolInfo { get; set; }
-
- public static uBaseObject Create(XElement container)
- {
- if (container == null)
- {
- throw new ArgumentNullException("container");
- }
-
- return new uBaseObject
- {
- Id = container.Attribute(uPnpNamespaces.Id).Value,
- ParentId = container.Attribute(uPnpNamespaces.ParentId).Value,
- Title = container.GetValue(uPnpNamespaces.title),
- IconUrl = container.GetValue(uPnpNamespaces.Artwork),
- SecondText = "",
- Url = container.GetValue(uPnpNamespaces.Res),
- ProtocolInfo = GetProtocolInfo(container),
- MetaData = container.ToString()
- };
- }
-
- private static string[] GetProtocolInfo(XElement container)
- {
- if (container == null)
- {
- throw new ArgumentNullException("container");
- }
-
- var resElement = container.Element(uPnpNamespaces.Res);
-
- if (resElement != null)
- {
- var info = resElement.Attribute(uPnpNamespaces.ProtocolInfo);
-
- if (info != null && !string.IsNullOrWhiteSpace(info.Value))
- {
- return info.Value.Split(':');
- }
- }
-
- return new string[4];
- }
}
}
diff --git a/MediaBrowser.Dlna/Profiles/DefaultProfile.cs b/MediaBrowser.Dlna/Profiles/DefaultProfile.cs
index 13bf467c62..ccecb07c6a 100644
--- a/MediaBrowser.Dlna/Profiles/DefaultProfile.cs
+++ b/MediaBrowser.Dlna/Profiles/DefaultProfile.cs
@@ -1,6 +1,5 @@
-using MediaBrowser.Controller.Dlna;
+using MediaBrowser.Model.Dlna;
using System.Xml.Serialization;
-using MediaBrowser.Model.Dlna;
namespace MediaBrowser.Dlna.Profiles
{
@@ -32,7 +31,7 @@ namespace MediaBrowser.Dlna.Profiles
new TranscodingProfile
{
- Container = "ts",
+ Container = "mp4",
Type = DlnaProfileType.Video,
AudioCodec = "aac",
VideoCodec = "h264",
diff --git a/MediaBrowser.Dlna/Profiles/Windows81Profile.cs b/MediaBrowser.Dlna/Profiles/Windows81Profile.cs
index b7c6372584..000e07b0a9 100644
--- a/MediaBrowser.Dlna/Profiles/Windows81Profile.cs
+++ b/MediaBrowser.Dlna/Profiles/Windows81Profile.cs
@@ -1,5 +1,5 @@
-using System.Xml.Serialization;
-using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Dlna;
+using System.Xml.Serialization;
namespace MediaBrowser.Dlna.Profiles
{
diff --git a/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs b/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs
new file mode 100644
index 0000000000..6ed6abc76b
--- /dev/null
+++ b/MediaBrowser.Dlna/Profiles/WindowsPhoneProfile.cs
@@ -0,0 +1,200 @@
+using MediaBrowser.Model.Dlna;
+using System.Xml.Serialization;
+
+namespace MediaBrowser.Dlna.Profiles
+{
+ [XmlRoot("Profile")]
+ public class WindowsPhoneProfile : DefaultProfile
+ {
+ public WindowsPhoneProfile()
+ {
+ Name = "Windows Phone";
+
+ TranscodingProfiles = new[]
+ {
+ new TranscodingProfile
+ {
+ Container = "mp3",
+ AudioCodec = "mp3",
+ Type = DlnaProfileType.Audio
+ },
+ new TranscodingProfile
+ {
+ Container = "mp4",
+ VideoCodec = "h264",
+ AudioCodec = "aac",
+ Type = DlnaProfileType.Video,
+ VideoProfile = "Baseline"
+ }
+ };
+
+ DirectPlayProfiles = new[]
+ {
+ new DirectPlayProfile
+ {
+ Container = "mp4,mov",
+ VideoCodec = "h264",
+ AudioCodec = "aac,mp3",
+ Type = DlnaProfileType.Video
+ },
+
+ new DirectPlayProfile
+ {
+ Container = "mp4,avi",
+ VideoCodec = "mpeg4,msmpeg4",
+ AudioCodec = "aac,mp3",
+ Type = DlnaProfileType.Video
+ },
+
+ new DirectPlayProfile
+ {
+ Container = "asf",
+ VideoCodec = "wmv2,wmv3,vc1",
+ AudioCodec = "wmav2,wmapro,wmavoice",
+ Type = DlnaProfileType.Video
+ },
+
+ new DirectPlayProfile
+ {
+ Container = "asf",
+ AudioCodec = "wmav2,wmapro,wmavoice",
+ Type = DlnaProfileType.Audio
+ },
+
+ new DirectPlayProfile
+ {
+ Container = "mp4,aac",
+ AudioCodec = "aac",
+ Type = DlnaProfileType.Audio
+ },
+
+ new DirectPlayProfile
+ {
+ Container = "mp3",
+ AudioCodec = "mp3",
+ Type = DlnaProfileType.Audio
+ },
+
+ new DirectPlayProfile
+ {
+ Container = "jpeg,png,gif,bmp",
+ Type = DlnaProfileType.Photo
+ }
+ };
+
+ CodecProfiles = new[]
+ {
+ new CodecProfile
+ {
+ Type = CodecType.Video,
+ Codec="h264",
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "800"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "480"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoBitrate,
+ Value = "1000000",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoFramerate,
+ Value = "24",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoLevel,
+ Value = "3"
+ }
+ }
+ },
+
+ new CodecProfile
+ {
+ Type = CodecType.Video,
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "800"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "480"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoBitrate,
+ Value = "1000000",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoFramerate,
+ Value = "24",
+ IsRequired = false
+ }
+ }
+ },
+
+ new CodecProfile
+ {
+ Type = CodecType.VideoAudio,
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.AudioBitrate,
+ Value = "128000"
+ },
+
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.AudioChannels,
+ Value = "2"
+ }
+ }
+ },
+
+ new CodecProfile
+ {
+ Type = CodecType.Audio,
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.AudioBitrate,
+ Value = "128000"
+ }
+ }
+ }
+ };
+
+ }
+ }
+}