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 #if LIBAVCODEC_VER_AT_LEAST(51, 42)
22 #define PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
23 #endif
24 
25 #if LIBAVCODEC_VER_AT_LEAST(56, 56)
26 #ifndef CODEC_FLAG_GLOBAL_HEADER
27 #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
28 #endif
29 #ifndef FF_INPUT_BUFFER_PADDING_SIZE
30 #define FF_INPUT_BUFFER_PADDING_SIZE AV_INPUT_BUFFER_PADDING_SIZE
31 #endif
32 #endif
33 
34 #if LIBAVCODEC_VER_AT_LEAST(57, 14)
35 #define USE_CODECPAR
36 #endif
37 
38 void janus_pp_setup_avformat(void);
39 
40 AVFormatContext *janus_pp_create_avformatcontext(const char *format, const char *metadata, const char *destination);
41 
42 AVStream *janus_pp_new_video_avstream(AVFormatContext *fctx, int codec_id, int width, int height);
43 AVStream *janus_pp_new_audio_avstream(AVFormatContext *fctx, int codec_id, int samplerate, int channels, const uint8_t *extradata, int size);
44 
45 
46 #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:75
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:53