ffpyplayer 4.5.2__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ffpyplayer/__init__.py +53 -0
- ffpyplayer/clib/misc.c +186 -0
- ffpyplayer/clib/misc.h +62 -0
- ffpyplayer/includes/ff_consts.pxi +51 -0
- ffpyplayer/includes/ffconfig.h +40 -0
- ffpyplayer/includes/ffconfig.pxi +13 -0
- ffpyplayer/includes/ffmpeg.pxi +605 -0
- ffpyplayer/includes/inline_funcs.pxi +109 -0
- ffpyplayer/includes/sdl.pxi +167 -0
- ffpyplayer/pic.cp313-win_amd64.pyd +0 -0
- ffpyplayer/pic.pxd +44 -0
- ffpyplayer/pic.pyx +1116 -0
- ffpyplayer/player/__init__.py +10 -0
- ffpyplayer/player/clock.cp313-win_amd64.pyd +0 -0
- ffpyplayer/player/clock.pxd +20 -0
- ffpyplayer/player/clock.pyx +57 -0
- ffpyplayer/player/core.cp313-win_amd64.pyd +0 -0
- ffpyplayer/player/core.pxd +226 -0
- ffpyplayer/player/core.pyx +2440 -0
- ffpyplayer/player/decoder.cp313-win_amd64.pyd +0 -0
- ffpyplayer/player/decoder.pxd +35 -0
- ffpyplayer/player/decoder.pyx +155 -0
- ffpyplayer/player/frame_queue.cp313-win_amd64.pyd +0 -0
- ffpyplayer/player/frame_queue.pxd +62 -0
- ffpyplayer/player/frame_queue.pyx +260 -0
- ffpyplayer/player/player.cp313-win_amd64.pyd +0 -0
- ffpyplayer/player/player.pxd +19 -0
- ffpyplayer/player/player.pyx +1065 -0
- ffpyplayer/player/queue.cp313-win_amd64.pyd +0 -0
- ffpyplayer/player/queue.pxd +29 -0
- ffpyplayer/player/queue.pyx +142 -0
- ffpyplayer/tests/__init__.py +0 -0
- ffpyplayer/tests/common.py +35 -0
- ffpyplayer/tests/test_pic.py +25 -0
- ffpyplayer/tests/test_play.py +33 -0
- ffpyplayer/tests/test_write.py +182 -0
- ffpyplayer/threading.cp313-win_amd64.pyd +0 -0
- ffpyplayer/threading.pxd +46 -0
- ffpyplayer/threading.pyx +259 -0
- ffpyplayer/tools.cp313-win_amd64.pyd +0 -0
- ffpyplayer/tools.pyx +845 -0
- ffpyplayer/writer.cp313-win_amd64.pyd +0 -0
- ffpyplayer/writer.pxd +49 -0
- ffpyplayer/writer.pyx +582 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/README.txt +780 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/avcodec-60.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/avdevice-60.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/avfilter-9.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/avformat-60.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/avutil-58.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/ffmpeg.exe +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/ffplay.exe +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/ffprobe.exe +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/postproc-57.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/swresample-4.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/ffmpeg/bin/swscale-7.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/sdl/bin/COPYING.txt +20 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/sdl/bin/README-SDL.txt +13 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/sdl/bin/SDL2.dll +0 -0
- ffpyplayer-4.5.2.data/data/share/ffpyplayer/sdl/bin/SDL2_mixer.dll +0 -0
- ffpyplayer-4.5.2.dist-info/COPYING +165 -0
- ffpyplayer-4.5.2.dist-info/METADATA +119 -0
- ffpyplayer-4.5.2.dist-info/RECORD +65 -0
- ffpyplayer-4.5.2.dist-info/WHEEL +5 -0
- ffpyplayer-4.5.2.dist-info/top_level.txt +1 -0
ffpyplayer/__init__.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'''
|
|
2
|
+
FFPyPlayer library
|
|
3
|
+
==================
|
|
4
|
+
'''
|
|
5
|
+
import sys
|
|
6
|
+
import site
|
|
7
|
+
import os
|
|
8
|
+
from os.path import join
|
|
9
|
+
import platform
|
|
10
|
+
|
|
11
|
+
__all__ = ('dep_bins', )
|
|
12
|
+
|
|
13
|
+
__version__ = '4.5.2'
|
|
14
|
+
version = __version__
|
|
15
|
+
|
|
16
|
+
# the ffmpeg src git version tested and upto date with,
|
|
17
|
+
# and including this commit
|
|
18
|
+
_ffmpeg_git = 'c926140558c60786dc577b121df6b3c6b430bd98'
|
|
19
|
+
# excludes commits bdf9ed41fe4bdf4e254615b7333ab0feb1977e98,
|
|
20
|
+
# 1be3d8a0cb77f8d34c1f39b47bf5328fe10c82d7,
|
|
21
|
+
# f1907faab4023517af7d10d746b5684cccc5cfcc, and
|
|
22
|
+
# 0995e1f1b31f6e937a1b527407ed3e850f138098 because they require ffmpeg 5.1/5.2
|
|
23
|
+
# which is too new as of now
|
|
24
|
+
|
|
25
|
+
# also skipped all show modes and subtitle display related functionality commits
|
|
26
|
+
|
|
27
|
+
# TODO:
|
|
28
|
+
# * Implement CONFIG_SDL to be able to compile without needing SDL at all.
|
|
29
|
+
# * Currently, it only supports text subtitles - bitmap subtitles are ignored.
|
|
30
|
+
# Unless one uses a filter to overlay the subtitle.
|
|
31
|
+
# * We can not yet visualize audio to video. Provide a filter chain link between
|
|
32
|
+
# audio to video filters to acomplish this.
|
|
33
|
+
|
|
34
|
+
dep_bins = []
|
|
35
|
+
'''A list of paths to the binaries used by the library. It can be used during
|
|
36
|
+
packaging for including required binaries.
|
|
37
|
+
|
|
38
|
+
It is read only.
|
|
39
|
+
'''
|
|
40
|
+
|
|
41
|
+
for d in [sys.prefix, site.USER_BASE]:
|
|
42
|
+
if d is None:
|
|
43
|
+
continue
|
|
44
|
+
for lib in ('ffmpeg', 'sdl'):
|
|
45
|
+
p = join(d, 'share', 'ffpyplayer', lib, 'bin')
|
|
46
|
+
if os.path.isdir(p):
|
|
47
|
+
os.environ["PATH"] = p + os.pathsep + os.environ["PATH"]
|
|
48
|
+
if hasattr(os, 'add_dll_directory'):
|
|
49
|
+
os.add_dll_directory(p)
|
|
50
|
+
dep_bins.append(p)
|
|
51
|
+
|
|
52
|
+
if 'SDL_AUDIODRIVER' not in os.environ and platform.system() == 'Windows':
|
|
53
|
+
os.environ['SDL_AUDIODRIVER'] = 'DirectSound'
|
ffpyplayer/clib/misc.c
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
|
|
2
|
+
#include "misc.h"
|
|
3
|
+
|
|
4
|
+
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
|
5
|
+
void print_all_libs_info(int flags, int level)
|
|
6
|
+
{
|
|
7
|
+
#if CONFIG_AVUTIL
|
|
8
|
+
PRINT_LIB_INFO(avutil, AVUTIL, flags, level);
|
|
9
|
+
#endif
|
|
10
|
+
#if CONFIG_AVCODEC
|
|
11
|
+
PRINT_LIB_INFO(avcodec, AVCODEC, flags, level);
|
|
12
|
+
#endif
|
|
13
|
+
#if CONFIG_AVFORMAT
|
|
14
|
+
PRINT_LIB_INFO(avformat, AVFORMAT, flags, level);
|
|
15
|
+
#endif
|
|
16
|
+
#if CONFIG_AVDEVICE
|
|
17
|
+
PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level);
|
|
18
|
+
#endif
|
|
19
|
+
#if CONFIG_AVFILTER
|
|
20
|
+
PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
|
|
21
|
+
#endif
|
|
22
|
+
#if CONFIG_SWSCALE
|
|
23
|
+
PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
|
|
24
|
+
#endif
|
|
25
|
+
#if CONFIG_SWRESAMPLE
|
|
26
|
+
PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level);
|
|
27
|
+
#endif
|
|
28
|
+
#if CONFIG_POSTPROC
|
|
29
|
+
PRINT_LIB_INFO(postproc, POSTPROC, flags, level);
|
|
30
|
+
#endif
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const AVOption *opt_find(const void * obj, const char *name, const char *unit,
|
|
34
|
+
int opt_flags, int search_flags)
|
|
35
|
+
{
|
|
36
|
+
const AVOption *o = av_opt_find(obj, name, unit, opt_flags, search_flags);
|
|
37
|
+
if(o && !o->flags)
|
|
38
|
+
return NULL;
|
|
39
|
+
return o;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
|
|
43
|
+
int opt_default(const char *opt, const char *arg,
|
|
44
|
+
struct SwsContext *sws_opts, AVDictionary **sws_dict, AVDictionary **swr_opts,
|
|
45
|
+
AVDictionary **resample_opts, AVDictionary **format_opts, AVDictionary **codec_opts)
|
|
46
|
+
{
|
|
47
|
+
const AVOption *o;
|
|
48
|
+
int consumed = 0;
|
|
49
|
+
char opt_stripped[128];
|
|
50
|
+
const char *p;
|
|
51
|
+
const AVClass *cc = avcodec_get_class();
|
|
52
|
+
const AVClass *fc = avformat_get_class();
|
|
53
|
+
#if CONFIG_AVRESAMPLE
|
|
54
|
+
const AVClass *rc = avresample_get_class();
|
|
55
|
+
#endif
|
|
56
|
+
#if CONFIG_SWRESAMPLE
|
|
57
|
+
struct SwrContext *swr;
|
|
58
|
+
#endif
|
|
59
|
+
const AVClass *sc;
|
|
60
|
+
const AVClass *swr_class;
|
|
61
|
+
int ret;
|
|
62
|
+
#if CONFIG_SWSCALE
|
|
63
|
+
struct SwsContext *sws;
|
|
64
|
+
#endif
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
|
|
68
|
+
av_log_set_level(AV_LOG_DEBUG);
|
|
69
|
+
|
|
70
|
+
if (!(p = strchr(opt, ':')))
|
|
71
|
+
p = opt + strlen(opt);
|
|
72
|
+
av_strlcpy(opt_stripped, opt, FFMIN(sizeof(opt_stripped), p - opt + 1));
|
|
73
|
+
|
|
74
|
+
if ((o = opt_find(&cc, opt_stripped, NULL, 0,
|
|
75
|
+
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) ||
|
|
76
|
+
((opt[0] == 'v' || opt[0] == 'a' || opt[0] == 's') &&
|
|
77
|
+
(o = opt_find(&cc, opt + 1, NULL, 0, AV_OPT_SEARCH_FAKE_OBJ)))) {
|
|
78
|
+
av_dict_set(codec_opts, opt, arg, FLAGS);
|
|
79
|
+
consumed = 1;
|
|
80
|
+
}
|
|
81
|
+
if ((o = opt_find(&fc, opt, NULL, 0,
|
|
82
|
+
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
|
83
|
+
av_dict_set(format_opts, opt, arg, FLAGS);
|
|
84
|
+
if (consumed)
|
|
85
|
+
av_log(NULL, AV_LOG_VERBOSE, "Routing option %s to both codec and muxer layer\n", opt);
|
|
86
|
+
consumed = 1;
|
|
87
|
+
}
|
|
88
|
+
#if CONFIG_SWSCALE
|
|
89
|
+
sc = sws_get_class();
|
|
90
|
+
if (sws_dict && !consumed && (o = opt_find(&sc, opt, NULL, 0,
|
|
91
|
+
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
|
92
|
+
sws = sws_alloc_context();
|
|
93
|
+
ret = av_opt_set(sws, opt, arg, 0);
|
|
94
|
+
sws_freeContext(sws);
|
|
95
|
+
if (ret < 0) {
|
|
96
|
+
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
|
97
|
+
return ret;
|
|
98
|
+
}
|
|
99
|
+
if (sws_opts){
|
|
100
|
+
ret = av_opt_set(sws_opts, opt, arg, 0);
|
|
101
|
+
if (ret < 0) {
|
|
102
|
+
av_log(NULL, AV_LOG_ERROR, "Error setting option %s for sws_opts.\n", opt);
|
|
103
|
+
return ret;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
av_dict_set(sws_dict, opt, arg, FLAGS);
|
|
108
|
+
|
|
109
|
+
consumed = 1;
|
|
110
|
+
}
|
|
111
|
+
#else
|
|
112
|
+
if (!consumed && !strcmp(opt, "sws_flags")) {
|
|
113
|
+
av_log(NULL, AV_LOG_WARNING, "Ignoring %s %s, due to disabled swscale\n", opt, arg);
|
|
114
|
+
consumed = 1;
|
|
115
|
+
}
|
|
116
|
+
#endif
|
|
117
|
+
#if CONFIG_SWRESAMPLE
|
|
118
|
+
swr_class = swr_get_class();
|
|
119
|
+
if (swr_opts && !consumed && (o=opt_find(&swr_class, opt, NULL, 0,
|
|
120
|
+
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
|
121
|
+
swr = swr_alloc();
|
|
122
|
+
ret = av_opt_set(swr, opt, arg, 0);
|
|
123
|
+
swr_free(&swr);
|
|
124
|
+
if (ret < 0) {
|
|
125
|
+
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
|
|
126
|
+
return ret;
|
|
127
|
+
}
|
|
128
|
+
av_dict_set(swr_opts, opt, arg, FLAGS);
|
|
129
|
+
consumed = 1;
|
|
130
|
+
}
|
|
131
|
+
#endif
|
|
132
|
+
#if CONFIG_AVRESAMPLE
|
|
133
|
+
if (resample_opts && (o=opt_find(&rc, opt, NULL, 0,
|
|
134
|
+
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
|
|
135
|
+
av_dict_set(resample_opts, opt, arg, FLAGS);
|
|
136
|
+
consumed = 1;
|
|
137
|
+
}
|
|
138
|
+
#endif
|
|
139
|
+
|
|
140
|
+
if (consumed)
|
|
141
|
+
return 0;
|
|
142
|
+
return AVERROR_OPTION_NOT_FOUND;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
int get_plane_sizes(int size[4], int required_plane[4], enum AVPixelFormat pix_fmt,
|
|
146
|
+
int height, const int linesizes[4])
|
|
147
|
+
{
|
|
148
|
+
int i, total_size;
|
|
149
|
+
memset(required_plane, 0, sizeof(required_plane[0])*4);
|
|
150
|
+
|
|
151
|
+
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
|
|
152
|
+
memset(size, 0, sizeof(size[0])*4);
|
|
153
|
+
|
|
154
|
+
if (!height)
|
|
155
|
+
return AVERROR(EINVAL);
|
|
156
|
+
|
|
157
|
+
if (!desc || desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
|
|
158
|
+
return AVERROR(EINVAL);
|
|
159
|
+
|
|
160
|
+
if (linesizes[0] > (INT_MAX - 1024) / height)
|
|
161
|
+
return AVERROR(EINVAL);
|
|
162
|
+
size[0] = linesizes[0] * height;
|
|
163
|
+
|
|
164
|
+
if (desc->flags & AV_PIX_FMT_FLAG_PAL) {
|
|
165
|
+
size[1] = 256 * 4;
|
|
166
|
+
required_plane[0] = 1;
|
|
167
|
+
return size[0] + size[1];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
for (i = 0; i < 4; i++)
|
|
171
|
+
required_plane[desc->comp[i].plane] = 1;
|
|
172
|
+
|
|
173
|
+
total_size = size[0];
|
|
174
|
+
for (i = 1; i < 4 && required_plane[i]; i++) {
|
|
175
|
+
int h, s = (i == 1 || i == 2) ? desc->log2_chroma_h : 0;
|
|
176
|
+
h = (height + (1 << s) - 1) >> s;
|
|
177
|
+
if (linesizes[i] > INT_MAX / h)
|
|
178
|
+
return AVERROR(EINVAL);
|
|
179
|
+
size[i] = h * linesizes[i];
|
|
180
|
+
if (total_size > INT_MAX - size[i])
|
|
181
|
+
return AVERROR(EINVAL);
|
|
182
|
+
total_size += size[i];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return total_size;
|
|
186
|
+
}
|
ffpyplayer/clib/misc.h
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
#ifndef _FFINFO_H
|
|
3
|
+
#define _FFINFO_H
|
|
4
|
+
|
|
5
|
+
#include "../includes/ffconfig.h"
|
|
6
|
+
#include "libavcodec/avcodec.h"
|
|
7
|
+
#include "libavfilter/avfilter.h"
|
|
8
|
+
#include "libavformat/avformat.h"
|
|
9
|
+
#include "libavdevice/avdevice.h"
|
|
10
|
+
#include "libswscale/swscale.h"
|
|
11
|
+
#include "libswresample/swresample.h"
|
|
12
|
+
#include "libavutil/opt.h"
|
|
13
|
+
#include "libavutil/avstring.h"
|
|
14
|
+
#include "libavutil/pixdesc.h"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#if CONFIG_POSTPROC
|
|
18
|
+
#include "libpostproc/postprocess.h"
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#ifndef AV_LOG_TRACE
|
|
22
|
+
#define AV_LOG_TRACE 56
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
#define INDENT 1
|
|
27
|
+
#define SHOW_VERSION 2
|
|
28
|
+
#define SHOW_CONFIG 4
|
|
29
|
+
|
|
30
|
+
#define PRINT_LIB_INFO(libname, LIBNAME, flags, level) \
|
|
31
|
+
if (CONFIG_##LIBNAME) { \
|
|
32
|
+
const char *indent = flags & INDENT? " " : ""; \
|
|
33
|
+
if (flags & SHOW_VERSION) { \
|
|
34
|
+
unsigned int version = libname##_version(); \
|
|
35
|
+
av_log(NULL, level, \
|
|
36
|
+
"%slib%-11s %2d.%3d.%3d / %2d.%3d.%3d\n", \
|
|
37
|
+
indent, #libname, \
|
|
38
|
+
LIB##LIBNAME##_VERSION_MAJOR, \
|
|
39
|
+
LIB##LIBNAME##_VERSION_MINOR, \
|
|
40
|
+
LIB##LIBNAME##_VERSION_MICRO, \
|
|
41
|
+
version >> 16, version >> 8 & 0xff, version & 0xff); \
|
|
42
|
+
} \
|
|
43
|
+
if (flags & SHOW_CONFIG) { \
|
|
44
|
+
const char *cfg = libname##_configuration(); \
|
|
45
|
+
av_log(NULL, level, "%s%-11s configuration: %s\n", \
|
|
46
|
+
indent, #libname, cfg); \
|
|
47
|
+
} \
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
void print_all_libs_info(int flags, int level);
|
|
51
|
+
|
|
52
|
+
const AVOption *opt_find(const void * obj, const char *name, const char *unit,
|
|
53
|
+
int opt_flags, int search_flags);
|
|
54
|
+
|
|
55
|
+
int opt_default(const char *opt, const char *arg,
|
|
56
|
+
struct SwsContext *sws_opts, AVDictionary **sws_dict, AVDictionary **swr_opts,
|
|
57
|
+
AVDictionary **resample_opts, AVDictionary **format_opts, AVDictionary **codec_opts);
|
|
58
|
+
|
|
59
|
+
int get_plane_sizes(int size[4], int required_plane[4], enum AVPixelFormat pix_fmt,
|
|
60
|
+
int height, const int linesizes[4]);
|
|
61
|
+
|
|
62
|
+
#endif
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
include "ffconfig.pxi"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
''' Minimum SDL audio buffer size, in samples.. '''
|
|
5
|
+
DEF SDL_AUDIO_MIN_BUFFER_SIZE = 512
|
|
6
|
+
DEF AUDIO_MIN_BUFFER_SIZE = SDL_AUDIO_MIN_BUFFER_SIZE
|
|
7
|
+
' Calculate actual buffer size keeping in mind not cause too frequent audio callbacks. '
|
|
8
|
+
DEF AUDIO_MAX_CALLBACKS_PER_SEC = 30
|
|
9
|
+
|
|
10
|
+
DEF MAX_QUEUE_SIZE = (15 * 1024 * 1024)
|
|
11
|
+
DEF MIN_FRAMES = 25
|
|
12
|
+
DEF EXTERNAL_CLOCK_MIN_FRAMES = 2
|
|
13
|
+
DEF EXTERNAL_CLOCK_MAX_FRAMES = 10
|
|
14
|
+
|
|
15
|
+
'no AV sync correction is done if below the minimum AV sync threshold '
|
|
16
|
+
DEF AV_SYNC_THRESHOLD_MIN = 0.04
|
|
17
|
+
'AV sync correction is done if above the maximum AV sync threshold '
|
|
18
|
+
DEF AV_SYNC_THRESHOLD_MAX = 0.1
|
|
19
|
+
'If a frame duration is longer than this, it will not be duplicated to compensate AV sync'
|
|
20
|
+
DEF AV_SYNC_FRAMEDUP_THRESHOLD = 0.1
|
|
21
|
+
'no AV correction is done if too big error'
|
|
22
|
+
DEF AV_NOSYNC_THRESHOLD = 10.0
|
|
23
|
+
|
|
24
|
+
'maximum audio speed change to get correct sync'
|
|
25
|
+
DEF SAMPLE_CORRECTION_PERCENT_MAX = 10
|
|
26
|
+
|
|
27
|
+
'external clock speed adjustment constants for realtime sources based on buffer fullness'
|
|
28
|
+
DEF EXTERNAL_CLOCK_SPEED_MIN = 0.900
|
|
29
|
+
DEF EXTERNAL_CLOCK_SPEED_MAX = 1.010
|
|
30
|
+
DEF EXTERNAL_CLOCK_SPEED_STEP = 0.001
|
|
31
|
+
|
|
32
|
+
'we use about AUDIO_DIFF_AVG_NB A-V differences to make the average'
|
|
33
|
+
DEF AUDIO_DIFF_AVG_NB = 20
|
|
34
|
+
|
|
35
|
+
'polls for possible required screen refresh at least this often, should be less than 1/fps'
|
|
36
|
+
DEF REFRESH_RATE = 0.0167
|
|
37
|
+
|
|
38
|
+
'''NOTE: the size must be big enough to compensate the hardware audio buffersize size
|
|
39
|
+
TODO: We assume that a decoded and resampled frame fits into this buffer'''
|
|
40
|
+
DEF SAMPLE_ARRAY_SIZE = (8 * 65536)
|
|
41
|
+
|
|
42
|
+
DEF VIDEO_PICTURE_QUEUE_SIZE = 3
|
|
43
|
+
DEF SUBPICTURE_QUEUE_SIZE = 16
|
|
44
|
+
DEF SAMPLE_QUEUE_SIZE = 9
|
|
45
|
+
DEF FRAME_QUEUE_SIZE = max(SAMPLE_QUEUE_SIZE, max(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
DEF FF_LOCK_CREATE = 0
|
|
49
|
+
DEF FF_LOCK_OBTAIN = 1
|
|
50
|
+
DEF FF_LOCK_RELEASE = 2
|
|
51
|
+
DEF FF_LOCK_DESTROY = 3
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
#ifndef _FFCONFIG_H
|
|
3
|
+
#define _FFCONFIG_H
|
|
4
|
+
|
|
5
|
+
#include "SDL_version.h"
|
|
6
|
+
#define SDL_VERSIONNUM(X, Y, Z) ((X)*1000 + (Y)*100 + (Z))
|
|
7
|
+
#define SDL_VERSION_ATLEAST(X, Y, Z) (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
|
|
8
|
+
#if defined(__APPLE__) && SDL_VERSION_ATLEAST(1, 2, 14)
|
|
9
|
+
#define MAC_REALLOC 1
|
|
10
|
+
#else
|
|
11
|
+
#define MAC_REALLOC 0
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#if !defined(_WIN32) && !defined(__APPLE__)
|
|
15
|
+
#define NOT_WIN_MAC 1
|
|
16
|
+
#else
|
|
17
|
+
#define NOT_WIN_MAC 0
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#if defined(_WIN32)
|
|
21
|
+
#define WIN_IS_DEFINED 1
|
|
22
|
+
#else
|
|
23
|
+
#define WIN_IS_DEFINED 0
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#define CONFIG_AVFILTER 1
|
|
27
|
+
#define CONFIG_AVDEVICE 1
|
|
28
|
+
#define CONFIG_SWSCALE 1
|
|
29
|
+
#define CONFIG_RTSP_DEMUXER 1
|
|
30
|
+
#define CONFIG_MMSH_PROTOCOL 1
|
|
31
|
+
#define CONFIG_POSTPROC 0
|
|
32
|
+
#define CONFIG_SDL 1
|
|
33
|
+
#define HAS_SDL2 1
|
|
34
|
+
#define USE_SDL2_MIXER 1
|
|
35
|
+
#define CONFIG_AVUTIL 1
|
|
36
|
+
#define CONFIG_AVCODEC 1
|
|
37
|
+
#define CONFIG_AVFORMAT 1
|
|
38
|
+
#define CONFIG_SWRESAMPLE 1
|
|
39
|
+
|
|
40
|
+
#endif
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
DEF CONFIG_AVFILTER = 1
|
|
2
|
+
DEF CONFIG_AVDEVICE = 1
|
|
3
|
+
DEF CONFIG_SWSCALE = 1
|
|
4
|
+
DEF CONFIG_RTSP_DEMUXER = 1
|
|
5
|
+
DEF CONFIG_MMSH_PROTOCOL = 1
|
|
6
|
+
DEF CONFIG_POSTPROC = 0
|
|
7
|
+
DEF CONFIG_SDL = 1
|
|
8
|
+
DEF HAS_SDL2 = 1
|
|
9
|
+
DEF USE_SDL2_MIXER = 1
|
|
10
|
+
DEF CONFIG_AVUTIL = 1
|
|
11
|
+
DEF CONFIG_AVCODEC = 1
|
|
12
|
+
DEF CONFIG_AVFORMAT = 1
|
|
13
|
+
DEF CONFIG_SWRESAMPLE = 1
|