|
From: <soa...@us...> - 2007-04-17 09:31:23
|
Revision: 337
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=337&view=rev
Author: soapskyway
Date: 2007-04-17 02:31:10 -0700 (Tue, 17 Apr 2007)
Log Message:
-----------
Added configuration for deinterlace support in VLC
Modified Paths:
--------------
trunk/plugins/VideoLAN/ConfigurationForm.cs
trunk/plugins/VideoLAN/VideoLanPlugin.cs
Modified: trunk/plugins/VideoLAN/ConfigurationForm.cs
===================================================================
--- trunk/plugins/VideoLAN/ConfigurationForm.cs 2007-04-16 22:15:24 UTC (rev 336)
+++ trunk/plugins/VideoLAN/ConfigurationForm.cs 2007-04-17 09:31:10 UTC (rev 337)
@@ -45,6 +45,7 @@
private string m_enabledExt = "";
private string m_enabledStreams = "";
private string bufsize = "";
+ private string m_deinterlace = "Disable";
private MediaPortal.UserInterface.Controls.MPButton buttonEnable;
private MediaPortal.UserInterface.Controls.MPTextBox extensionBox;
private TextBox streamBox;
@@ -53,6 +54,8 @@
private Label label2;
private TextBox bufBox;
private Label label3;
+ private Label label4;
+ private ComboBox deintBox;
/// <summary>
/// Required designer variable.
/// </summary>
@@ -93,6 +96,8 @@
this.streamBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this.deintBox = new System.Windows.Forms.ComboBox();
+ this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.bufBox = new System.Windows.Forms.TextBox();
@@ -101,7 +106,7 @@
//
// buttonEnable
//
- this.buttonEnable.Location = new System.Drawing.Point(11, 132);
+ this.buttonEnable.Location = new System.Drawing.Point(12, 163);
this.buttonEnable.Name = "buttonEnable";
this.buttonEnable.Size = new System.Drawing.Size(75, 23);
this.buttonEnable.TabIndex = 3;
@@ -135,6 +140,8 @@
//
// groupBox1
//
+ this.groupBox1.Controls.Add(this.deintBox);
+ this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.bufBox);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
@@ -143,20 +150,44 @@
this.groupBox1.Controls.Add(this.extensionBox);
this.groupBox1.Location = new System.Drawing.Point(11, 12);
this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new System.Drawing.Size(411, 114);
+ this.groupBox1.Size = new System.Drawing.Size(411, 145);
this.groupBox1.TabIndex = 7;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "General";
//
- // label2
+ // deintBox
//
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(6, 55);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(108, 13);
- this.label2.TabIndex = 7;
- this.label2.Text = "Associated protocols:";
+ this.deintBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.deintBox.FormattingEnabled = true;
+ this.deintBox.Items.AddRange(new object[] {
+ "Disable",
+ "Blend",
+ "Bob",
+ "Discard",
+ "Linear",
+ "Mean",
+ "X"});
+ this.deintBox.Location = new System.Drawing.Point(135, 107);
+ this.deintBox.Name = "deintBox";
+ this.deintBox.Size = new System.Drawing.Size(256, 21);
+ this.deintBox.TabIndex = 11;
//
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(6, 107);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(64, 13);
+ this.label4.TabIndex = 10;
+ this.label4.Text = "Deinterlace:";
+ //
+ // bufBox
+ //
+ this.bufBox.Location = new System.Drawing.Point(135, 80);
+ this.bufBox.Name = "bufBox";
+ this.bufBox.Size = new System.Drawing.Size(59, 20);
+ this.bufBox.TabIndex = 9;
+ //
// label3
//
this.label3.AutoSize = true;
@@ -166,17 +197,19 @@
this.label3.TabIndex = 8;
this.label3.Text = "Buffer size:";
//
- // bufBox
+ // label2
//
- this.bufBox.Location = new System.Drawing.Point(135, 80);
- this.bufBox.Name = "bufBox";
- this.bufBox.Size = new System.Drawing.Size(59, 20);
- this.bufBox.TabIndex = 9;
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(6, 55);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(108, 13);
+ this.label2.TabIndex = 7;
+ this.label2.Text = "Associated protocols:";
//
// ConfigurationForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(440, 167);
+ this.ClientSize = new System.Drawing.Size(440, 198);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.buttonEnable);
this.Name = "ConfigurationForm";
@@ -193,11 +226,12 @@
private void ConfigurationForm_Load(object sender, System.EventArgs e)
{
- using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Directory.GetCurrentDirectory() + @"\MediaPortal.xml"))
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Directory.GetCurrentDirectory() + @"\MediaPortal.xml"))
{
m_enabledExt = xmlreader.GetValueAsString("vlcplugin", "enabledextensions", ".ts,.gary");
m_enabledStreams = xmlreader.GetValueAsString("vlcplugin", "enabledstreams", "udp");
bufsize = xmlreader.GetValueAsString("vlcplugin", "buffer", "5000");
+ m_deinterlace = xmlreader.GetValueAsString("vlcplugin", "deinterlace", "Disable");
m_enabledExt.Replace(":", ","); // in case it was using the old plugin code where the separator was ":"
}
if (m_enabledExt != null && m_enabledExt.Length > 0)
@@ -206,28 +240,29 @@
this.extensionBox.Text = m_enabledExt;
this.streamBox.Text = m_enabledStreams;
this.bufBox.Text = bufsize;
-
+ this.deintBox.SelectedItem = m_deinterlace;
}
private void ConfigurationForm_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
- using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Directory.GetCurrentDirectory() + @"\MediaPortal.xml"))
- {
- xmlWriter.SetValue("vlcplugin", "enabledextensions", extensionBox.Text);
- xmlWriter.SetValue("vlcplugin", "enabledstreams", streamBox.Text);
- xmlWriter.SetValue("vlcplugin", "buffer", bufBox.Text);
- }
+ writeConfiguration();
}
private void buttonEnable_Click(object sender, System.EventArgs e)
{
+ writeConfiguration();
+ this.Close();
+ }
+
+ private void writeConfiguration()
+ {
using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Directory.GetCurrentDirectory() + @"\MediaPortal.xml"))
- {
- xmlWriter.SetValue("vlcplugin", "enabledextensions", extensionBox.Text);
- xmlWriter.SetValue("vlcplugin", "enabledstreams", streamBox.Text);
- xmlWriter.SetValue("vlcplugin", "buffer", bufBox.Text);
- }
- this.Close();
+ {
+ xmlWriter.SetValue("vlcplugin", "enabledextensions", extensionBox.Text);
+ xmlWriter.SetValue("vlcplugin", "enabledstreams", streamBox.Text);
+ xmlWriter.SetValue("vlcplugin", "buffer", bufBox.Text);
+ xmlWriter.SetValue("vlcplugin", "deinterlace", deintBox.Text);
+ }
}
}
}
Modified: trunk/plugins/VideoLAN/VideoLanPlugin.cs
===================================================================
--- trunk/plugins/VideoLAN/VideoLanPlugin.cs 2007-04-16 22:15:24 UTC (rev 336)
+++ trunk/plugins/VideoLAN/VideoLanPlugin.cs 2007-04-17 09:31:10 UTC (rev 337)
@@ -145,19 +145,35 @@
string vlciptvdir = Directory.GetCurrentDirectory() + @"\vlciptv";
if (!Directory.Exists(vlciptvdir)) Directory.CreateDirectory(vlciptvdir);
- string[] option = new string[]{
- ":http-caching=" + getBufferSize(),
- ":mms-caching=" + getBufferSize(),
- ":realrtsp-caching=" + getBufferSize(),
- //":tcp-caching==" + getBufferSize(),
- //":udp-caching==" + getBufferSize(),
- ":smb-caching=" + getBufferSize(),
- ":snapshot-path=" + vlciptvdir,
- ":record-path=" + vlciptvdir,
- ":timeshift-dir=" + vlciptvdir,
- ":access-filter=record"
- };
+ string deinterlace = getDeinterlace();
+ string[] option;
+
+ if (!deinterlace.Equals("disable"))
+ {
+ option= new string[]{
+ ":http-caching=" + getBufferSize(),
+ ":mms-caching=" + getBufferSize(),
+ ":realrtsp-caching=" + getBufferSize(),
+ ":smb-caching=" + getBufferSize(),
+ ":snapshot-path=" + vlciptvdir,
+ ":record-path=" + vlciptvdir,
+ ":timeshift-dir=" + vlciptvdir,
+ ":access-filter=record",
+ ":vout-filter=deinterlace", ":deinterlace-mode=" + deinterlace
+ };
+ } else {
+ option = new string[]{
+ ":http-caching=" + getBufferSize(),
+ ":mms-caching=" + getBufferSize(),
+ ":realrtsp-caching=" + getBufferSize(),
+ ":smb-caching=" + getBufferSize(),
+ ":snapshot-path=" + vlciptvdir,
+ ":record-path=" + vlciptvdir,
+ ":timeshift-dir=" + vlciptvdir,
+ ":access-filter=record",
+ };
+ }
vlcControl.Stop();
vlcControl.ClearPlayList();
@@ -668,6 +684,14 @@
return result;
}
+ private string getDeinterlace()
+ {
+ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Directory.GetCurrentDirectory() + @"\MediaPortal.xml"))
+ {
+ string deinterlace = xmlreader.GetValueAsString("vlcplugin", "deinterlace", "Disable");
+ return deinterlace.ToLowerInvariant();
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|