public EncoderWrapper(string filename, EncoderConfig encCfg) { this.filename = filename; this.mediaStream = null; this.encCfg = encCfg; if (!encCfg.useTranscoding) return; SetupPipes(); Start(); }
public EncoderWrapper(Stream mediaStream, EncoderConfig encCfg) { this.filename = ""; this.mediaStream = mediaStream; this.encCfg = encCfg; if (!encCfg.useTranscoding) return; SetupPipes(); Start(); }
public static bool LoadSettings() { try { XmlDocument doc = new XmlDocument(); Log.Info("MPWebServices: config.xml=" + baseDir + "\\MPWebServices\\config.xml"); doc.Load(baseDir + "\\MPWebServices\\config.xml"); XmlNode gNode = doc.SelectSingleNode("/appconfig/config"); httpPort = Int32.Parse(gNode.Attributes["httpport"].Value); thumbHeight = Int32.Parse(gNode.Attributes["thumbheight"].Value); thumbWidth = Int32.Parse(gNode.Attributes["thumbwidth"].Value); clientPlayer = gNode.Attributes["clientplayerpath"].Value; playerType = Int32.Parse(gNode.Attributes["playertype"].Value); streamURL = gNode.Attributes["streamurl"].Value; scraperURL = gNode.Attributes["scraper_url"].Value; if (streamURL == "") streamURL = "http://" + Environment.MachineName + ":" + httpPort.ToString(); webUid = gNode.Attributes["username"].Value; webPwd = gNode.Attributes["password"].Value; XmlNodeList dbNodes = doc.SelectNodes("/appconfig/mpdatabases/database"); foreach (XmlNode node in dbNodes) { switch (node.Attributes["name"].Value) { case "movies": dbLocations.db_movies = SetDbLocation(node, "VideoDatabaseV5.db3"); break; case "music": dbLocations.db_music = SetDbLocation(node, "MusicDatabaseV11.db3"); break; case "pictures": dbLocations.db_pictures = SetDbLocation(node, "PictureDatabase.db3"); break; case "tvseries": dbLocations.db_tvseries = SetDbLocation(node, "TvSeriesDatabase4.db3"); break; case "movingpictures": dbLocations.db_movingpictures = SetDbLocation(node, "movingpictures.db3"); break; } } dbNodes = doc.SelectNodes("/appconfig/thumbpaths/thumb"); foreach (XmlNode node in dbNodes) { switch (node.Attributes["name"].Value) { case "tv": thumbs.tv = node.Attributes["path"].Value; break; case "radio": thumbs.radio = node.Attributes["path"].Value; break; case "pictures": thumbs.pictures = node.Attributes["path"].Value; break; } } XmlNodeList nodes = doc.SelectNodes("/appconfig/transcoders/transcoder"); encCfgs = new List<EncoderConfig>(); foreach (XmlNode node in nodes) { EncoderConfig cfg = new EncoderConfig(node.Attributes["name"].Value, (node.Attributes["usetranscoding"].Value == "1"), node.Attributes["filename"].Value, node.Attributes["args"].Value, (TransportMethod)Int32.Parse(node.Attributes["inputmethod"].Value), (TransportMethod)Int32.Parse(node.Attributes["outputmethod"].Value)); encCfgs.Add(cfg); } } catch (Exception ex) { Log.Error("MPWebServices: Exception raised while loading settings:" + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace); return false; } return true; }
private void LoadConfig() { XmlDocument doc = new XmlDocument(); doc.Load(Application.StartupPath + "\\config.xml"); XmlNode gNode = doc.SelectSingleNode("/appconfig/config"); httpPort = Int32.Parse(gNode.Attributes["httpport"].Value); tvServerHost = gNode.Attributes["tvserverhost"].Value; if (tvServerHost == "") tvServerHost = Environment.MachineName; thumbHeight = Int32.Parse(gNode.Attributes["thumbheight"].Value); thumbWidth = Int32.Parse(gNode.Attributes["thumbwidth"].Value); clientPlayer = gNode.Attributes["clientplayerpath"].Value; playerType = Int32.Parse(gNode.Attributes["playertype"].Value); uid = gNode.Attributes["username"].Value; pwd = gNode.Attributes["password"].Value; XmlNodeList nodes=doc.SelectNodes("/appconfig/transcoders/transcoder"); encCfgs=new List<EncoderConfig>(); foreach (XmlNode node in nodes) { EncoderConfig cfg = new EncoderConfig(node.Attributes["name"].Value, (node.Attributes["usetranscoding"].Value == "1"), node.Attributes["filename"].Value, node.Attributes["args"].Value, (TransportMethod)Int32.Parse(node.Attributes["inputmethod"].Value), (TransportMethod)Int32.Parse(node.Attributes["outputmethod"].Value)); encCfgs.Add(cfg); } }
public static List<EncoderConfig> LoadConfig() { List<EncoderConfig> encCfgs = new List<EncoderConfig>(); XmlDocument doc = new XmlDocument(); doc.Load(configFile); XmlNodeList nodes = doc.SelectNodes("/appconfig/transcoders/transcoder"); encCfgs = new List<EncoderConfig>(); foreach (XmlNode node in nodes) { EncoderConfig cfg = new EncoderConfig(node.Attributes["name"].Value, (node.Attributes["usetranscoding"].Value == "1"), node.Attributes["filename"].Value, node.Attributes["args"].Value, (TransportMethod)Int32.Parse(node.Attributes["inputmethod"].Value), (TransportMethod)Int32.Parse(node.Attributes["outputmethod"].Value)); encCfgs.Add(cfg); } return encCfgs; }