예제 #1
0
        /// <summary>
        /// Handler polls the media network to check for new video frames.
        ///
        /// </summary>
        protected virtual void HandleMediaEvents()
        {
            //just for debugging
            bool handleLocalFrames  = true;
            bool handleRemoteFrames = true;

            if (mMediaNetwork != null && handleLocalFrames)
            {
                IFrame localFrame = mMediaNetwork.TryGetFrame(ConnectionId.INVALID);
                if (localFrame != null)
                {
                    UpdateTexture(localFrame);
                }
            }
            if (mMediaNetwork != null && handleRemoteFrames)
            {
                //so far the loop shouldn't be needed. we only expect one
                foreach (var id in mConnectionIds)
                {
                    if (mMediaNetwork != null)
                    {
                        IFrame remoteFrame = mMediaNetwork.TryGetFrame(id);
                        if (remoteFrame != null)
                        {
                            UpdateTexture(remoteFrame);
                        }
                    }
                }
            }
        }