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.

vaapi_internal.h 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Video Acceleration API (video decoding)
  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_INTERNAL_H
  24. #define AVCODEC_VAAPI_INTERNAL_H
  25. #include <va/va.h>
  26. #include "vaapi.h"
  27. #include "avcodec.h"
  28. #include "mpegvideo.h"
  29. /**
  30. * @addtogroup VAAPI_Decoding
  31. *
  32. * @{
  33. */
  34. /** Extract VASurfaceID from an AVFrame */
  35. static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
  36. {
  37. return (uintptr_t)pic->data[3];
  38. }
  39. /** Common AVHWAccel.end_frame() implementation */
  40. void ff_vaapi_common_end_frame(AVCodecContext *avctx);
  41. /** Allocate a new picture parameter buffer */
  42. void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size);
  43. /** Allocate a new IQ matrix buffer */
  44. void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size);
  45. /** Allocate a new bit-plane buffer */
  46. uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size);
  47. /**
  48. * Allocate a new slice descriptor for the input slice.
  49. *
  50. * @param vactx the VA API context
  51. * @param buffer the slice data buffer base
  52. * @param size the size of the slice in bytes
  53. * @return the newly allocated slice parameter
  54. */
  55. VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, const uint8_t *buffer, uint32_t size);
  56. int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx);
  57. int ff_vaapi_commit_slices(struct vaapi_context *vactx);
  58. int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface);
  59. /* @} */
  60. #endif /* AVCODEC_VAAPI_INTERNAL_H */