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.

190 lines
4.3KB

  1. /*
  2. * Video Acceleration API (shared data between FFmpeg 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 FFmpeg.
  8. *
  9. * FFmpeg 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. * FFmpeg 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 FFmpeg; 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. /**
  26. * @file
  27. * @ingroup lavc_codec_hwaccel_vaapi
  28. * Public libavcodec VA API header.
  29. */
  30. #include <stdint.h>
  31. #include "libavutil/attributes.h"
  32. #include "version.h"
  33. /**
  34. * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
  35. * @ingroup lavc_codec_hwaccel
  36. * @{
  37. */
  38. /**
  39. * This structure is used to share data between the FFmpeg library and
  40. * the client video application.
  41. * This shall be zero-allocated and available as
  42. * AVCodecContext.hwaccel_context. All user members can be set once
  43. * during initialization or through each AVCodecContext.get_buffer()
  44. * function call. In any case, they must be valid prior to calling
  45. * decoding functions.
  46. */
  47. struct vaapi_context {
  48. /**
  49. * Window system dependent data
  50. *
  51. * - encoding: unused
  52. * - decoding: Set by user
  53. */
  54. void *display;
  55. /**
  56. * Configuration ID
  57. *
  58. * - encoding: unused
  59. * - decoding: Set by user
  60. */
  61. uint32_t config_id;
  62. /**
  63. * Context ID (video decode pipeline)
  64. *
  65. * - encoding: unused
  66. * - decoding: Set by user
  67. */
  68. uint32_t context_id;
  69. #if FF_API_VAAPI_CONTEXT
  70. /**
  71. * VAPictureParameterBuffer ID
  72. *
  73. * - encoding: unused
  74. * - decoding: Set by libavcodec
  75. */
  76. attribute_deprecated
  77. uint32_t pic_param_buf_id;
  78. /**
  79. * VAIQMatrixBuffer ID
  80. *
  81. * - encoding: unused
  82. * - decoding: Set by libavcodec
  83. */
  84. attribute_deprecated
  85. uint32_t iq_matrix_buf_id;
  86. /**
  87. * VABitPlaneBuffer ID (for VC-1 decoding)
  88. *
  89. * - encoding: unused
  90. * - decoding: Set by libavcodec
  91. */
  92. attribute_deprecated
  93. uint32_t bitplane_buf_id;
  94. /**
  95. * Slice parameter/data buffer IDs
  96. *
  97. * - encoding: unused
  98. * - decoding: Set by libavcodec
  99. */
  100. attribute_deprecated
  101. uint32_t *slice_buf_ids;
  102. /**
  103. * Number of effective slice buffer IDs to send to the HW
  104. *
  105. * - encoding: unused
  106. * - decoding: Set by libavcodec
  107. */
  108. attribute_deprecated
  109. unsigned int n_slice_buf_ids;
  110. /**
  111. * Size of pre-allocated slice_buf_ids
  112. *
  113. * - encoding: unused
  114. * - decoding: Set by libavcodec
  115. */
  116. attribute_deprecated
  117. unsigned int slice_buf_ids_alloc;
  118. /**
  119. * Pointer to VASliceParameterBuffers
  120. *
  121. * - encoding: unused
  122. * - decoding: Set by libavcodec
  123. */
  124. attribute_deprecated
  125. void *slice_params;
  126. /**
  127. * Size of a VASliceParameterBuffer element
  128. *
  129. * - encoding: unused
  130. * - decoding: Set by libavcodec
  131. */
  132. attribute_deprecated
  133. unsigned int slice_param_size;
  134. /**
  135. * Size of pre-allocated slice_params
  136. *
  137. * - encoding: unused
  138. * - decoding: Set by libavcodec
  139. */
  140. attribute_deprecated
  141. unsigned int slice_params_alloc;
  142. /**
  143. * Number of slices currently filled in
  144. *
  145. * - encoding: unused
  146. * - decoding: Set by libavcodec
  147. */
  148. attribute_deprecated
  149. unsigned int slice_count;
  150. /**
  151. * Pointer to slice data buffer base
  152. * - encoding: unused
  153. * - decoding: Set by libavcodec
  154. */
  155. attribute_deprecated
  156. const uint8_t *slice_data;
  157. /**
  158. * Current size of slice data
  159. *
  160. * - encoding: unused
  161. * - decoding: Set by libavcodec
  162. */
  163. attribute_deprecated
  164. uint32_t slice_data_size;
  165. #endif
  166. };
  167. /* @} */
  168. #endif /* AVCODEC_VAAPI_H */