CodecProfile.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace MediaBrowser.Controller.Dlna
  4. {
  5. public class CodecProfile
  6. {
  7. public CodecType Type { get; set; }
  8. public ProfileCondition[] Conditions { get; set; }
  9. public string Codec { get; set; }
  10. public CodecProfile()
  11. {
  12. Conditions = new ProfileCondition[] {};
  13. }
  14. public List<string> GetCodecs()
  15. {
  16. return (Codec ?? string.Empty).Split(',').Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
  17. }
  18. }
  19. public enum CodecType
  20. {
  21. VideoCodec = 0,
  22. VideoAudioCodec = 1,
  23. AudioCodec = 2
  24. }
  25. public class ProfileCondition
  26. {
  27. public ProfileConditionType Condition { get; set; }
  28. public ProfileConditionValue Property { get; set; }
  29. public string Value { get; set; }
  30. public bool IsRequired { get; set; }
  31. public ProfileCondition()
  32. {
  33. IsRequired = true;
  34. }
  35. }
  36. public enum ProfileConditionType
  37. {
  38. Equals = 0,
  39. NotEquals = 1,
  40. LessThanEqual = 2,
  41. GreaterThanEqual = 3
  42. }
  43. public enum ProfileConditionValue
  44. {
  45. AudioChannels,
  46. AudioBitrate,
  47. AudioProfile,
  48. Filesize,
  49. Width,
  50. Height,
  51. Has64BitOffsets,
  52. VideoBitDepth,
  53. VideoBitrate,
  54. VideoFramerate,
  55. VideoLevel,
  56. VideoProfile
  57. }
  58. }