AbstractFrameProvider.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. namespace NRKernal.Record
  10. {
  11. using UnityEngine;
  12. /// <summary> An abstract frame provider. </summary>
  13. public abstract class AbstractFrameProvider
  14. {
  15. /// <summary> Updates the image frame described by frame. </summary>
  16. /// <param name="frame"> The frame.</param>
  17. public delegate void UpdateImageFrame(UniversalTextureFrame frame);
  18. /// <summary> The on update. </summary>
  19. public UpdateImageFrame OnUpdate;
  20. /// <summary> True if is frame ready, false if not. </summary>
  21. protected bool m_IsFrameReady = false;
  22. /// <summary> Gets frame information. </summary>
  23. /// <returns> The frame information. </returns>
  24. public virtual Resolution GetFrameInfo() { return new Resolution(); }
  25. /// <summary> Query if this object is frame ready. </summary>
  26. /// <returns> True if frame ready, false if not. </returns>
  27. public virtual bool IsFrameReady() { return m_IsFrameReady; }
  28. /// <summary> Plays this object. </summary>
  29. public virtual void Play() { }
  30. /// <summary> Stops this object. </summary>
  31. public virtual void Stop() { }
  32. /// <summary> Releases this object. </summary>
  33. public virtual void Release() { }
  34. }
  35. }