ffmpeg_test.cpp 577 B

1234567891011121314151617181920212223242526272829
  1. #define __STDC_CONSTANT_MACROS
  2. #include <stdlib.h>
  3. extern "C" {
  4. #include <libavformat/avformat.h>
  5. #include <libavcodec/avcodec.h>
  6. #include <libswscale/swscale.h>
  7. }
  8. #define CALC_FFMPEG_VERSION(a,b,c) ( a<<16 | b<<8 | c )
  9. static void test()
  10. {
  11. AVFormatContext* c = 0;
  12. AVCodec* avcodec = 0;
  13. AVFrame* frame = 0;
  14. (void)avcodec;
  15. (void)frame;
  16. #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
  17. int err = avformat_open_input(&c, "", NULL, NULL);
  18. #else
  19. int err = av_open_input_file(&c, "", NULL, 0, NULL);
  20. #endif
  21. (void)err;
  22. }
  23. int main() { test(); return 0; }