CodecProfile.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 List<ProfileCondition> Conditions { get; set; }
  9. public string Codec { get; set; }
  10. public CodecProfile()
  11. {
  12. Conditions = new List<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. }
  31. public enum ProfileConditionType
  32. {
  33. Equals = 0,
  34. NotEquals = 1,
  35. LessThanEqual = 2,
  36. GreaterThanEqual = 3
  37. }
  38. public enum ProfileConditionValue
  39. {
  40. AudioChannels,
  41. AudioBitrate,
  42. Filesize,
  43. Width,
  44. Height,
  45. VideoBitrate,
  46. VideoFramerate,
  47. VideoLevel
  48. }
  49. }