Fork me on GitHub
pp-avformat.h
Go to the documentation of this file.
1 
8 #ifndef JANUS_PP_AVFORMAT
9 #define JANUS_PP_AVFORMAT
10 
11 #include "../debug.h"
12 
13 #include <libavcodec/avcodec.h>
14 #include <libavformat/avformat.h>
15 
16 #define LIBAVCODEC_VER_AT_LEAST(major, minor) \
17  (LIBAVCODEC_VERSION_MAJOR > major || \
18  (LIBAVCODEC_VERSION_MAJOR == major && \
19  LIBAVCODEC_VERSION_MINOR >= minor))
20 
21 #define LIBAVFORMAT_VER_AT_LEAST(major, minor) \
22  (LIBAVFORMAT_VERSION_MAJOR > major || \
23  (LIBAVFORMAT_VERSION_MAJOR == major && \
24  LIBAVFORMAT_VERSION_MINOR >= minor))
25 
26 #if LIBAVCODEC_VER_AT_LEAST(51, 42)
27 #define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
28 #endif
29 
30 #if LIBAVCODEC_VER_AT_LEAST(56, 56)
31 #ifndef CODEC_FLAG_GLOBAL_HEADER
32 #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
33 #endif
34 #ifndef FF_INPUT_BUFFER_PADDING_SIZE
35 #define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
36 #endif
37 #endif
38 
39 #if LIBAVCODEC_VER_AT_LEAST(57, 14)
40 #define USE_CODECPAR
41 #endif
42 
43 void janus_pp_setup_avformat(void);
44 
45 AVFormatContext *janus_pp_create_avformatcontext(const char *format, const char *metadata, const char *destination);
46 
47 AVStream *janus_pp_new_video_avstream(AVFormatContext *fctx, int codec_id, int width, int height);
48 AVStream *janus_pp_new_audio_avstream(AVFormatContext *fctx, int codec_id, int samplerate, int channels, const uint8_t *extradata, int size);
49 
50 
51 #endif
AVFormatContext * janus_pp_create_avformatcontext(const char *format, const char *metadata, const char *destination)
Definition: pp-avformat.c:25
AVStream * janus_pp_new_video_avstream(AVFormatContext *fctx, int codec_id, int width, int height)
Definition: pp-avformat.c:76
void janus_pp_setup_avformat(void)
Definition: pp-avformat.c:10
AVStream * janus_pp_new_audio_avstream(AVFormatContext *fctx, int codec_id, int samplerate, int channels, const uint8_t *extradata, int size)
Definition: pp-avformat.c:54