private void ReadVideoConfig(ICollection <StreamConfig> configs) { if (videoIdx < 0) { return; } var config = formatContext.ReadConfig(videoIdx); Logger.Info("Setting video stream to " + videoIdx); Logger.Info(config.ToString()); configs.Add(config); }
private ArraySegment <byte> ReadPacket(int size) { try { var token = cancellationTokenSource.Token; var data = buffer.Take(size, token); return(data); } catch (TaskCanceledException) { Logger.Info("Take cancelled"); } catch (InvalidOperationException ex) { Logger.Warn(ex); } catch (Exception ex) { Logger.Error(ex, $"Unexpected exception: {ex.GetType()}"); } return(new ArraySegment <byte>()); }