obs-hevc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /******************************************************************************
  2. Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include "util/c99defs.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. struct encoder_packet;
  20. enum {
  21. OBS_HEVC_NAL_TRAIL_N = 0,
  22. OBS_HEVC_NAL_TRAIL_R = 1,
  23. OBS_HEVC_NAL_TSA_N = 2,
  24. OBS_HEVC_NAL_TSA_R = 3,
  25. OBS_HEVC_NAL_STSA_N = 4,
  26. OBS_HEVC_NAL_STSA_R = 5,
  27. OBS_HEVC_NAL_RADL_N = 6,
  28. OBS_HEVC_NAL_RADL_R = 7,
  29. OBS_HEVC_NAL_RASL_N = 8,
  30. OBS_HEVC_NAL_RASL_R = 9,
  31. OBS_HEVC_NAL_VCL_N10 = 10,
  32. OBS_HEVC_NAL_VCL_R11 = 11,
  33. OBS_HEVC_NAL_VCL_N12 = 12,
  34. OBS_HEVC_NAL_VCL_R13 = 13,
  35. OBS_HEVC_NAL_VCL_N14 = 14,
  36. OBS_HEVC_NAL_VCL_R15 = 15,
  37. OBS_HEVC_NAL_BLA_W_LP = 16,
  38. OBS_HEVC_NAL_BLA_W_RADL = 17,
  39. OBS_HEVC_NAL_BLA_N_LP = 18,
  40. OBS_HEVC_NAL_IDR_W_RADL = 19,
  41. OBS_HEVC_NAL_IDR_N_LP = 20,
  42. OBS_HEVC_NAL_CRA_NUT = 21,
  43. OBS_HEVC_NAL_RSV_IRAP_VCL22 = 22,
  44. OBS_HEVC_NAL_RSV_IRAP_VCL23 = 23,
  45. OBS_HEVC_NAL_RSV_VCL24 = 24,
  46. OBS_HEVC_NAL_RSV_VCL25 = 25,
  47. OBS_HEVC_NAL_RSV_VCL26 = 26,
  48. OBS_HEVC_NAL_RSV_VCL27 = 27,
  49. OBS_HEVC_NAL_RSV_VCL28 = 28,
  50. OBS_HEVC_NAL_RSV_VCL29 = 29,
  51. OBS_HEVC_NAL_RSV_VCL30 = 30,
  52. OBS_HEVC_NAL_RSV_VCL31 = 31,
  53. OBS_HEVC_NAL_VPS = 32,
  54. OBS_HEVC_NAL_SPS = 33,
  55. OBS_HEVC_NAL_PPS = 34,
  56. OBS_HEVC_NAL_AUD = 35,
  57. OBS_HEVC_NAL_EOS_NUT = 36,
  58. OBS_HEVC_NAL_EOB_NUT = 37,
  59. OBS_HEVC_NAL_FD_NUT = 38,
  60. OBS_HEVC_NAL_SEI_PREFIX = 39,
  61. OBS_HEVC_NAL_SEI_SUFFIX = 40,
  62. };
  63. EXPORT bool obs_hevc_keyframe(const uint8_t *data, size_t size);
  64. EXPORT void obs_parse_hevc_packet(struct encoder_packet *hevc_packet, const struct encoder_packet *src);
  65. EXPORT int obs_parse_hevc_packet_priority(const struct encoder_packet *packet);
  66. EXPORT void obs_extract_hevc_headers(const uint8_t *packet, size_t size, uint8_t **new_packet_data,
  67. size_t *new_packet_size, uint8_t **header_data, size_t *header_size,
  68. uint8_t **sei_data, size_t *sei_size);
  69. #ifdef __cplusplus
  70. }
  71. #endif