// Get configuration object public object GetConfiguration() { RtpStreamConfiguration config = new RtpStreamConfiguration(); config.source = urlBox.Text; config.video_port = int.Parse(portBox.Text); config.dest = sourceDest.Text; return((object)config); }
// Set configuration public void SetConfiguration(object config) { RtpStreamConfiguration cfg = (RtpStreamConfiguration)config; if (cfg != null) { urlBox.Text = cfg.source; portBox.Text = cfg.video_port.ToString(); sourceDest.Text = cfg.dest; } }
// Save configuration public void SaveConfiguration(XmlTextWriter writer, object config) { RtpStreamConfiguration cfg = (RtpStreamConfiguration)config; if (cfg != null) { writer.WriteAttributeString("source", cfg.source); writer.WriteAttributeString("dest", cfg.dest); writer.WriteAttributeString("ssrc", cfg.ssrc); writer.WriteAttributeString("video_port", cfg.video_port.ToString()); writer.WriteAttributeString("audio_port", cfg.video_port.ToString()); writer.WriteAttributeString("video_codec", cfg.video_codec); writer.WriteAttributeString("audio_codec", cfg.audio_codec); writer.WriteAttributeString("video_width", cfg.video_width.ToString()); writer.WriteAttributeString("video_height", cfg.video_height.ToString()); writer.WriteAttributeString("video_quality", cfg.video_quality.ToString()); } }
// Load configuration public object LoadConfiguration(XmlTextReader reader) { RtpStreamConfiguration config = new RtpStreamConfiguration(); try { config.source = reader.GetAttribute("source"); config.dest = reader.GetAttribute("dest"); config.ssrc = reader.GetAttribute("ssrc"); config.video_port = int.Parse(reader.GetAttribute("video_port")); config.audio_port = int.Parse(reader.GetAttribute("audio_port")); config.video_codec = reader.GetAttribute("video_codec"); config.audio_codec = reader.GetAttribute("audio_codec"); config.video_width = int.Parse(reader.GetAttribute("video_width")); config.video_height = int.Parse(reader.GetAttribute("video_height")); config.video_quality = int.Parse(reader.GetAttribute("video_quality")); } catch (Exception) { } return((object)config); }
// Load configuration public object LoadConfiguration(Hashtable reader) { RtpStreamConfiguration config = new RtpStreamConfiguration(); try { config.source = (string)reader["source"]; config.dest = (string)reader["dest"]; config.ssrc = (string)reader["ssrc"]; config.video_port = (int)reader["video_port"]; config.audio_port = (int)reader["audio_port"]; config.video_codec = (string)reader["video_codec"]; config.audio_codec = (string)reader["audio_codec"]; config.video_width = (int)reader["video_width"]; config.video_height = (int)reader["video_height"]; config.video_quality = (int)reader["video_quality"]; } catch (Exception) { } return((object)config); }
// Create video source object public VsICoreProvider CreateVideoSource(object config) { RtpStreamConfiguration cfg = (RtpStreamConfiguration)config; if (cfg != null) { RtpStream5 source = new RtpStream5(); source.VideoSource = cfg.source; source.VideoDest = cfg.dest; source.SSRC = cfg.ssrc; source.VideoPort = cfg.video_port; source.AudioPort = cfg.audio_port; source.VideoCodec = cfg.video_codec; source.AudioCodec = cfg.audio_codec; source.VideoSizeWidth = cfg.video_width; source.VideoSizeHeight = cfg.video_height; source.VideoQuality = cfg.video_quality; return((VsICoreProvider)source); } return(null); }
// Load configuration public object LoadConfiguration(XmlTextReader reader) { RtpStreamConfiguration config = new RtpStreamConfiguration(); try { config.source = reader.GetAttribute("source"); config.dest = reader.GetAttribute("dest"); config.ssrc = reader.GetAttribute("ssrc"); config.video_port = int.Parse(reader.GetAttribute("video_port")); config.audio_port = int.Parse(reader.GetAttribute("audio_port")); config.video_codec = reader.GetAttribute("video_codec"); config.audio_codec = reader.GetAttribute("audio_codec"); config.video_width = int.Parse(reader.GetAttribute("video_width")); config.video_height = int.Parse(reader.GetAttribute("video_height")); config.video_quality = int.Parse(reader.GetAttribute("video_quality")); } catch (Exception) { } return (object) config; }
// Load configuration public object LoadConfiguration(Hashtable reader) { RtpStreamConfiguration config = new RtpStreamConfiguration(); try { config.source = (string)reader["source"]; config.dest = (string)reader["dest"]; config.ssrc = (string)reader["ssrc"]; config.video_port = (int)reader["video_port"]; config.audio_port = (int)reader["audio_port"]; config.video_codec = (string)reader["video_codec"]; config.audio_codec = (string)reader["audio_codec"]; config.video_width = (int)reader["video_width"]; config.video_height = (int)reader["video_height"]; config.video_quality = (int)reader["video_quality"]; } catch (Exception) { } return (object)config; }
// Get configuration object public object GetConfiguration() { RtpStreamConfiguration config = new RtpStreamConfiguration(); config.source = urlBox.Text; config.video_port = int.Parse(portBox.Text); config.dest = sourceDest.Text; return (object) config; }