This repository has been archived by the owner on May 6, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Nickvision.MPVSharp.Internal; | ||
|
||
/// <summary> | ||
/// Information about the next video frame that will be rendered. Can be | ||
/// retrieved with <see cref="MPVRenderParamType.NextFrameInfo"/>. | ||
/// </summary> | ||
public struct MPVRenderFrameInfo | ||
{ | ||
/// <summary> | ||
/// A bitset of <see cref="MPVRenderFrameInfoFlag"/> values (i.e. multiple flags are | ||
/// combined with bitwise or). | ||
/// </summary> | ||
public ulong Flags; | ||
/// <summary> | ||
/// Absolute time at which the frame is supposed to be displayed. This is in | ||
/// the same unit and base as the time returned by <see cref="MPVClient.GetTimeUs"/>. 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). <see cref="MPVRenderContext.Render"/> will | ||
/// normally block until the time is elapsed, unless you pass it | ||
/// <see cref="MPVRenderParamType.BlockForTargetTime"/> = 0. | ||
/// </summary> | ||
ulong TargetTime; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
namespace Nickvision.MPVSharp.Internal; | ||
|
||
/// <summary> | ||
/// Flags used in <see cref="MPVRenderFrameInfo.Flags"/>. Each value represents a bit in it. | ||
/// </summary> | ||
public enum MPVRenderFrameInfoFlag | ||
{ | ||
/// <summary> | ||
/// 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 <see cref="MPVRenderContext.Render"/> had the | ||
/// <see cref="MPVRenderUpdateFlags.UpdateFrame"/> flag set, this flag will usually be set as well, | ||
/// unless the frame is rendered, or discarded by other asynchronous events. | ||
/// </summary> | ||
Present = 1 << 0, | ||
/// <summary> | ||
/// 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. | ||
/// </summary> | ||
/// <remarks> | ||
/// Implies <see cref="Present"/>. | ||
/// </remarks> | ||
Redraw = 1 << 1, | ||
/// <summary> | ||
/// 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. | ||
/// </summary> | ||
/// <remarks> | ||
/// Implies <see cref="Present"/>. | ||
/// </remarks> | ||
Repeat = 1 << 2, | ||
/// <summary> | ||
/// 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 | ||
/// <see cref="MPVRenderContext.ReportSwap"/> at vsync time). | ||
/// </summary> | ||
/// <remarks> | ||
/// Implies <see cref="Present"/>. | ||
/// </remarks> | ||
BlockVsync = 1 << 3 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters