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.

122 lines
3.9KB

  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. /**
  31. * Copy the frame properties of src to dst, without copying the actual
  32. * image data.
  33. *
  34. * @return 0 on success, a negative number on error.
  35. */
  36. int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src);
  37. /**
  38. * Copy the frame properties and data pointers of src to dst, without copying
  39. * the actual data.
  40. *
  41. * @return 0 on success, a negative number on error.
  42. */
  43. int avfilter_copy_buf_props(AVFrame *dst, const AVFilterBufferRef *src);
  44. /**
  45. * Create and return a picref reference from the data and properties
  46. * contained in frame.
  47. *
  48. * @param perms permissions to assign to the new buffer reference
  49. */
  50. AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
  51. /**
  52. * Create and return a picref reference from the data and properties
  53. * contained in frame.
  54. *
  55. * @param perms permissions to assign to the new buffer reference
  56. */
  57. AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
  58. int perms);
  59. #ifdef FF_API_FILL_FRAME
  60. /**
  61. * Fill an AVFrame with the information stored in samplesref.
  62. *
  63. * @param frame an already allocated AVFrame
  64. * @param samplesref an audio buffer reference
  65. * @return 0 in case of success, a negative AVERROR code in case of
  66. * failure
  67. * @deprecated Use avfilter_copy_buf_props() instead.
  68. */
  69. attribute_deprecated
  70. int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
  71. const AVFilterBufferRef *samplesref);
  72. /**
  73. * Fill an AVFrame with the information stored in picref.
  74. *
  75. * @param frame an already allocated AVFrame
  76. * @param picref a video buffer reference
  77. * @return 0 in case of success, a negative AVERROR code in case of
  78. * failure
  79. * @deprecated Use avfilter_copy_buf_props() instead.
  80. */
  81. attribute_deprecated
  82. int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
  83. const AVFilterBufferRef *picref);
  84. /**
  85. * Fill an AVFrame with information stored in ref.
  86. *
  87. * @param frame an already allocated AVFrame
  88. * @param ref a video or audio buffer reference
  89. * @return 0 in case of success, a negative AVERROR code in case of
  90. * failure
  91. * @deprecated Use avfilter_copy_buf_props() instead.
  92. */
  93. attribute_deprecated
  94. int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
  95. const AVFilterBufferRef *ref);
  96. #endif
  97. /**
  98. * Add frame data to buffer_src.
  99. *
  100. * @param buffer_src pointer to a buffer source context
  101. * @param frame a frame, or NULL to mark EOF
  102. * @param flags a combination of AV_BUFFERSRC_FLAG_*
  103. * @return >= 0 in case of success, a negative AVERROR code
  104. * in case of failure
  105. */
  106. int av_buffersrc_add_frame(AVFilterContext *buffer_src,
  107. const AVFrame *frame, int flags);
  108. #endif /* AVFILTER_AVCODEC_H */