protected override void GetSampleAsync(MediaStreamType mediaStreamType)
 {
     try
     {
         if (mediaStreamType == MediaStreamType.Video)
         {
             videoController.GetNextVideoFrame(ssrcId, frameStream =>
             {
                 if (frameStream != null)
                 {
                     // Send out the next sample
                     frameStream.Position = 0;
                     var msSamp           = new MediaStreamSample(
                         videoDesc,
                         frameStream,
                         0,
                         frameStream.Length,
                         (DateTime.Now - startTime).Ticks,
                         emptySampleDict);
                     ReportGetSampleCompleted(msSamp);
                 }
             });
         }
     }
     catch (Exception ex)
     {
         ClientLogger.Debug(ex.ToString());
     }
 }
Пример #2
0
 private void GetSample(object userState)
 {
     try
     {
         if (_sampleRequested && !_isClosed)
         {
             _sampleRequested = false;
             _videoController.GetNextVideoFrame(_ssrcId, ReportSample);
         }
     }
     catch (Exception ex)
     {
         ClientLogger.ErrorException(ex, "Report sample failed");
     }
 }