Source: externs/shaka/transmuxer.js

  1. /*! @license
  2. * Shaka Player
  3. * Copyright 2023 Google LLC
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @fileoverview Externs for Transmuxer.
  8. *
  9. * @externs
  10. */
  11. /**
  12. * An interface for transmuxer plugins.
  13. *
  14. * @interface
  15. * @exportDoc
  16. */
  17. shaka.extern.Transmuxer = class {
  18. /**
  19. * Destroy
  20. */
  21. destroy() {}
  22. /**
  23. * Check if the mime type and the content type is supported.
  24. * @param {string} mimeType
  25. * @param {string=} contentType
  26. * @return {boolean}
  27. */
  28. isSupported(mimeType, contentType) {}
  29. /**
  30. * For any stream, convert its codecs to MP4 codecs.
  31. * @param {string} contentType
  32. * @param {string} mimeType
  33. * @return {string}
  34. */
  35. convertCodecs(contentType, mimeType) {}
  36. /**
  37. * Returns the original mimetype of the transmuxer.
  38. * @return {string}
  39. */
  40. getOriginalMimeType() {}
  41. /**
  42. * Transmux a input data to MP4.
  43. * @param {BufferSource} data
  44. * @param {shaka.extern.Stream} stream
  45. * @param {?shaka.media.SegmentReference} reference The segment reference, or
  46. * null for init segments
  47. * @param {number} duration
  48. * @param {string} contentType
  49. * @return {!Promise<!Uint8Array>}
  50. */
  51. transmux(data, stream, reference, duration, contentType) {}
  52. };
  53. /**
  54. * @typedef {function():!shaka.extern.Transmuxer}
  55. * @exportDoc
  56. */
  57. shaka.extern.TransmuxerPlugin;