qsvvpp.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. /**
  19. * @file
  20. * Intel Quick Sync Video VPP base function
  21. */
  22. #ifndef AVFILTER_QSVVPP_H
  23. #define AVFILTER_QSVVPP_H
  24. #include <mfx/mfxvideo.h>
  25. #include "avfilter.h"
  26. #define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads))
  27. #define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads))
  28. #define QSV_VERSION_ATLEAST(MAJOR, MINOR) \
  29. (MFX_VERSION_MAJOR > (MAJOR) || \
  30. MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR))
  31. #define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) \
  32. ((MFX_VERSION.Major > (MAJOR)) || \
  33. (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
  34. typedef struct QSVVPPContext QSVVPPContext;
  35. typedef struct QSVVPPCrop {
  36. int in_idx; ///< Input index
  37. int x, y, w, h; ///< Crop rectangle
  38. } QSVVPPCrop;
  39. typedef struct QSVVPPParam {
  40. /* default is ff_filter_frame */
  41. int (*filter_frame)(AVFilterLink *outlink, AVFrame *frame);
  42. /* To fill with MFX enhanced filter configurations */
  43. int num_ext_buf;
  44. mfxExtBuffer **ext_buf;
  45. /* Real output format */
  46. enum AVPixelFormat out_sw_format;
  47. /* Crop information for each input, if needed */
  48. int num_crop;
  49. QSVVPPCrop *crop;
  50. } QSVVPPParam;
  51. /* create and initialize the QSV session */
  52. int ff_qsvvpp_create(AVFilterContext *avctx, QSVVPPContext **vpp, QSVVPPParam *param);
  53. /* release the resources (eg.surfaces) */
  54. int ff_qsvvpp_free(QSVVPPContext **vpp);
  55. /* vpp filter frame and call the cb if needed */
  56. int ff_qsvvpp_filter_frame(QSVVPPContext *vpp, AVFilterLink *inlink, AVFrame *frame);
  57. #endif /* AVFILTER_QSVVPP_H */