Skip to content

Commit

Permalink
Merge pull request #42 from vignetteapp/draw-mouse
Browse files Browse the repository at this point in the history
allow not drawing the mouse cursor in display captures
  • Loading branch information
adryzz committed Oct 30, 2022
2 parents 4aaf37c + 752ad98 commit 0806c65
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions SeeShark/VideoInputOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public class VideoInputOptions
/// </summary>
public bool IsRaw { get; set; }

/// <summary>
/// Whether or not to draw the mouse cursor in display captures.
/// </summary>
public bool DrawMouse { get; set; } = true;

/// <summary>
/// Combines all properties into a dictionary of options that FFmpeg can use.
/// </summary>
Expand Down Expand Up @@ -91,20 +96,28 @@ public class VideoInputOptions
switch (deviceFormat)
{
case DeviceInputFormat.X11Grab:
{
dict.Add("grab_x", VideoPosition.Value.Item1.ToString());
dict.Add("grab_y", VideoPosition.Value.Item2.ToString());
break;
}
dict.Add("grab_x", VideoPosition.Value.Item1.ToString());
dict.Add("grab_y", VideoPosition.Value.Item2.ToString());
break;
case DeviceInputFormat.GdiGrab:
{
dict.Add("offset_x", VideoPosition.Value.Item1.ToString());
dict.Add("offset_y", VideoPosition.Value.Item2.ToString());
break;
}
dict.Add("offset_x", VideoPosition.Value.Item1.ToString());
dict.Add("offset_y", VideoPosition.Value.Item2.ToString());
break;

}
}

switch (deviceFormat)
{
case DeviceInputFormat.X11Grab:
case DeviceInputFormat.GdiGrab:
dict.Add("draw_mouse", DrawMouse ? "1" : "0");
break;
case DeviceInputFormat.AVFoundation:
dict.Add("capture_cursor", DrawMouse ? "1" : "0");
break;
}

return dict;
}

Expand Down

0 comments on commit 0806c65

Please sign in to comment.