avcodec.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. /**
  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. */
  68. int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
  69. const AVFilterBufferRef *samplesref);
  70. /**
  71. * Fill an AVFrame with the information stored in picref.
  72. *
  73. * @param frame an already allocated AVFrame
  74. * @param picref a video buffer reference
  75. * @return 0 in case of success, a negative AVERROR code in case of
  76. * failure
  77. */
  78. int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
  79. const AVFilterBufferRef *picref);
  80. /**
  81. * Fill an AVFrame with information stored in ref.
  82. *
  83. * @param frame an already allocated AVFrame
  84. * @param ref a video or audio buffer reference
  85. * @return 0 in case of success, a negative AVERROR code in case of
  86. * failure
  87. */
  88. int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
  89. const AVFilterBufferRef *ref);
  90. /**
  91. * Add frame data to buffer_src.
  92. *
  93. * @param buffer_src pointer to a buffer source context
  94. * @param frame a frame, or NULL to mark EOF
  95. * @param flags a combination of AV_BUFFERSRC_FLAG_*
  96. * @return >= 0 in case of success, a negative AVERROR code
  97. * in case of failure
  98. */
  99. int av_buffersrc_add_frame(AVFilterContext *buffer_src,
  100. const AVFrame *frame, int flags);
  101. /**
  102. * Add frame data to buffer_src.
  103. *
  104. * @param buffer_src pointer to a buffer source context
  105. * @param flags a combination of AV_VSRC_BUF_FLAG_* flags
  106. * @return >= 0 in case of success, a negative AVERROR code in case of
  107. * failure
  108. */
  109. int av_vsrc_buffer_add_frame(AVFilterContext *buffer_src,
  110. const AVFrame *frame, int flags);
  111. #endif /* AVFILTER_AVCODEC_H */