Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
keyou committed Jul 19, 2020
1 parent 9d5af79 commit fa6af20
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions PeerDesk/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace PeerDesk
{
public partial class MainWindow : Form
{
private const String host_ = "127.0.0.1";
private String host_;
private const int port_ = 13334;
private const int screen_width_ = 1920;
private const int screen_height_ = 1080;
Expand Down Expand Up @@ -150,17 +150,21 @@ private void connectBtn_Click(object sender, EventArgs e)
try
{
Debug.WriteLine("ip: " + textIp.Text);
host_ = textIp.Text;
Text = "PeerDesk: Connecting...";
if(!channel_.Connect(textIp.Text, port_))
{
throw new Exception("Connect failed");
}
var process = Process.Start("mpv.exe",
string.Format("--wid={0} --autofit-larger={1} tcp://{2}:13333 --no-keepaspect --no-keepaspect-window " +
var startInfo = new ProcessStartInfo();
startInfo.FileName = "mpv.dll";
startInfo.Arguments = string.Format("--wid={0} --autofit-larger={1} tcp://{2}:13333 --no-keepaspect --no-keepaspect-window " +
"--profile=low-latency --video-latency-hacks=yes --no-config --input-vo-keyboard=no --no-input-cursor --idle=yes " +
"--osc=no --no-cache --untimed --no-correct-pts --fps=30 ", Handle, 192 * 7, host_));
"--osc=no --no-cache --untimed --no-correct-pts --fps=30 ", Handle, 192 * 7, host_);
startInfo.UseShellExecute = false;
var process = Process.Start(startInfo);
Text = string.Format("PeerDesk: tcp://{1}:{2} ({0})", Handle, host_, port_);
Debug.WriteLine("mpv args: " + process.StartInfo.Arguments);
Debug.WriteLine("mpv args: " + startInfo.Arguments);
textIp.ReadOnly = true;
textIp.Enabled = false;
this.ActiveControl = null;
Expand Down
2 changes: 1 addition & 1 deletion PeerDesk/PeerDesk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="mpv.exe">
<Content Include="mpv.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="penrose-square.ico" />
Expand Down
File renamed without changes.

0 comments on commit fa6af20

Please sign in to comment.