#region license // This file is part of Vocaluxe. // // Vocaluxe is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Vocaluxe is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Vocaluxe. If not, see . #endregion 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) { var tmp = this; CBase.Video.Close(ref tmp); } } /// /// Should only be used by video decoders
/// Set's this stream to closed state and frees the texture ///
public void SetClosed() { Id = -1; CBase.Drawing.RemoveTexture(ref Texture); } /// /// Returns true if the video stream is closed /// /// public bool IsClosed() { return Id < 0; } } }