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

            ResponseProfiles = new ResponseProfile[] { };
        }
示例#2
0
        public MarantzProfile()
        {
            Name = "Marantz";

            SupportedMediaTypes = "Audio";

            Identification = new DeviceIdentification
            {
                Manufacturer = @"Marantz",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Name  = "User-Agent",
                        Value = "Marantz",
                        Match = HeaderMatchType.Substring
                    }
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container = "aac,mp3,wav,wma,flac",
                    Type      = DlnaProfileType.Audio
                },
            };

            ResponseProfiles = new ResponseProfile[] { };
        }
示例#3
0
        public MediaMonkeyProfile()
        {
            Name = "MediaMonkey";

            SupportedMediaTypes = "Audio";

            Identification = new DeviceIdentification
            {
                FriendlyName = @"MediaMonkey",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Name  = "User-Agent",
                        Value = "MediaMonkey",
                        Match = HeaderMatchType.Substring
                    }
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container = "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac,m4a",
                    Type      = DlnaProfileType.Audio
                }
            };

            ResponseProfiles = Array.Empty <ResponseProfile>();
        }
示例#4
0
        public override void Deserialize(NetworkReader reader)
        {
            BinaryFormatter bf = new BinaryFormatter();
            MemoryStream    ms = new MemoryStream(reader.ReadBytesAndSize());

            DeviceIdentification = (DeviceIdentification)bf.Deserialize(ms);
            ms.Dispose();
        }
示例#5
0
        public void T01_DeviceIdentification()
        {
            var device = TC.CentralDevice;
            var id     = new DeviceIdentification();

            device.Execute(id);
            Console.WriteLine($"Device: {id.Device}");
        }
示例#6
0
        private bool IsMatch(DeviceIdentification deviceInfo, DeviceIdentification profileInfo)
        {
            if (!string.IsNullOrWhiteSpace(profileInfo.DeviceDescription))
            {
                if (deviceInfo.DeviceDescription == null || !Regex.IsMatch(deviceInfo.DeviceDescription, profileInfo.DeviceDescription))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.FriendlyName))
            {
                if (deviceInfo.FriendlyName == null || !Regex.IsMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.Manufacturer))
            {
                if (deviceInfo.Manufacturer == null || !Regex.IsMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.ManufacturerUrl))
            {
                if (deviceInfo.ManufacturerUrl == null || !Regex.IsMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.ModelDescription))
            {
                if (deviceInfo.ModelDescription == null || !Regex.IsMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.ModelName))
            {
                if (deviceInfo.ModelName == null || !Regex.IsMatch(deviceInfo.ModelName, profileInfo.ModelName))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.ModelNumber))
            {
                if (deviceInfo.ModelNumber == null || !Regex.IsMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.ModelUrl))
            {
                if (deviceInfo.ModelUrl == null || !Regex.IsMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl))
                    return false;
            }

            if (!string.IsNullOrWhiteSpace(profileInfo.SerialNumber))
            {
                if (deviceInfo.SerialNumber == null || !Regex.IsMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber))
                    return false;
            }

            return true;
        }
示例#7
0
 public bool IsMatch(DeviceIdentification deviceInfo, DeviceIdentification profileInfo)
 {
     return(IsRegexOrSubstringMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName) &&
            IsRegexOrSubstringMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer) &&
            IsRegexOrSubstringMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl) &&
            IsRegexOrSubstringMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription) &&
            IsRegexOrSubstringMatch(deviceInfo.ModelName, profileInfo.ModelName) &&
            IsRegexOrSubstringMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber) &&
            IsRegexOrSubstringMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl) &&
            IsRegexOrSubstringMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber));
 }
    public void CheckDevice(NetworkMessage message)
    {
        DeviceDataMessage    msg = message.ReadMessage <DeviceDataMessage>();
        DeviceIdentification deviceIdentification = msg.DeviceIdentification;
        var db         = MongoDBConnector.GetInstance().GetDatabase();
        var collection = db.GetCollection <BsonDocument>("Devices");
        var results    = collection.Find(new BsonDocument {
            { "DevId", deviceIdentification.DevId }
        }).ToList();
        int addr = -1;

        if (results.Count > 0)
        {
            foreach (var result in results)
            {
                if (result["ScreenWidth"].AsInt32 == deviceIdentification.ScreenWidth &&
                    result["ScreenHeight"].AsInt32 == deviceIdentification.ScreenHeight &&
                    result["DeviceClass"].AsInt32 == (int)deviceIdentification.DeviceClass)
                {
                    addr = result["id"].AsInt32;
                }
            }
        }
        if (addr == -1)
        {
            var value = collection.Find(new BsonDocument()).Sort(new BsonDocument {
                { "id", -1 }
            }).Limit(1).Project(Builders <BsonDocument> .Projection.Exclude("_id").Include("id"));
            int maxid;
            if (value.Count() > 0)
            {
                maxid = JsonUtility.FromJson <int>(value.ToJson());
            }
            else
            {
                maxid = 0;
            }
            var document = new BsonDocument
            {
                { "id", maxid + 1 },
                { "DevId", deviceIdentification.DevId },
                { "ScreenWidth", deviceIdentification.ScreenWidth },
                { "ScreenHeight", deviceIdentification.ScreenHeight },
                { "DeviceClass", deviceIdentification.DeviceClass }
            };
            collection.InsertOne(document);
            addr = maxid;
        }
        NetworkServer.SendToClient(message.conn.connectionId, MyMsgType.DeviceId, new IntegerMessage(addr));
    }
示例#9
0
        private void timer_Tick(object sender, EventArgs e)
        {
            if (!msgReceived)
            {
                Log.Debug("Message Not Received");
                if (devID == DeviceID.CPAR)
                {
                    Disconnect();
                }
            }

            if (initComm)
            {
                try
                {
                    Log.Debug("Initializing connection");
                    DeviceIdentification devFunction = (DeviceIdentification)FunctionFactory.GetFunction(typeof(DeviceIdentification));
                    Execute(devFunction, true);
                    devID = devFunction.Identity;
                    SetupFunctions(devID);
                    DeviceType.Text = "Device: " + devID.ToString();
                    Log.Debug(DeviceType.Text);

                    initComm = false;
                    Log.Status("Connected");
                }
                catch
                {
                    Disconnect();
                }
            }
            else
            {
                msgReceived = false;

                if (mAutoKick.Text == mAutoKick.Items[1].ToString())
                {
                    var kickWatchdog = new KickWatchdog();
                    Execute(kickWatchdog, false);

                    if (wdCounter > kickWatchdog.Counter)
                    {
                        Log.Error("CPAR Device has reset");
                        wdCounter = kickWatchdog.Counter;
                    }
                }
            }
        }
示例#10
0
        private void LogUnmatchedProfile(DeviceIdentification profile)
        {
            var builder = new StringBuilder();

            builder.AppendLine("No matching device profile found. The default will need to be used.");
            builder.Append("FriendlyName:").AppendLine(profile.FriendlyName);
            builder.Append("Manufacturer:").AppendLine(profile.Manufacturer);
            builder.Append("ManufacturerUrl:").AppendLine(profile.ManufacturerUrl);
            builder.Append("ModelDescription:").AppendLine(profile.ModelDescription);
            builder.Append("ModelName:").AppendLine(profile.ModelName);
            builder.Append("ModelNumber:").AppendLine(profile.ModelNumber);
            builder.Append("ModelUrl:").AppendLine(profile.ModelUrl);
            builder.Append("SerialNumber:").AppendLine(profile.SerialNumber);

            _logger.LogInformation(builder.ToString());
        }
示例#11
0
文件: DlnaManager.cs 项目: vvuk/Emby
        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);
        }
示例#12
0
        private void LogUnmatchedProfile(DeviceIdentification profile)
        {
            var builder = new StringBuilder();

            builder.AppendLine("No matching device profile found. The default will need to be used.");
            builder.AppendFormat(CultureInfo.InvariantCulture, "FriendlyName:{0}", profile.FriendlyName ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "Manufacturer:{0}", profile.Manufacturer ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "ManufacturerUrl:{0}", profile.ManufacturerUrl ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "ModelDescription:{0}", profile.ModelDescription ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "ModelName:{0}", profile.ModelName ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "ModelNumber:{0}", profile.ModelNumber ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "ModelUrl:{0}", profile.ModelUrl ?? string.Empty).AppendLine();
            builder.AppendFormat(CultureInfo.InvariantCulture, "SerialNumber:{0}", profile.SerialNumber ?? string.Empty).AppendLine();

            _logger.LogInformation(builder.ToString());
        }
        public int Accept(DeviceIdentification func)
        {
            Log.Debug("Default Petripheral: DeviceIdentification");
            func.ManufactureID = Manufacturer.InventorsWay;
            func.Manufacture   = "Inventors' Way ApS";
            func.DeviceID      = UInt16.MaxValue;
            func.Device        = "Default Peripheral";

            func.MajorVersion       = 1;
            func.MinorVersion       = 0;
            func.PatchVersion       = 0;
            func.EngineeringVersion = 0;

            func.Checksum     = 0;
            func.SerialNumber = 1;

            return(0);
        }
示例#14
0
        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,mpegts,m4v",
                    Type      = DlnaProfileType.Video
                }
            };

            ResponseProfiles = new ResponseProfile[]
            {
                new ResponseProfile
                {
                    Container = "m4v",
                    Type      = DlnaProfileType.Video,
                    MimeType  = "video/mp4"
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.Embed
                }
            };
        }
示例#15
0
        public DenonAvrProfile()
        {
            Name = "Denon AVR";

            Identification = new DeviceIdentification
            {
                FriendlyName = @"Denon:\[AVR:.*",
                Manufacturer = "Denon"
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container = "mp3,flac,m4a,wma",
                    Type      = DlnaProfileType.Audio
                },
            };
        }
示例#16
0
        /// <inheritdoc />
        public DeviceProfile?GetProfile(DeviceIdentification deviceInfo)
        {
            if (deviceInfo == null)
            {
                throw new ArgumentNullException(nameof(deviceInfo));
            }

            var profile = GetProfiles()
                          .FirstOrDefault(i => i.Identification != null && IsMatch(deviceInfo, i.Identification));

            if (profile == null)
            {
                _logger.LogInformation("No matching device profile found. The default will need to be used. \n{@Profile}", deviceInfo);
            }
            else
            {
                _logger.LogDebug("Found matching device profile: {ProfileName}", profile.Name);
            }

            return(profile);
        }
示例#17
0
        public Foobar2000Profile()
        {
            Name = "foobar2000";

            SupportedMediaTypes = "Audio";

            Identification = new DeviceIdentification
            {
                FriendlyName = @"foobar",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Name  = "User-Agent",
                        Value = "foobar",
                        Match = HeaderMatchType.Substring
                    }
                }
            };
        }
示例#18
0
        public DeviceProfile GetProfile(DeviceIdentification deviceInfo)
        {
            if (deviceInfo == null)
            {
                throw new ArgumentNullException(nameof(deviceInfo));
            }

            var profile = GetProfiles()
                          .FirstOrDefault(i => i.Identification != null && IsMatch(deviceInfo, i.Identification));

            if (profile != null)
            {
                _logger.LogDebug("Found matching device profile: {0}", profile.Name);
            }
            else
            {
                LogUnmatchedProfile(deviceInfo);
            }

            return(profile);
        }
示例#19
0
文件: DlnaManager.cs 项目: vvuk/Emby
        public DeviceProfile GetProfile(DeviceIdentification deviceInfo)
        {
            if (deviceInfo == null)
            {
                throw new ArgumentNullException("deviceInfo");
            }

            var profile = GetProfiles()
                          .FirstOrDefault(i => i.Identification != null && IsMatch(deviceInfo, i.Identification));

            if (profile != null)
            {
                _logger.Debug("Found matching device profile: {0}", profile.Name);
            }
            else
            {
                _logger.Debug("No matching device profile found. The default will need to be used.");
                LogUnmatchedProfile(deviceInfo);
            }

            return(profile);
        }
示例#20
0
        public DenonAvrProfile()
        {
            Name = "Denon AVR";

            SupportedMediaTypes = "Audio";

            Identification = new DeviceIdentification
            {
                FriendlyName = @"Denon:\[AVR:.*",
                Manufacturer = "Denon"
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container = "mp3,flac,m4a,wma",
                    Type      = DlnaProfileType.Audio
                },
            };

            ResponseProfiles = System.Array.Empty <ResponseProfile>();
        }
示例#21
0
        public SonyBravia2011Profile()
        {
            Name = "Sony Bravia (2011)";

            Identification = new DeviceIdentification
            {
                FriendlyName = @"KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*",
                Manufacturer = "Sony",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Name  = "X-AV-Client-Info",
                        Value = @".*KDL-[0-9]{2}([A-Z]X[0-9]2[0-9]|CX400).*",
                        Match = HeaderMatchType.Regex
                    }
                }
            };

            AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");

            AlbumArtPn = "JPEG_TN";

            ModelName                 = "Windows Media Player Sharing";
            ModelNumber               = "3.0";
            ModelUrl                  = "http://www.microsoft.com/";
            Manufacturer              = "Microsoft Corporation";
            ManufacturerUrl           = "http://www.microsoft.com/";
            SonyAggregationFlags      = "10";
            EnableSingleAlbumArtLimit = true;
            EnableAlbumArtInDidl      = true;

            TranscodingProfiles = new[]
            {
                new TranscodingProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },
                new TranscodingProfile
                {
                    Container            = "ts",
                    VideoCodec           = "h264",
                    AudioCodec           = "ac3",
                    Type                 = DlnaProfileType.Video,
                    EnableMpegtsM2TsMode = true
                },
                new TranscodingProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container  = "ts,mpegts",
                    VideoCodec = "h264",
                    AudioCodec = "ac3,aac,mp3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "ts,mpegts",
                    VideoCodec = "mpeg2video",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "mp4,m4v",
                    VideoCodec = "h264,mpeg4",
                    AudioCodec = "ac3,aac,mp3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "mpeg",
                    VideoCodec = "mpeg2video,mpeg1video",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "asf",
                    VideoCodec = "wmv2,wmv3,vc1",
                    AudioCodec = "wmav2,wmapro,wmavoice",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },
                new DirectPlayProfile
                {
                    Container  = "asf",
                    AudioCodec = "wmav2,wmapro,wmavoice",
                    Type       = DlnaProfileType.Audio
                }
            };

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

            ResponseProfiles = new[]
            {
                new ResponseProfile
                {
                    Container  = "ts,mpegts",
                    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.PacketLength,
                            Value     = "192"
                        },
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.Equals,
                            Property  = ProfileConditionValue.VideoTimestamp,
                            Value     = "Valid"
                        }
                    }
                },

                new ResponseProfile
                {
                    Container  = "ts,mpegts",
                    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.PacketLength,
                            Value     = "188"
                        }
                    }
                },

                new ResponseProfile
                {
                    Container  = "ts,mpegts",
                    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 ResponseProfile
                {
                    Container  = "ts,mpegts",
                    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 ResponseProfile
                {
                    Container  = "mpeg",
                    VideoCodec = "mpeg1video,mpeg2video",
                    MimeType   = "video/mpeg",
                    OrgPn      = "MPEG_PS_NTSC,MPEG_PS_PAL",
                    Type       = DlnaProfileType.Video
                },
                new ResponseProfile
                {
                    Container = "m4v",
                    Type      = DlnaProfileType.Video,
                    MimeType  = "video/mp4"
                }
            };

            CodecProfiles = new[]
            {
                new CodecProfile
                {
                    Type       = CodecType.Video,
                    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     = "20000000"
                        },
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.VideoLevel,
                            Value     = "41"
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.Video,
                    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     = "20000000"
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.Video,
                    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 CodecProfile
                {
                    Type  = CodecType.VideoAudio,
                    Codec = "ac3",

                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "6"
                        }
                    }
                },

                new CodecProfile
                {
                    Type  = CodecType.VideoAudio,
                    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"
                        }
                    }
                },

                new CodecProfile
                {
                    Type  = CodecType.VideoAudio,
                    Codec = "mp3,mp2",

                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "2"
                        }
                    }
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.Embed
                }
            };
        }
示例#22
0
        public DishHopperJoeyProfile()
        {
            Name = "Dish Hopper-Joey";

            ProtocolInfo = "http-get:*:video/mp2t:*,http-get:*:video/mpeg:*,http-get:*:video/MP1S:*,http-get:*:video/mpeg2:*,http-get:*:video/mp4:*,http-get:*:video/x-matroska:*,http-get:*:audio/mpeg:*,http-get:*:audio/mpeg3:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/mp4a-latm:*,http-get:*:image/jpeg:*";

            Identification = new DeviceIdentification
            {
                Manufacturer    = "Echostar Technologies LLC",
                ManufacturerUrl = "http://www.echostar.com",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Match = HeaderMatchType.Substring,
                        Name  = "User-Agent",
                        Value = "Zip_"
                    }
                }
            };

            TranscodingProfiles = new[]
            {
                new TranscodingProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },
                new TranscodingProfile
                {
                    Container  = "mp4",
                    Type       = DlnaProfileType.Video,
                    AudioCodec = "aac",
                    VideoCodec = "h264"
                },

                new TranscodingProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container  = "mp4,mkv,mpeg,ts",
                    VideoCodec = "h264,mpeg2video",
                    AudioCodec = "mp3,ac3,aac,he-aac,pcm",
                    Type       = DlnaProfileType.Video
                },

                new DirectPlayProfile
                {
                    Container = "mp3,alac,flac",
                    Type      = DlnaProfileType.Audio
                },

                new DirectPlayProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            CodecProfiles = new[]
            {
                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Codec      = "h264",
                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.Width,
                            Value      = "1920",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.Height,
                            Value      = "1080",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoFramerate,
                            Value      = "30",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitrate,
                            Value      = "20000000",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoLevel,
                            Value      = "41",
                            IsRequired = true
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.Width,
                            Value      = "1920",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.Height,
                            Value      = "1080",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoFramerate,
                            Value      = "30",
                            IsRequired = true
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitrate,
                            Value      = "20000000",
                            IsRequired = true
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Codec      = "ac3,he-aac",
                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.AudioChannels,
                            Value      = "6",
                            IsRequired = true
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Codec      = "aac",
                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.AudioChannels,
                            Value      = "2",
                            IsRequired = true
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Conditions = new[]
                    {
                        // The device does not have any audio switching capabilities
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.Equals,
                            Property  = ProfileConditionValue.IsSecondaryAudio,
                            Value     = "false"
                        }
                    }
                }
            };

            ResponseProfiles = new[]
            {
                new ResponseProfile
                {
                    Container = "mkv,ts,mpegts",
                    Type      = DlnaProfileType.Video,
                    MimeType  = "video/mp4"
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.Embed
                }
            };
        }
示例#23
0
        public SamsungSmartTvProfile()
        {
            Name = "Samsung Smart TV";

            EnableAlbumArtInDidl = true;

            Identification = new DeviceIdentification
            {
                ModelUrl = "samsung.com"
            };

            XmlRootAttributes = new[]
            {
                new XmlAttribute
                {
                    Name  = "xmlns:sec",
                    Value = "http://www.sec.co.kr/"
                }
            };

            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.Video,
                    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.Video,
                    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.Video,
                    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.Video,
                    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.VideoAudio,
                    Codec = "ac3,wmav2,dca,aac,mp3",

                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "6"
                        }
                    }
                }
            };

            ResponseProfiles = new[]
            {
                new ResponseProfile
                {
                    Container = "avi",
                    MimeType  = "video/x-msvideo",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "mkv",
                    MimeType  = "video/x-mkv",
                    Type      = DlnaProfileType.Video
                }
            };
        }
示例#24
0
        public XboxOneProfile()
        {
            Name = "Xbox One";

            TimelineOffsetSeconds = 40;

            Identification = new DeviceIdentification
            {
                ModelName = "Xbox One",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Name = "FriendlyName.DLNA.ORG", Value = "XboxOne", Match = HeaderMatchType.Substring
                    },
                    new HttpHeaderInfo
                    {
                        Name = "User-Agent", Value = "NSPlayer/12", Match = HeaderMatchType.Substring
                    }
                }
            };

            var videoProfile = "high|main|baseline|constrained baseline";
            var videoLevel   = "41";

            TranscodingProfiles = new[]
            {
                new TranscodingProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },
                new TranscodingProfile
                {
                    Container  = "jpeg",
                    VideoCodec = "jpeg",
                    Type       = DlnaProfileType.Photo
                },
                new TranscodingProfile
                {
                    Container  = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "aac",
                    Type       = DlnaProfileType.Video
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container  = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "ac3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "avi",
                    VideoCodec = "mpeg4",
                    AudioCodec = "ac3,mp3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "avi",
                    VideoCodec = "h264",
                    AudioCodec = "aac",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "mp4,mov,mkv",
                    VideoCodec = "h264,mpeg4",
                    AudioCodec = "aac,ac3",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "asf",
                    VideoCodec = "wmv2,wmv3,vc1",
                    AudioCodec = "wmav2,wmapro",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "asf",
                    AudioCodec = "wmav2,wmapro,wmavoice",
                    Type       = DlnaProfileType.Audio
                },
                new DirectPlayProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },
                new DirectPlayProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            ContainerProfiles = new[]
            {
                new ContainerProfile
                {
                    Type      = DlnaProfileType.Video,
                    Container = "mp4,mov",

                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.Equals,
                            Property   = ProfileConditionValue.Has64BitOffsets,
                            Value      = "false",
                            IsRequired = false
                        }
                    }
                }
            };

            CodecProfiles = new[]
            {
                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Codec      = "mpeg4",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.NotEquals,
                            Property   = ProfileConditionValue.IsAnamorphic,
                            Value      = "true",
                            IsRequired = false
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitDepth,
                            Value      = "8",
                            IsRequired = false
                        },
                        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      = "5120000",
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Codec      = "h264",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.NotEquals,
                            Property   = ProfileConditionValue.IsAnamorphic,
                            Value      = "true",
                            IsRequired = false
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitDepth,
                            Value      = "8",
                            IsRequired = false
                        },
                        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.VideoLevel,
                            Value      = videoLevel,
                            IsRequired = false
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.EqualsAny,
                            Property   = ProfileConditionValue.VideoProfile,
                            Value      = videoProfile,
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Codec      = "wmv2,wmv3,vc1",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.NotEquals,
                            Property   = ProfileConditionValue.IsAnamorphic,
                            Value      = "true",
                            IsRequired = false
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitDepth,
                            Value      = "8",
                            IsRequired = false
                        },
                        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 CodecProfile
                {
                    Type       = CodecType.Video,
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.NotEquals,
                            Property   = ProfileConditionValue.IsAnamorphic,
                            Value      = "true",
                            IsRequired = false
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitDepth,
                            Value      = "8",
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Codec      = "ac3,wmav2,wmapro",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.AudioChannels,
                            Value      = "6",
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Codec      = "aac",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.AudioChannels,
                            Value      = "2",
                            IsRequired = false
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.Equals,
                            Property   = ProfileConditionValue.AudioProfile,
                            Value      = "lc",
                            IsRequired = false
                        }
                    }
                }
            };

            ResponseProfiles = new[]
            {
                new ResponseProfile
                {
                    Container = "avi",
                    MimeType  = "video/avi",
                    Type      = DlnaProfileType.Video
                }
            };
        }
示例#25
0
        public Windows81Profile()
        {
            Name = "Windows 8/RT";

            Identification = new DeviceIdentification
            {
                Manufacturer = "Microsoft SDK Customer"
            };

            TranscodingProfiles = new[]
            {
                new TranscodingProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio,
                    Context    = EncodingContext.Streaming
                },
                new TranscodingProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio,
                    Context    = EncodingContext.Static
                },
                new TranscodingProfile
                {
                    Protocol   = "hls",
                    Container  = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "aac",
                    Type       = DlnaProfileType.Video,
                    Context    = EncodingContext.Streaming
                },
                new TranscodingProfile
                {
                    Container  = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "aac",
                    Type       = DlnaProfileType.Video,
                    Context    = EncodingContext.Streaming
                },
                new TranscodingProfile
                {
                    Container  = "mp4",
                    VideoCodec = "h264",
                    AudioCodec = "aac,ac3,eac3",
                    Type       = DlnaProfileType.Video,
                    Context    = EncodingContext.Static
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container  = "mp4,mov",
                    VideoCodec = "h264,mpeg4",
                    AudioCodec = "aac,ac3,eac3,mp3,pcm",
                    Type       = DlnaProfileType.Video
                },

                new DirectPlayProfile
                {
                    Container  = "ts",
                    VideoCodec = "h264",
                    AudioCodec = "aac,ac3,eac3,mp3,mp2,pcm",
                    Type       = DlnaProfileType.Video
                },

                new DirectPlayProfile
                {
                    Container  = "asf",
                    VideoCodec = "wmv2,wmv3,vc1",
                    AudioCodec = "wmav2,wmapro,wmavoice",
                    Type       = DlnaProfileType.Video
                },

                new DirectPlayProfile
                {
                    Container  = "avi",
                    VideoCodec = "mpeg4,msmpeg4,mjpeg",
                    AudioCodec = "mp3,ac3,eac3,mp2,pcm",
                    Type       = DlnaProfileType.Video
                },

                new DirectPlayProfile
                {
                    Container  = "mp4",
                    AudioCodec = "aac",
                    Type       = DlnaProfileType.Audio
                },

                new DirectPlayProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },

                new DirectPlayProfile
                {
                    Container  = "m4a",
                    AudioCodec = "aac",
                    VideoCodec = "",
                    Type       = DlnaProfileType.Audio
                },

                new DirectPlayProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            CodecProfiles = new[]
            {
                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Codec      = "h264",
                    Conditions = new []
                    {
                        // Note: Add any of the following if supported

                        //"Constrained Baseline",
                        //"Baseline",
                        //"Extended",
                        //"Main",
                        //"High",
                        //"Progressive High",
                        //"Constrained High"

                        // The first one in the list should be the higest one, e.g. if High profile is supported, make sure it appears before baseline: high|baseline

                        new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "high|main|extended|baseline|constrained baseline"),
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.VideoLevel,
                            Value     = "51"
                        },
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitDepth,
                            Value      = "8",
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.Video,
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.VideoBitDepth,
                            Value      = "8",
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Codec      = "aac,eac3",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "8"
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    Codec      = "ac3",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "6"
                        }
                    }
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "vtt",
                    Method = SubtitleDeliveryMethod.External
                }
            };
        }
示例#26
0
        public SonyBlurayPlayerProfile()
        {
            Name = "Sony Blu-ray Player";

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

            AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");

            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,mpegts",
                    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,m4v",
                    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.Video,
                    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.VideoAudio,
                    Codec      = "ac3",
                    Conditions = new []
                    {
                        new ProfileCondition
                        {
                            Condition  = ProfileConditionType.LessThanEqual,
                            Property   = ProfileConditionValue.AudioChannels,
                            Value      = "6",
                            IsRequired = false
                        }
                    }
                },

                new CodecProfile
                {
                    Type       = CodecType.VideoAudio,
                    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"
                        }
                    }
                }
            };

            ResponseProfiles = new[]
            {
                new ResponseProfile
                {
                    Container  = "ts,mpegts",
                    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 ResponseProfile
                {
                    Container = "avi",
                    MimeType  = "video/mpeg",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "mkv",
                    MimeType  = "video/vnd.dlna.mpeg-tts",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "ts,mpegts",
                    MimeType  = "video/vnd.dlna.mpeg-tts",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "mp4",
                    MimeType  = "video/mpeg",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "m4v",
                    MimeType  = "video/mpeg",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "mpeg",
                    MimeType  = "video/mpeg",
                    Type      = DlnaProfileType.Video
                },

                new ResponseProfile
                {
                    Container = "mp3",
                    MimeType  = "audio/mpeg",
                    Type      = DlnaProfileType.Audio
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.Embed
                }
            };
        }
示例#27
0
        public DirectTvProfile()
        {
            Name = "DirecTV HD-DVR";

            TimelineOffsetSeconds   = 10;
            RequiresPlainFolders    = true;
            RequiresPlainVideoItems = true;

            Identification = new DeviceIdentification
            {
                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Match = HeaderMatchType.Substring,
                        Name  = "User-Agent",
                        Value = "DIRECTV"
                    }
                },

                FriendlyName = "^DIRECTV.*$"
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container  = "mpeg",
                    VideoCodec = "mpeg2video",
                    AudioCodec = "mp2",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container = "jpeg,jpg",
                    Type      = DlnaProfileType.Photo
                }
            };

            TranscodingProfiles = new[]
            {
                new TranscodingProfile
                {
                    Container  = "mpeg",
                    VideoCodec = "mpeg2video",
                    AudioCodec = "mp2",
                    Type       = DlnaProfileType.Video
                },
                new TranscodingProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            CodecProfiles = new[]
            {
                new CodecProfile
                {
                    Codec = "mpeg2video",
                    Type  = CodecType.Video,

                    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
                {
                    Codec = "mp2",
                    Type  = CodecType.Audio,

                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "2"
                        }
                    }
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.Embed
                }
            };

            ResponseProfiles = new ResponseProfile[] { };
        }
示例#28
0
 private bool IsMatch(IHeaderDictionary headers, DeviceIdentification profileInfo)
 {
     return(profileInfo.Headers.Any(i => IsMatch(headers, i)));
 }
示例#29
0
        private bool IsMatch(DeviceIdentification deviceInfo, DeviceIdentification profileInfo)
        {
            if (!string.IsNullOrEmpty(profileInfo.FriendlyName))
            {
                if (deviceInfo.FriendlyName == null || !IsRegexOrSubstringMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.Manufacturer))
            {
                if (deviceInfo.Manufacturer == null || !IsRegexOrSubstringMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.ManufacturerUrl))
            {
                if (deviceInfo.ManufacturerUrl == null || !IsRegexOrSubstringMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.ModelDescription))
            {
                if (deviceInfo.ModelDescription == null || !IsRegexOrSubstringMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.ModelName))
            {
                if (deviceInfo.ModelName == null || !IsRegexOrSubstringMatch(deviceInfo.ModelName, profileInfo.ModelName))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.ModelNumber))
            {
                if (deviceInfo.ModelNumber == null || !IsRegexOrSubstringMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.ModelUrl))
            {
                if (deviceInfo.ModelUrl == null || !IsRegexOrSubstringMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl))
                {
                    return(false);
                }
            }

            if (!string.IsNullOrEmpty(profileInfo.SerialNumber))
            {
                if (deviceInfo.SerialNumber == null || !IsRegexOrSubstringMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber))
                {
                    return(false);
                }
            }

            return(true);
        }
示例#30
0
        public LgTvProfile()
        {
            Name = "LG Smart TV";

            TimelineOffsetSeconds = 10;

            Identification = new DeviceIdentification
            {
                FriendlyName = @"LG.*",

                Headers = new[]
                {
                    new HttpHeaderInfo
                    {
                        Name  = "User-Agent",
                        Value = "LG",
                        Match = HeaderMatchType.Substring
                    }
                }
            };

            TranscodingProfiles = new[]
            {
                new TranscodingProfile
                {
                    Container  = "mp3",
                    AudioCodec = "mp3",
                    Type       = DlnaProfileType.Audio
                },
                new TranscodingProfile
                {
                    Container  = "ts",
                    AudioCodec = "ac3,aac,mp3",
                    VideoCodec = "h264",
                    Type       = DlnaProfileType.Video
                },
                new TranscodingProfile
                {
                    Container = "jpeg",
                    Type      = DlnaProfileType.Photo
                }
            };

            DirectPlayProfiles = new[]
            {
                new DirectPlayProfile
                {
                    Container  = "ts,mpegts,avi,mkv",
                    VideoCodec = "h264",
                    AudioCodec = "aac,ac3,mp3,dca,dts",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container  = "mp4,m4v",
                    VideoCodec = "h264,mpeg4",
                    AudioCodec = "aac,ac3,mp3,dca,dts",
                    Type       = DlnaProfileType.Video
                },
                new DirectPlayProfile
                {
                    Container = "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.Video,
                    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 CodecProfile
                {
                    Type  = CodecType.Video,
                    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.VideoLevel,
                            Value     = "41"
                        }
                    }
                },

                new CodecProfile
                {
                    Type  = CodecType.VideoAudio,
                    Codec = "ac3,aac,mp3",

                    Conditions = new[]
                    {
                        new ProfileCondition
                        {
                            Condition = ProfileConditionType.LessThanEqual,
                            Property  = ProfileConditionValue.AudioChannels,
                            Value     = "6"
                        }
                    }
                }
            };

            SubtitleProfiles = new[]
            {
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.Embed
                },
                new SubtitleProfile
                {
                    Format = "srt",
                    Method = SubtitleDeliveryMethod.External
                }
            };

            ResponseProfiles = new ResponseProfile[]
            {
                new ResponseProfile
                {
                    Container = "m4v",
                    Type      = DlnaProfileType.Video,
                    MimeType  = "video/mp4"
                }
            };
        }