Introduce CVideoStream for easier video handling (already includes a texture, important for common usage of streams)
This commit is contained in:
1 parent
89e528c2a6
commit
6a3bf7b2c0
15 files changed
+204
-168
No files matched your search
@@ -0,0 +1,45 @@
|
||||
using VocaluxeLib.Draw;
|
||||
|
||||
namespace VocaluxeLib
|
||||
{
|
||||
public class CVideoStream
|
||||
{
|
||||
public int ID { get; private set; }
|
||||
public CTextureRef Texture;
|
||||
/// The actual position in s of the returned frame. Should be ~ time+VideoGap
|
||||
public float VideoTime;
|
||||
|
||||
public CVideoStream(int id)
|
||||
{
|
||||
ID = id;
|
||||
}
|
||||
|
||||
~CVideoStream()
|
||||
{
|
||||
if (ID >= 0)
|
||||
{
|
||||
CVideoStream tmp = this;
|
||||
CBase.Video.Close(ref tmp);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should only be used by video decoders<br />
|
||||
/// Set's this stream to closed state and frees the texture
|
||||
/// </summary>
|
||||
public void SetClosed()
|
||||
{
|
||||
ID = -1;
|
||||
CBase.Drawing.RemoveTexture(ref Texture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the video stream is closed
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsClosed()
|
||||
{
|
||||
return ID < 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user