Fork me on GitHub
Loading...
Searching...
No Matches
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/* https://github.com/FFmpeg/FFmpeg/commit/cdba98bb80e2ab73d34659c610771b020afc6a77 */
44#if LIBAVCODEC_VER_AT_LEAST(59, 24)
45#define NEW_CHANNEL_LAYOUT
46#endif
47
49
50AVFormatContext *janus_pp_create_avformatcontext(const char *format, const char *metadata, const char *destination);
51
52AVStream *janus_pp_new_video_avstream(AVFormatContext *fctx, int codec_id, int width, int height);
53AVStream *janus_pp_new_audio_avstream(AVFormatContext *fctx, int codec_id, int samplerate, int channels, const uint8_t *extradata, int size);
54
55
56#endif
Logging and Debugging.
AVStream * janus_pp_new_video_avstream(AVFormatContext *fctx, int codec_id, int width, int height)
Definition pp-avformat.c:80
AVFormatContext * janus_pp_create_avformatcontext(const char *format, const char *metadata, const char *destination)
Definition pp-avformat.c:25
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
void janus_pp_setup_avformat(void)
Definition pp-avformat.c:10