2
0

StreamState.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using MediaBrowser.Common.Net;
  2. using MediaBrowser.Model.Entities;
  3. using MediaBrowser.Model.IO;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Threading;
  7. namespace MediaBrowser.Api.Playback
  8. {
  9. public class StreamState
  10. {
  11. public string RequestedUrl { get; set; }
  12. public StreamRequest Request { get; set; }
  13. public VideoStreamRequest VideoRequest
  14. {
  15. get { return Request as VideoStreamRequest; }
  16. }
  17. /// <summary>
  18. /// Gets or sets the log file stream.
  19. /// </summary>
  20. /// <value>The log file stream.</value>
  21. public Stream LogFileStream { get; set; }
  22. public MediaStream AudioStream { get; set; }
  23. public MediaStream VideoStream { get; set; }
  24. public MediaStream SubtitleStream { get; set; }
  25. /// <summary>
  26. /// Gets or sets the iso mount.
  27. /// </summary>
  28. /// <value>The iso mount.</value>
  29. public IIsoMount IsoMount { get; set; }
  30. public string MediaPath { get; set; }
  31. public bool IsRemote { get; set; }
  32. public bool IsInputVideo { get; set; }
  33. public VideoType VideoType { get; set; }
  34. public IsoType? IsoType { get; set; }
  35. public List<string> PlayableStreamFileNames { get; set; }
  36. public bool HasMediaStreams { get; set; }
  37. public bool SendInputOverStandardInput { 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 bool DeInterlace { get; set; }
  46. public bool ReadInputAtNativeFramerate { get; set; }
  47. public string InputFormat { get; set; }
  48. public string InputVideoCodec { get; set; }
  49. public string InputAudioCodec { get; set; }
  50. public string GetMimeType(string outputPath)
  51. {
  52. if (!string.IsNullOrWhiteSpace(Request.ForcedMimeType))
  53. {
  54. if (VideoRequest == null)
  55. {
  56. return "audio/" + Request.ForcedMimeType;
  57. }
  58. return "video/" + Request.ForcedMimeType;
  59. }
  60. return MimeTypes.GetMimeType(outputPath);
  61. }
  62. }
  63. }