Source: lib/media/adaptation_set_criteria.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2016 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. goog.provide('shaka.media.AdaptationSetCriteria');
  7. goog.require('shaka.media.AdaptationSet');
  8. goog.require('shaka.config.CodecSwitchingStrategy');
  9. /**
  10. * An adaptation set criteria is a unit of logic that can take a set of
  11. * variants and return a subset of variants that should (and can) be
  12. * adapted between.
  13. *
  14. * @interface
  15. * @export
  16. */
  17. shaka.media.AdaptationSetCriteria = class {
  18. /**
  19. * Take a set of variants, and return a subset of variants that can be
  20. * adapted between.
  21. *
  22. * @param {!Array<shaka.extern.Variant>} variants
  23. * @return {!shaka.media.AdaptationSet}
  24. * @exportInterface
  25. */
  26. create(variants) {}
  27. /**
  28. * Sets the AdaptationSetCriteria configuration.
  29. *
  30. * @param {shaka.media.AdaptationSetCriteria.Configuration} config
  31. * @exportInterface
  32. */
  33. configure(config) {}
  34. };
  35. /**
  36. * A factory for creating the AdaptationSetCriteria.
  37. *
  38. * @typedef {function():!shaka.media.AdaptationSetCriteria}
  39. * @export
  40. */
  41. shaka.media.AdaptationSetCriteria.Factory;
  42. /**
  43. * @typedef {{
  44. * language: string,
  45. * role: string,
  46. * channelCount: number,
  47. * hdrLevel: string,
  48. * spatialAudio: boolean,
  49. * videoLayout: string,
  50. * audioLabel: string,
  51. * videoLabel: string,
  52. * codecSwitchingStrategy: shaka.config.CodecSwitchingStrategy,
  53. * audioCodec: string
  54. * }}
  55. *
  56. * @property {string} language
  57. * The language used to filter variants.
  58. * @property {string} role
  59. * The adaptation role used to filter variants.
  60. * @property {string} channelCount
  61. * The audio channel count used to filter variants.
  62. * @property {string} hdrLevel
  63. * The HDR level used to filter variants.
  64. * @property {boolean} spatialAudio
  65. * Whether should prefer audio tracks with spatial audio.
  66. * @property {string} videoLayout
  67. * The video layout used to filter variants.
  68. * @property {string} audioLabel
  69. * The audio label used to filter variants.
  70. * @property {string} videoLabel
  71. * The video label used to filter variants.
  72. * @property {shaka.config.CodecSwitchingStrategy} codecSwitchingStrategy
  73. * The codec switching strategy used to filter variants.
  74. * @property {string} audioCodec
  75. * The audio codec used to filter variants.
  76. * @export
  77. */
  78. shaka.media.AdaptationSetCriteria.Configuration;