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.

134 lines
4.3KB

  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 AVFILTER_AVCODEC_H
  19. #define AVFILTER_AVCODEC_H
  20. /**
  21. * @file
  22. * libavcodec/libavfilter gluing utilities
  23. *
  24. * This should be included in an application ONLY if the installed
  25. * libavfilter has been compiled with libavcodec support, otherwise
  26. * symbols defined below will not be available.
  27. */
  28. #include "libavcodec/avcodec.h" // AVFrame
  29. #include "avfilter.h"
  30. #include "vsrc_buffer.h"
  31. /**
  32. * Copy the frame properties of src to dst, without copying the actual
  33. * image data.
  34. *
  35. * @return 0 on success, a negative number on error.
  36. */
  37. int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
  38. /**
  39. * Copy the frame properties and data pointers of src to dst, without copying
  40. * the actual data.
  41. *
  42. * @return 0 on success, a negative number on error.
  43. */
  44. int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
  45. /**
  46. * Create and return a picref reference from the data and properties
  47. * contained in frame.
  48. *
  49. * @param perms permissions to assign to the new buffer reference
  50. */
  51. AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
  52. /**
  53. * Create and return a picref reference from the data and properties
  54. * contained in frame.
  55. *
  56. * @param perms permissions to assign to the new buffer reference
  57. */
  58. AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
  59. int perms);
  60. #ifdef FF_API_FILL_FRAME
  61. /**
  62. * Fill an AVFrame with the information stored in samplesref.
  63. *
  64. * @param frame an already allocated AVFrame
  65. * @param samplesref an audio buffer reference
  66. * @return 0 in case of success, a negative AVERROR code in case of
  67. * failure
  68. * @deprecated Use avfilter_copy_buf_props() instead.
  69. */
  70. attribute_deprecated
  71. int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
  72. const AVFilterBufferRef *samplesref);
  73. /**
  74. * Fill an AVFrame with the information stored in picref.
  75. *
  76. * @param frame an already allocated AVFrame
  77. * @param picref a video buffer reference
  78. * @return 0 in case of success, a negative AVERROR code in case of
  79. * failure
  80. * @deprecated Use avfilter_copy_buf_props() instead.
  81. */
  82. attribute_deprecated
  83. int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
  84. const AVFilterBufferRef *picref);
  85. /**
  86. * Fill an AVFrame with information stored in ref.
  87. *
  88. * @param frame an already allocated AVFrame
  89. * @param ref a video or audio buffer reference
  90. * @return 0 in case of success, a negative AVERROR code in case of
  91. * failure
  92. * @deprecated Use avfilter_copy_buf_props() instead.
  93. */
  94. attribute_deprecated
  95. int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
  96. const AVFilterBufferRef *ref);
  97. #endif
  98. /**
  99. * Add frame data to buffer_src.
  100. *
  101. * @param buffer_src pointer to a buffer source context
  102. * @param frame a frame, or NULL to mark EOF
  103. * @param flags a combination of AV_BUFFERSRC_FLAG_*
  104. * @return >= 0 in case of success, a negative AVERROR code
  105. * in case of failure
  106. */
  107. int av_buffersrc_add_frame(AVFilterContext *buffer_src,
  108. const AVFrame *frame, int flags);
  109. /**
  110. * Add frame data to buffer_src.
  111. *
  112. * @param buffer_src pointer to a buffer source context
  113. * @param flags a combination of AV_VSRC_BUF_FLAG_* flags
  114. * @return >= 0 in case of success, a negative AVERROR code in case of
  115. * failure
  116. */
  117. int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
  118. const AVFrame *frame, int flags);
  119. #endif /* AVFILTER_AVCODEC_H */