StreamState.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Model.Dlna;
  3. using MediaBrowser.Model.Entities;
  4. using MediaBrowser.Model.IO;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Threading;
  8. namespace MediaBrowser.Api.Playback
  9. {
  10. public class StreamState
  11. {
  12. public string RequestedUrl { get; set; }
  13. public StreamRequest Request { get; set; }
  14. public VideoStreamRequest VideoRequest
  15. {
  16. get { return Request as VideoStreamRequest; }
  17. }
  18. /// <summary>
  19. /// Gets or sets the log file stream.
  20. /// </summary>
  21. /// <value>The log file stream.</value>
  22. public Stream LogFileStream { get; set; }
  23. public MediaStream AudioStream { get; set; }
  24. public MediaStream VideoStream { get; set; }
  25. public MediaStream SubtitleStream { get; set; }
  26. /// <summary>
  27. /// Gets or sets the iso mount.
  28. /// </summary>
  29. /// <value>The iso mount.</value>
  30. public IIsoMount IsoMount { get; set; }
  31. public string MediaPath { get; set; }
  32. public bool IsRemote { get; set; }
  33. public bool IsInputVideo { get; set; }
  34. public VideoType VideoType { get; set; }
  35. public IsoType? IsoType { get; set; }
  36. public List<string> PlayableStreamFileNames { get; set; }
  37. public bool HasMediaStreams { get; set; }
  38. public CancellationTokenSource StandardInputCancellationTokenSource { get; set; }
  39. public string LiveTvStreamId { get; set; }
  40. public int SegmentLength = 10;
  41. public int HlsListSize;
  42. public long? RunTimeTicks;
  43. public string AudioSync = "1";
  44. public string VideoSync = "vfr";
  45. public string InputAudioSync { get; set; }
  46. public string InputVideoSync { get; set; }
  47. public bool DeInterlace { get; set; }
  48. public bool ReadInputAtNativeFramerate { get; set; }
  49. public string InputFormat { get; set; }
  50. public string InputVideoCodec { get; set; }
  51. public string InputAudioCodec { get; set; }
  52. public string MimeType { get; set; }
  53. public string OrgPn { get; set; }
  54. // DLNA Settings
  55. public bool EstimateContentLength { get; set; }
  56. public bool EnableMpegtsM2TsMode { get; set; }
  57. public TranscodeSeekInfo TranscodeSeekInfo { get; set; }
  58. public string GetMimeType(string outputPath)
  59. {
  60. if (!string.IsNullOrEmpty(MimeType))
  61. {
  62. return MimeType;
  63. }
  64. return MimeTypes.GetMimeType(outputPath);
  65. }
  66. }
  67. }