Esempio n. 1
0
        protected override void DisposeReader()
        {
            if (m_mvxRunner == null)
            {
                return;
            }

            if (m_framesReadingThread != null)
            {
                m_stopReadingFrames = true;
                m_framesReadingThread.Join();
                m_framesReadingThread = null;
            }

            if (m_frameAccess != null)
            {
                m_frameAccess.Dispose();
                m_frameAccess = null;
            }

            m_mvxRunner.Dispose();
            m_mvxRunner = null;

            lock (m_audioPlayer)
                m_audioPlayer.Reset();
        }
        protected override void DisposeReader()
        {
            if (m_frameAccess != null)
            {
                m_frameAccess.Dispose();
                m_frameAccess = null;
            }

            if (m_mvxRunner == null)
            {
                return;
            }

            m_mvxRunner.Dispose();
            m_mvxRunner = null;
        }
Esempio n. 3
0
        protected override bool OpenReader()
        {
            lastReceivedFrame = null;
            m_paused          = false;
            if (m_audioSource)
            {
                m_audioSource.enabled = true;
            }
            lock (m_audioPlayer)
                m_audioPlayer.Reset();

            try
            {
                m_frameAccess = new MVGraphAPI.FrameAccessGraphNode();

                MVGraphAPI.ManualGraphBuilder graphBuilder = new MVGraphAPI.ManualGraphBuilder();
                graphBuilder = graphBuilder
                               + dataStreamDefinition.GetSourceGraphNode() + new MVGraphAPI.AutoDecompressorGraphNode() + m_frameAccess;
                AddAdditionalGraphTargetsToGraph(graphBuilder);

                m_mvxRunner = new MVGraphAPI.ManualSequentialGraphRunner(graphBuilder.CompileGraphAndReset());

                if (!m_mvxRunner.RestartWithPlaybackMode(mvxPlaybackMode))
                {
                    Debug.LogError("Mvx2: Failed to play source");
                    return(false);
                }

                Debug.Log("Mvx2: The stream is open and playing");

                m_stopReadingFrames   = false;
                m_framesReadingThread = new Thread(new ThreadStart(ReadFrames));
                m_framesReadingThread.Start();

                return(true);
            }
            catch (System.Exception exception)
            {
                Debug.LogErrorFormat("Failed to create the graph: {0}", exception.Message);
                m_mvxRunner = null;
                return(false);
            }
        }
        protected override bool OpenReader()
        {
            lastReceivedFrame = null;

            try
            {
                m_frameAccess = new MVGraphAPI.FrameAccessGraphNode();

                MVGraphAPI.ManualGraphBuilder graphBuilder = new MVGraphAPI.ManualGraphBuilder();
                graphBuilder = graphBuilder + dataStreamDefinition.GetSourceGraphNode() + new MVGraphAPI.AutoDecompressorGraphNode() + m_frameAccess;
                AddAdditionalGraphTargetsToGraph(graphBuilder);

                m_mvxRunner = new MVGraphAPI.RandomAccessGraphRunner(graphBuilder.CompileGraphAndReset());
                Debug.Log("Mvx2: The stream is open and playing");
                return(true);
            }
            catch (System.Exception exception)
            {
                Debug.LogErrorFormat("Failed to create the graph: {0}", exception.Message);
                m_mvxRunner = null;
                return(false);
            }
        }