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.

80 lines
3.0KB

  1. /*
  2. * Filters implementation helper functions
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public License
  8. * as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVFILTER_FILTERS_H
  21. #define AVFILTER_FILTERS_H
  22. /**
  23. * Filters implementation helper functions
  24. */
  25. #include "avfilter.h"
  26. /**
  27. * Mark a filter ready and schedule it for activation.
  28. *
  29. * This is automatically done when something happens to the filter (queued
  30. * frame, status change, request on output).
  31. * Filters implementing the activate callback can call it directly to
  32. * perform one more round of processing later.
  33. * It is also useful for filters reacting to external or asynchronous
  34. * events.
  35. */
  36. void ff_filter_set_ready(AVFilterContext *filter, unsigned priority);
  37. /**
  38. * Process the commands queued in the link up to the time of the frame.
  39. * Commands will trigger the process_command() callback.
  40. * @return >= 0 or AVERROR code.
  41. */
  42. int ff_inlink_process_commands(AVFilterLink *link, const AVFrame *frame);
  43. /**
  44. * Make sure a frame is writable.
  45. * This is similar to av_frame_make_writable() except it uses the link's
  46. * buffer allocation callback, and therefore allows direct rendering.
  47. */
  48. int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe);
  49. /**
  50. * Test and acknowledge the change of status on the link.
  51. *
  52. * Status means EOF or an error condition; a change from the normal (0)
  53. * status to a non-zero status can be queued in a filter's input link, it
  54. * becomes relevant after the frames queued in the link's FIFO are
  55. * processed. This function tests if frames are still queued and if a queued
  56. * status change has not yet been processed. In that case it performs basic
  57. * treatment (updating the link's timestamp) and returns a positive value to
  58. * let the filter do its own treatments (flushing...).
  59. *
  60. * Filters implementing the activate callback should call this function when
  61. * they think it might succeed (usually after checking unsuccessfully for a
  62. * queued frame).
  63. * Filters implementing the filter_frame and request_frame callbacks do not
  64. * need to call that since the same treatment happens in ff_filter_frame().
  65. *
  66. * @param[out] rstatus new or current status
  67. * @param[out] rpts current timestamp of the link in link time base
  68. * @return >0 if status changed, <0 if status already acked, 0 otherwise
  69. */
  70. int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts);
  71. #endif /* AVFILTER_FILTERS_H */