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.

169 lines
3.8KB

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