hwcontext_vaapi.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVUTIL_HWCONTEXT_VAAPI_H
  19. #define AVUTIL_HWCONTEXT_VAAPI_H
  20. #include <va/va.h>
  21. /**
  22. * @file
  23. * API-specific header for AV_HWDEVICE_TYPE_VAAPI.
  24. *
  25. * Dynamic frame pools are supported, but note that any pool used as a render
  26. * target is required to be of fixed size in order to be be usable as an
  27. * argument to vaCreateContext().
  28. *
  29. * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
  30. * with the data pointer set to a VASurfaceID.
  31. */
  32. /**
  33. * VAAPI connection details.
  34. *
  35. * Allocated as AVHWDeviceContext.hwctx
  36. */
  37. typedef struct AVVAAPIDeviceContext {
  38. /**
  39. * The VADisplay handle, to be filled by the user.
  40. */
  41. VADisplay display;
  42. } AVVAAPIDeviceContext;
  43. /**
  44. * VAAPI-specific data associated with a frame pool.
  45. *
  46. * Allocated as AVHWFramesContext.hwctx.
  47. */
  48. typedef struct AVVAAPIFramesContext {
  49. /**
  50. * Set by the user to apply surface attributes to all surfaces in
  51. * the frame pool. If null, default settings are used.
  52. */
  53. VASurfaceAttrib *attributes;
  54. int nb_attributes;
  55. /**
  56. * The surfaces IDs of all surfaces in the pool after creation.
  57. * Only valid if AVHWFramesContext.initial_pool_size was positive.
  58. * These are intended to be used as the render_targets arguments to
  59. * vaCreateContext().
  60. */
  61. VASurfaceID *surface_ids;
  62. int nb_surfaces;
  63. } AVVAAPIFramesContext;
  64. /**
  65. * VAAPI hardware pipeline configuration details.
  66. *
  67. * Allocated with av_hwdevice_hwconfig_alloc().
  68. */
  69. typedef struct AVVAAPIHWConfig {
  70. /**
  71. * ID of a VAAPI pipeline configuration.
  72. */
  73. VAConfigID config_id;
  74. } AVVAAPIHWConfig;
  75. #endif /* AVUTIL_HWCONTEXT_VAAPI_H */