avcodec.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. /**
  60. * Create and return a buffer reference from the data and properties
  61. * contained in frame.
  62. *
  63. * @param perms permissions to assign to the new buffer reference
  64. */
  65. AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
  66. const AVFrame *frame,
  67. int perms);
  68. #ifdef FF_API_FILL_FRAME
  69. /**
  70. * Fill an AVFrame with the information stored in samplesref.
  71. *
  72. * @param frame an already allocated AVFrame
  73. * @param samplesref an audio buffer reference
  74. * @return 0 in case of success, a negative AVERROR code in case of
  75. * failure
  76. * @deprecated Use avfilter_copy_buf_props() instead.
  77. */
  78. attribute_deprecated
  79. int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
  80. const AVFilterBufferRef *samplesref);
  81. /**
  82. * Fill an AVFrame with the information stored in picref.
  83. *
  84. * @param frame an already allocated AVFrame
  85. * @param picref a video buffer reference
  86. * @return 0 in case of success, a negative AVERROR code in case of
  87. * failure
  88. * @deprecated Use avfilter_copy_buf_props() instead.
  89. */
  90. attribute_deprecated
  91. int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
  92. const AVFilterBufferRef *picref);
  93. /**
  94. * Fill an AVFrame with information stored in ref.
  95. *
  96. * @param frame an already allocated AVFrame
  97. * @param ref a video or audio buffer reference
  98. * @return 0 in case of success, a negative AVERROR code in case of
  99. * failure
  100. * @deprecated Use avfilter_copy_buf_props() instead.
  101. */
  102. attribute_deprecated
  103. int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
  104. const AVFilterBufferRef *ref);
  105. #endif
  106. /**
  107. * Add frame data to buffer_src.
  108. *
  109. * @param buffer_src pointer to a buffer source context
  110. * @param frame a frame, or NULL to mark EOF
  111. * @param flags a combination of AV_BUFFERSRC_FLAG_*
  112. * @return >= 0 in case of success, a negative AVERROR code
  113. * in case of failure
  114. */
  115. int av_buffersrc_add_frame(AVFilterContext *buffer_src,
  116. const AVFrame *frame, int flags);
  117. #endif /* AVFILTER_AVCODEC_H */