You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.7KB

  1. /**
  2. * Copyright (c) 2016 Neil Birkbeck <neil.birkbeck@gmail.com>
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVUTIL_MASTERING_DISPLAY_METADATA_H
  21. #define AVUTIL_MASTERING_DISPLAY_METADATA_H
  22. #include "frame.h"
  23. /**
  24. * Mastering display metadata capable of representing the color volume of
  25. * the display used to master the content (SMPTE 2086:2014).
  26. *
  27. * To be used as payload of a AVFrameSideData or AVPacketSideData with the
  28. * appropriate type.
  29. *
  30. * @note The struct should be allocated with av_mastering_display_metadata_alloc()
  31. * and its size is not a part of the public ABI.
  32. */
  33. typedef struct AVMasteringDisplayMetadata {
  34. /**
  35. * CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
  36. */
  37. float display_primaries[3][2];
  38. /**
  39. * CIE 1931 xy chromaticity coords of white point.
  40. */
  41. float white_point[2];
  42. /**
  43. * Min luminance of mastering display (cd/m^2).
  44. */
  45. float min_luminance;
  46. /**
  47. * Max luminance of mastering display (cd/m^2).
  48. */
  49. float max_luminance;
  50. /**
  51. * Flag indicating whether the display primaries (and white point) are set.
  52. */
  53. int has_primaries;
  54. /**
  55. * Flag indicating whether the luminance (min_ and max_) have been set.
  56. */
  57. int has_luminance;
  58. } AVMasteringDisplayMetadata;
  59. /**
  60. * Allocate an AVMasteringDisplayMetadata structure and set its fields to
  61. * default values. The resulting struct can be freed using av_freep().
  62. *
  63. * @return An AVMasteringDisplayMetadata filled with default values or NULL
  64. * on failure.
  65. */
  66. AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void);
  67. /**
  68. * Allocate a complete AVMasteringDisplayMetadata and add it to the frame.
  69. *
  70. * @param frame The frame which side data is added to.
  71. *
  72. * @return The AVMasteringDisplayMetadata structure to be filled by caller.
  73. */
  74. AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame);
  75. #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */