ffmpeg_api_adapter.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef __FFMPEG_API_ADAPTER_H__
  2. #define __FFMPEG_API_ADAPTER_H__
  3. #define av_always_inline __inline
  4. #define inline __inline
  5. #include <libavutil/avutil.h>
  6. #include <libavcodec/avcodec.h>
  7. #include <libswscale/swscale.h>
  8. #include "libavutil/opt.h"
  9. #include "libavutil/imgutils.h"
  10. #include "libavutil/pixfmt.h"
  11. #define API_MODE_OLD 0 /* old method, deprecated */
  12. #define API_MODE_NEW_API_REF_COUNT 1 /* new method, using the frame reference counting */
  13. #define API_MODE_NEW_API_NO_REF_COUNT 2 /* new method, without reference counting */
  14. #define API_MODE API_MODE_NEW_API_NO_REF_COUNT
  15. #if API_MODE == API_MODE_OLD
  16. #else
  17. #define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
  18. #endif
  19. #if API_MODE == API_MODE_OLD
  20. #else
  21. #define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
  22. #endif
  23. #if API_MODE == API_MODE_OLD
  24. #else
  25. #define PIX_FMT_RGB24 AV_PIX_FMT_RGB24
  26. #endif
  27. #if API_MODE == API_MODE_OLD
  28. #else
  29. #define PIX_FMT_BGR24 AV_PIX_FMT_BGR24
  30. #endif
  31. #if API_MODE == API_MODE_OLD
  32. #else
  33. #define CODEC_ID_H264 AV_CODEC_ID_H264
  34. #endif
  35. #if API_MODE == API_MODE_OLD
  36. #else
  37. #define CODEC_FLAG_LOW_DELAY AV_CODEC_FLAG_LOW_DELAY
  38. #endif
  39. #if API_MODE == API_MODE_OLD
  40. #else
  41. #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
  42. #endif
  43. #if API_MODE == API_MODE_OLD
  44. #else
  45. #define CODEC_FLAG_PASS1 AV_CODEC_FLAG_PASS1
  46. #endif
  47. #if API_MODE == API_MODE_OLD
  48. #else
  49. #define CODEC_FLAG2_LOCAL_HEADER AV_CODEC_FLAG2_LOCAL_HEADER
  50. #endif
  51. #if API_MODE == API_MODE_OLD
  52. #else
  53. #define avcodec_alloc_frame av_frame_alloc
  54. #endif
  55. #if API_MODE == API_MODE_OLD
  56. #else
  57. #define avcodec_free_frame av_frame_free
  58. #endif
  59. #endif