public ResponseProfile GetImageMediaProfile(string container, int?width, int?height) { foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Photo) { continue; } if (!ContainerProfile.ContainsContainer(i.GetContainers(), container)) { continue; } var anyOff = false; foreach (var c in i.Conditions) { if (!ConditionProcessor.IsImageConditionSatisfied(GetModelProfileCondition(c), width, height)) { anyOff = true; break; } } if (anyOff) { continue; } return(i); } return(null); }
public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; TranscodingProfiles = new TranscodingProfile[] { }; ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; SupportedMediaTypes = "Audio,Photo,Video"; }
public bool ContainsCodec(string codec, string container) { if (!ContainsContainer(container)) { return(false); } var codecs = GetCodecs(); return(codecs.Length == 0 || ListHelper.ContainsIgnoreCase(codecs, ContainerProfile.SplitValue(codec)[0])); }
public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; TranscodingProfiles = new TranscodingProfile[] { }; ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; XmlRootAttributes = new XmlAttribute[] { }; SupportedMediaTypes = "Audio,Photo,Video"; }
public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; TranscodingProfiles = new TranscodingProfile[] { }; ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; SubtitleProfiles = Array.Empty <SubtitleProfile>(); XmlRootAttributes = new XmlAttribute[] { }; SupportedMediaTypes = "Audio,Photo,Video"; MaxStreamingBitrate = 8000000; MaxStaticBitrate = 8000000; MusicStreamingTranscodingBitrate = 128000; }
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int?audioChannels, int?audioBitrate, int?audioSampleRate, int?audioBitDepth) { foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Audio) { continue; } if (!ContainerProfile.ContainsContainer(i.GetContainers(), container)) { continue; } var audioCodecs = i.GetAudioCodecs(); if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty)) { continue; } var conditionProcessor = new ConditionProcessor(); var anyOff = false; foreach (ProfileCondition c in i.Conditions) { if (!conditionProcessor.IsAudioConditionSatisfied(GetModelProfileCondition(c), audioChannels, audioBitrate, audioSampleRate, audioBitDepth)) { anyOff = true; break; } } if (anyOff) { continue; } return(i); } return(null); }
public bool SupportsContainer(string container) { return(ContainerProfile.ContainsContainer(Container, container)); }
public string[] GetSupportedMediaTypes() { return(ContainerProfile.SplitValue(SupportedMediaTypes)); }
public KodiProfile() { Name = "Kodi"; MaxStreamingBitrate = 100000000; MusicStreamingTranscodingBitrate = 1280000; TimelineOffsetSeconds = 5; Identification = new DeviceIdentification { ModelName = "Kodi", Headers = new[] { new HttpHeaderInfo {Name = "User-Agent", Value = "Kodi", Match = HeaderMatchType.Substring} } }; TranscodingProfiles = new[] { new TranscodingProfile { Container = "mp3", AudioCodec = "mp3", Type = DlnaProfileType.Audio }, new TranscodingProfile { Container = "ts", Type = DlnaProfileType.Video, AudioCodec = "aac", VideoCodec = "h264" }, new TranscodingProfile { Container = "jpeg", Type = DlnaProfileType.Photo } }; DirectPlayProfiles = new[] { new DirectPlayProfile { Container = "", Type = DlnaProfileType.Video }, new DirectPlayProfile { Container = "", Type = DlnaProfileType.Audio }, new DirectPlayProfile { Container = "", Type = DlnaProfileType.Photo, } }; ResponseProfiles = new ResponseProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; CodecProfiles = new CodecProfile[] { }; SubtitleProfiles = new[] { new SubtitleProfile { Format = "srt", Method = SubtitleDeliveryMethod.External, }, new SubtitleProfile { Format = "sub", Method = SubtitleDeliveryMethod.External, }, new SubtitleProfile { Format = "srt", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "ass", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "ssa", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "smi", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "dvdsub", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "pgs", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "pgssub", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", }, new SubtitleProfile { Format = "sub", Method = SubtitleDeliveryMethod.Embed, DidlMode = "", } }; }
public VlcProfile() { Name = "Vlc"; TimelineOffsetSeconds = 5; Identification = new DeviceIdentification { ModelName = "Vlc", Headers = new[] { new HttpHeaderInfo {Name = "User-Agent", Value = "vlc", Match = HeaderMatchType.Substring} } }; TranscodingProfiles = new[] { new TranscodingProfile { Container = "mp3", Type = DlnaProfileType.Audio, AudioCodec = "mp3" }, new TranscodingProfile { Container = "ts", Type = DlnaProfileType.Video, VideoCodec = "h264", AudioCodec = "aac" }, new TranscodingProfile { Container = "jpeg", Type = DlnaProfileType.Photo } }; DirectPlayProfiles = new[] { new DirectPlayProfile { Container = "avi,mpeg,mkv,ts,mp4,mov,m4v,asf,webm,ogg,ogv,iso", Type = DlnaProfileType.Video }, new DirectPlayProfile { Container = "mp3,flac,asf,off,oga,aac", Type = DlnaProfileType.Audio }, new DirectPlayProfile { Type = DlnaProfileType.Photo, Container = "jpeg,png,gif,bmp,tiff" } }; ResponseProfiles = new ResponseProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; CodecProfiles = new CodecProfile[] { }; }
public List <string> GetContainers() { return(ContainerProfile.SplitValue(Container)); }
private bool ContainsContainer(string container) { return(ContainerProfile.ContainsContainer(Container, container)); }
public ResponseProfile GetVideoMediaProfile(string container, string audioCodec, string videoCodec, int?width, int?height, int?bitDepth, int?videoBitrate, string videoProfile, double?videoLevel, float?videoFramerate, int?packetLength, TransportStreamTimestamp timestamp, bool?isAnamorphic, bool?isInterlaced, int?refFrames, int?numVideoStreams, int?numAudioStreams, string videoCodecTag, bool?isAvc) { foreach (var i in ResponseProfiles) { if (i.Type != DlnaProfileType.Video) { continue; } if (!ContainerProfile.ContainsContainer(i.GetContainers(), container)) { continue; } var audioCodecs = i.GetAudioCodecs(); if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty)) { continue; } var videoCodecs = i.GetVideoCodecs(); if (videoCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty)) { continue; } var anyOff = false; foreach (ProfileCondition c in i.Conditions) { if (!ConditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc)) { anyOff = true; break; } } if (anyOff) { continue; } return(i); } return(null); }
public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; TranscodingProfiles = new TranscodingProfile[] { }; ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; SubtitleProfiles = new SubtitleProfile[] { }; XmlRootAttributes = new XmlAttribute[] { }; SupportedMediaTypes = "Audio,Photo,Video"; MaxStreamingBitrate = 8000000; MaxStaticBitrate = 8000000; MusicStreamingTranscodingBitrate = 128000; }
public string[] GetLanguages() { return(ContainerProfile.SplitValue(Language)); }
public bool SupportsAudioCodec(string codec) { return(ContainerProfile.ContainsContainer(AudioCodec, codec)); }
public DeviceProfile() { DirectPlayProfiles = new DirectPlayProfile[] { }; TranscodingProfiles = new TranscodingProfile[] { }; ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; SoftSubtitleProfiles = new SubtitleProfile[] { }; ExternalSubtitleProfiles = new SubtitleProfile[] { }; XmlRootAttributes = new XmlAttribute[] { }; SupportedMediaTypes = "Audio,Photo,Video"; }
public string[] GetCodecs() { return(ContainerProfile.SplitValue(Codec)); }
public bool SupportsVideoCodec(string codec) { return(Type == DlnaProfileType.Video && ContainerProfile.ContainsContainer(VideoCodec, codec)); }
public bool ContainsAnyCodec(string codec, string container) { return(ContainsAnyCodec(ContainerProfile.SplitValue(codec), container)); }
public bool SupportsAudioCodec(string codec) { return((Type == DlnaProfileType.Audio || Type == DlnaProfileType.Video) && ContainerProfile.ContainsContainer(AudioCodec, codec)); }