diff --git a/Nickvision.MPVSharp/Internal/MPVRenderFrameInfo.cs b/Nickvision.MPVSharp/Internal/MPVRenderFrameInfo.cs new file mode 100644 index 0000000..a228f9d --- /dev/null +++ b/Nickvision.MPVSharp/Internal/MPVRenderFrameInfo.cs @@ -0,0 +1,25 @@ +namespace Nickvision.MPVSharp.Internal; + +/// +/// Information about the next video frame that will be rendered. Can be +/// retrieved with . +/// +public struct MPVRenderFrameInfo +{ + /// + /// A bitset of values (i.e. multiple flags are + /// combined with bitwise or). + /// + public ulong Flags; + /// + /// Absolute time at which the frame is supposed to be displayed. This is in + /// the same unit and base as the time returned by . For + /// frames that are redrawn, or if vsync locked video timing is used (see + /// "video-sync" option), then this can be 0. The "video-timing-offset" + /// option determines how much "headroom" the render thread gets (but a high + /// enough frame rate can reduce it anyway). will + /// normally block until the time is elapsed, unless you pass it + /// = 0. + /// + ulong TargetTime; +} \ No newline at end of file diff --git a/Nickvision.MPVSharp/Internal/MPVRenderFrameInfoFlag.cs b/Nickvision.MPVSharp/Internal/MPVRenderFrameInfoFlag.cs new file mode 100644 index 0000000..052f2dc --- /dev/null +++ b/Nickvision.MPVSharp/Internal/MPVRenderFrameInfoFlag.cs @@ -0,0 +1,50 @@ +namespace Nickvision.MPVSharp.Internal; + +/// +/// Flags used in . Each value represents a bit in it. +/// +public enum MPVRenderFrameInfoFlag +{ + /// + /// Set if there is actually a next frame. If unset, there is no next frame + /// yet, and other flags and fields that require a frame to be queued will + /// be unset. + /// This is set for _any_ kind of frame, even for redraw requests. + /// Note that when this is unset, it simply means no new frame was + /// decoded/queued yet, not necessarily that the end of the video was + /// reached. A new frame can be queued after some time. + /// If the return value of had the + /// flag set, this flag will usually be set as well, + /// unless the frame is rendered, or discarded by other asynchronous events. + /// + Present = 1 << 0, + /// + /// If set, the frame is not an actual new video frame, but a redraw request. + /// For example if the video is paused, and an option that affects video + /// rendering was changed (or any other reason), an update request can be + /// issued and this flag will be set. + /// Typically, redraw frames will not be subject to video timing. + /// + /// + /// Implies . + /// + Redraw = 1 << 1, + /// + /// If set, this is supposed to reproduce the previous frame perfectly. This + /// is usually used for certain "video-sync" options ("display-..." modes). + /// Typically the renderer will blit the video from a FBO. Unset otherwise. + /// + /// + /// Implies . + /// + Repeat = 1 << 2, + /// + /// If set, the player timing code expects that the user thread blocks on + /// vsync (by either delaying the render call, or by making a call to + /// at vsync time). + /// + /// + /// Implies . + /// + BlockVsync = 1 << 3 +} \ No newline at end of file