vaapi.h 3.9 KB

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