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.

90 lines
3.0KB

  1. /*
  2. * This file is part of Libav.
  3. *
  4. * Libav 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. * Libav 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 Libav; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVFILTER_INTERNAL_H
  19. #define AVFILTER_INTERNAL_H
  20. /**
  21. * @file
  22. * internal API functions
  23. */
  24. #include "avfilter.h"
  25. /** default handler for freeing audio/video buffer when there are no references left */
  26. void ff_avfilter_default_free_buffer(AVFilterBuffer *buf);
  27. /** Tell is a format is contained in the provided list terminated by -1. */
  28. int ff_fmt_is_in(int fmt, const int *fmts);
  29. #define FF_DPRINTF_START(ctx, func) av_dlog(NULL, "%-16s: ", #func)
  30. void ff_dlog_link(void *ctx, AVFilterLink *link, int end);
  31. /**
  32. * Insert a new pad.
  33. *
  34. * @param idx Insertion point. Pad is inserted at the end if this point
  35. * is beyond the end of the list of pads.
  36. * @param count Pointer to the number of pads in the list
  37. * @param padidx_off Offset within an AVFilterLink structure to the element
  38. * to increment when inserting a new pad causes link
  39. * numbering to change
  40. * @param pads Pointer to the pointer to the beginning of the list of pads
  41. * @param links Pointer to the pointer to the beginning of the list of links
  42. * @param newpad The new pad to add. A copy is made when adding.
  43. */
  44. void ff_insert_pad(unsigned idx, unsigned *count, size_t padidx_off,
  45. AVFilterPad **pads, AVFilterLink ***links,
  46. AVFilterPad *newpad);
  47. /** Insert a new input pad for the filter. */
  48. static inline void ff_insert_inpad(AVFilterContext *f, unsigned index,
  49. AVFilterPad *p)
  50. {
  51. ff_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad),
  52. &f->input_pads, &f->inputs, p);
  53. }
  54. /** Insert a new output pad for the filter. */
  55. static inline void ff_insert_outpad(AVFilterContext *f, unsigned index,
  56. AVFilterPad *p)
  57. {
  58. ff_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad),
  59. &f->output_pads, &f->outputs, p);
  60. }
  61. /**
  62. * Poll a frame from the filter chain.
  63. *
  64. * @param link the input link
  65. * @return the number of immediately available frames, a negative
  66. * number in case of error
  67. */
  68. int ff_poll_frame(AVFilterLink *link);
  69. /**
  70. * Request an input frame from the filter at the other end of the link.
  71. *
  72. * @param link the input link
  73. * @return zero on success
  74. */
  75. int ff_request_frame(AVFilterLink *link);
  76. #endif /* AVFILTER_INTERNAL_H */