/**************************************************************************** * Copyright 2019 Nreal Techonology Limited. All rights reserved. * * This file is part of NRSDK. * * https://www.nreal.ai/ * *****************************************************************************/ namespace NRKernal.Record { using System.Collections.Generic; /// A frame capture context factory. public class FrameCaptureContextFactory { /// List of contexts. private static List m_ContextList = new List(); /// Creates a new FrameCaptureContext. /// A FrameCaptureContext. public static FrameCaptureContext Create() { FrameCaptureContext context = new FrameCaptureContext(); m_ContextList.Add(context); return context; } /// Dispose all context. public static void DisposeAllContext() { foreach (var item in m_ContextList) { if (item != null) { item.StopCapture(); item.Release(); } } } } }