Commit 503856bb authored by Martin Finkel's avatar Martin Finkel

Viewpoint: Keep struct readonly

parent 90809693
......@@ -1585,7 +1585,7 @@ namespace LibVLCSharp.Shared
var vpPtr = Native.LibVLCVideoNewViewpoint();
if (vpPtr == IntPtr.Zero) return false;
Viewpoint = new VideoViewpoint { Yaw = yaw, Pitch = pitch, Roll = roll, Fov = fov };
Viewpoint = new VideoViewpoint(yaw, pitch, roll, fov);
Marshal.StructureToPtr(Viewpoint, vpPtr, false);
var result = Native.LibVLCVideoUpdateViewpoint(NativeReference, vpPtr, absolute) == 0;
......
......@@ -4,26 +4,34 @@ namespace LibVLCSharp.Shared
{
/// <summary>Viewpoint for video outputs</summary>
[StructLayout(LayoutKind.Sequential)]
public struct VideoViewpoint
public readonly struct VideoViewpoint
{
internal VideoViewpoint(float yaw, float pitch, float roll, float fov)
{
Yaw = yaw;
Pitch = pitch;
Roll = roll;
Fov = fov;
}
/// <summary>
/// view point yaw in degrees ]-180;180]
/// </summary>
public float Yaw { get; internal set; }
public readonly float Yaw;
/// <summary>
/// view point pitch in degrees ]-90;90]
/// </summary>
public float Pitch { get; internal set; }
public readonly float Pitch;
/// <summary>
/// view point roll in degrees ]-180;180]
/// </summary>
public float Roll { get; internal set; }
public readonly float Roll;
/// <summary>
/// field of view in degrees ]0;180[ (default 80.)
/// </summary>
public float Fov { get; internal set; }
public readonly float Fov;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment