Beispiel #1
0
        /// <summary>
        /// Called when a media frame is received.
        /// </summary>
        /// <param name="sender">Sender object.</param>
        /// <param name="mediaFrame">Media frame.</param>
        /// <param name="metadataRequired">Indicates whether to include metadata.</param>
        private void OnFrameReceived(object sender, RawFrame mediaFrame, bool metadataRequired)
        {
            if (!(sender is IMediaStream mediaStream) || _endPoint == null)
            {
                return;
            }

            var result = CreateNetworkFrame(Name, mediaStream.Name, mediaStream.TotalFramesReceived,
                                            mediaFrame, metadataRequired);

            _networkStream.TrySend(result, _endPoint);
        }