vaapi.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. * Video Acceleration API (shared data between Libav and the video player)
  3. * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
  4. *
  5. * Copyright (C) 2008-2009 Splitted-Desktop Systems
  6. *
  7. * This file is part of Libav.
  8. *
  9. * Libav is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2.1 of the License, or (at your option) any later version.
  13. *
  14. * Libav is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with Libav; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. #ifndef AVCODEC_VAAPI_H
  24. #define AVCODEC_VAAPI_H
  25. #include <stdint.h>
  26. /**
  27. * \defgroup VAAPI_Decoding VA API Decoding
  28. * \ingroup Decoder
  29. * @{
  30. */
  31. /**
  32. * This structure is used to share data between the Libav library and
  33. * the client video application.
  34. * This shall be zero-allocated and available as
  35. * AVCodecContext.hwaccel_context. All user members can be set once
  36. * during initialization or through each AVCodecContext.get_buffer()
  37. * function call. In any case, they must be valid prior to calling
  38. * decoding functions.
  39. */
  40. struct vaapi_context {
  41. /**
  42. * Window system dependent data
  43. *
  44. * - encoding: unused
  45. * - decoding: Set by user
  46. */
  47. void *display;
  48. /**
  49. * Configuration ID
  50. *
  51. * - encoding: unused
  52. * - decoding: Set by user
  53. */
  54. uint32_t config_id;
  55. /**
  56. * Context ID (video decode pipeline)
  57. *
  58. * - encoding: unused
  59. * - decoding: Set by user
  60. */
  61. uint32_t context_id;
  62. /**
  63. * VAPictureParameterBuffer ID
  64. *
  65. * - encoding: unused
  66. * - decoding: Set by libavcodec
  67. */
  68. uint32_t pic_param_buf_id;
  69. /**
  70. * VAIQMatrixBuffer ID
  71. *
  72. * - encoding: unused
  73. * - decoding: Set by libavcodec
  74. */
  75. uint32_t iq_matrix_buf_id;
  76. /**
  77. * VABitPlaneBuffer ID (for VC-1 decoding)
  78. *
  79. * - encoding: unused
  80. * - decoding: Set by libavcodec
  81. */
  82. uint32_t bitplane_buf_id;
  83. /**
  84. * Slice parameter/data buffer IDs
  85. *
  86. * - encoding: unused
  87. * - decoding: Set by libavcodec
  88. */
  89. uint32_t *slice_buf_ids;
  90. /**
  91. * Number of effective slice buffer IDs to send to the HW
  92. *
  93. * - encoding: unused
  94. * - decoding: Set by libavcodec
  95. */
  96. unsigned int n_slice_buf_ids;
  97. /**
  98. * Size of pre-allocated slice_buf_ids
  99. *
  100. * - encoding: unused
  101. * - decoding: Set by libavcodec
  102. */
  103. unsigned int slice_buf_ids_alloc;
  104. /**
  105. * Pointer to VASliceParameterBuffers
  106. *
  107. * - encoding: unused
  108. * - decoding: Set by libavcodec
  109. */
  110. void *slice_params;
  111. /**
  112. * Size of a VASliceParameterBuffer element
  113. *
  114. * - encoding: unused
  115. * - decoding: Set by libavcodec
  116. */
  117. unsigned int slice_param_size;
  118. /**
  119. * Size of pre-allocated slice_params
  120. *
  121. * - encoding: unused
  122. * - decoding: Set by libavcodec
  123. */
  124. unsigned int slice_params_alloc;
  125. /**
  126. * Number of slices currently filled in
  127. *
  128. * - encoding: unused
  129. * - decoding: Set by libavcodec
  130. */
  131. unsigned int slice_count;
  132. /**
  133. * Pointer to slice data buffer base
  134. * - encoding: unused
  135. * - decoding: Set by libavcodec
  136. */
  137. const uint8_t *slice_data;
  138. /**
  139. * Current size of slice data
  140. *
  141. * - encoding: unused
  142. * - decoding: Set by libavcodec
  143. */
  144. uint32_t slice_data_size;
  145. };
  146. /* @} */
  147. #endif /* AVCODEC_VAAPI_H */