Skip to content

Commit e6bfe92

Browse files
committed
Remove unused c defs
1 parent 5f0e312 commit e6bfe92

9 files changed

Lines changed: 22 additions & 130 deletions

File tree

av/logging.pxd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
cdef extern from "Python.h" nogil:
2+
void PyErr_PrintEx(int set_sys_last_vars)
3+
int Py_IsInitialized()
4+
void PyErr_Display(object, object, object)
15

26
cpdef get_last_error()

av/logging.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def log_callback(
328328
format: cython.p_const_char,
329329
args: lib.va_list,
330330
) -> cython.void:
331-
inited: cython.bint = lib.Py_IsInitialized()
331+
inited: cython.bint = Py_IsInitialized()
332332
if not inited:
333333
return
334334

@@ -361,9 +361,9 @@ def log_callback(
361361
level,
362362
message,
363363
)
364-
# For some reason lib.PyErr_PrintEx(0) won't work.
364+
# For some reason PyErr_PrintEx(0) won't work.
365365
exc, type_, tb = sys.exc_info()
366-
lib.PyErr_Display(exc, type_, tb)
366+
PyErr_Display(exc, type_, tb)
367367

368368

369369
@cython.cfunc

include/libavcodec/bsf.pxd

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
21
cdef extern from "libavcodec/bsf.h" nogil:
3-
42
cdef struct AVBitStreamFilter:
53
const char *name
64
AVCodecID *codec_ids
@@ -13,28 +11,10 @@ cdef extern from "libavcodec/bsf.h" nogil:
1311
const AVCodecParameters *par_in
1412
const AVCodecParameters *par_out
1513

16-
cdef const AVBitStreamFilter* av_bsf_get_by_name(const char *name)
17-
18-
cdef int av_bsf_list_parse_str(
19-
const char *str,
20-
AVBSFContext **bsf
21-
)
22-
14+
cdef int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf)
2315
cdef int av_bsf_init(AVBSFContext *ctx)
2416
cdef void av_bsf_free(AVBSFContext **ctx)
25-
2617
cdef AVBitStreamFilter* av_bsf_iterate(void **opaque)
27-
28-
cdef int av_bsf_send_packet(
29-
AVBSFContext *ctx,
30-
AVPacket *pkt
31-
)
32-
33-
cdef int av_bsf_receive_packet(
34-
AVBSFContext *ctx,
35-
AVPacket *pkt
36-
)
37-
38-
cdef void av_bsf_flush(
39-
AVBSFContext *ctx
40-
)
18+
cdef int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)
19+
cdef int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt)
20+
cdef void av_bsf_flush(AVBSFContext *ctx)

include/libavutil/avutil.pxd

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from libc.stdint cimport int64_t, uint8_t, uint64_t, int32_t
22

33

4-
cdef extern from "libavutil/mathematics.h" nogil:
5-
pass
6-
74
cdef extern from "libavutil/display.h" nogil:
85
cdef double av_display_rotation_get(const int32_t matrix[9])
96

@@ -12,7 +9,7 @@ cdef extern from "libavutil/rational.h" nogil:
129

1310
cdef extern from "libavutil/avutil.h" nogil:
1411
cdef const char* av_version_info()
15-
cdef int avutil_version()
12+
cdef int avutil_version()
1613
cdef char* avutil_configuration()
1714
cdef char* avutil_license()
1815

@@ -34,15 +31,6 @@ cdef extern from "libavutil/avutil.h" nogil:
3431
PIX_FMT_RGB24
3532
PIX_FMT_RGBA
3633

37-
cdef enum AVRounding:
38-
AV_ROUND_ZERO
39-
AV_ROUND_INF
40-
AV_ROUND_DOWN
41-
AV_ROUND_UP
42-
AV_ROUND_NEAR_INF
43-
# This is nice, but only in FFMpeg:
44-
# AV_ROUND_PASS_MINMAX
45-
4634
cdef enum AVColorSpace:
4735
AVCOL_SPC_RGB
4836
AVCOL_SPC_BT709
@@ -83,37 +71,14 @@ cdef extern from "libavutil/avutil.h" nogil:
8371
AVCOL_PRI_NB
8472

8573
cdef enum AVColorTransferCharacteristic:
86-
AVCOL_TRC_RESERVED0
87-
AVCOL_TRC_BT709
88-
AVCOL_TRC_UNSPECIFIED
89-
AVCOL_TRC_RESERVED
90-
AVCOL_TRC_GAMMA22
91-
AVCOL_TRC_GAMMA28
92-
AVCOL_TRC_SMPTE170M
93-
AVCOL_TRC_SMPTE240M
94-
AVCOL_TRC_LINEAR
95-
AVCOL_TRC_LOG
96-
AVCOL_TRC_LOG_SQRT
97-
AVCOL_TRC_IEC61966_2_4
98-
AVCOL_TRC_BT1361_ECG
99-
AVCOL_TRC_IEC61966_2_1
100-
AVCOL_TRC_BT2020_10
101-
AVCOL_TRC_BT2020_12
102-
AVCOL_TRC_SMPTE2084
103-
AVCOL_TRC_SMPTEST2084
104-
AVCOL_TRC_SMPTE428
105-
AVCOL_TRC_SMPTEST428_1
106-
AVCOL_TRC_ARIB_STD_B67
107-
AVCOL_TRC_NB
74+
pass
10875

10976
cdef void* av_malloc(size_t size)
11077
cdef void* av_mallocz(size_t size)
11178
cdef void* av_realloc(void *ptr, size_t size)
11279
cdef void av_free(void *ptr)
11380
cdef void av_freep(void *ptr)
114-
11581
cdef int av_get_bytes_per_sample(AVSampleFormat sample_fmt)
116-
11782
cdef int av_samples_get_buffer_size(
11883
int *linesize,
11984
int nb_channels,
@@ -124,7 +89,6 @@ cdef extern from "libavutil/avutil.h" nogil:
12489
ctypedef struct AVRational:
12590
int num
12691
int den
127-
cdef AVRational AV_TIME_BASE_Q
12892
cdef int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
12993
cdef int64_t av_rescale(int64_t a, int64_t b, int64_t c)
13094
cdef const char* av_get_media_type_string(AVMediaType media_type)
@@ -142,13 +106,9 @@ cdef extern from "libavutil/pixdesc.h" nogil:
142106
AV_PIX_FMT_FLAG_BE
143107
AV_PIX_FMT_FLAG_PAL
144108
AV_PIX_FMT_FLAG_BITSTREAM
145-
AV_PIX_FMT_FLAG_HWACCEL
146109
AV_PIX_FMT_FLAG_PLANAR
147110
AV_PIX_FMT_FLAG_RGB
148-
AV_PIX_FMT_FLAG_PSEUDOPAL
149-
AV_PIX_FMT_FLAG_ALPHA
150111
AV_PIX_FMT_FLAG_BAYER
151-
AV_PIX_FMT_FLAG_FLOAT
152112

153113
# See: http://ffmpeg.org/doxygen/trunk/structAVPixFmtDescriptor.html
154114
cdef struct AVPixFmtDescriptor:
@@ -161,10 +121,8 @@ cdef extern from "libavutil/pixdesc.h" nogil:
161121

162122
cdef AVPixFmtDescriptor* av_pix_fmt_desc_get(AVPixelFormat pix_fmt)
163123
cdef AVPixFmtDescriptor* av_pix_fmt_desc_next(AVPixFmtDescriptor *prev)
164-
165124
cdef char * av_get_pix_fmt_name(AVPixelFormat pix_fmt)
166125
cdef AVPixelFormat av_get_pix_fmt(char* name)
167-
168126
int av_get_bits_per_pixel(AVPixFmtDescriptor *pixdesc)
169127
int av_get_padded_bits_per_pixel(AVPixFmtDescriptor *pixdesc)
170128

@@ -186,14 +144,6 @@ cdef extern from "stdarg.h" nogil:
186144
ctypedef struct va_list:
187145
pass
188146

189-
190-
cdef extern from "Python.h" nogil:
191-
cdef int Py_AddPendingCall(void *, void *)
192-
void PyErr_PrintEx(int set_sys_last_vars)
193-
int Py_IsInitialized()
194-
void PyErr_Display(object, object, object)
195-
196-
197147
cdef extern from "libavutil/opt.h" nogil:
198148
cdef enum AVOptionType:
199149
AV_OPT_TYPE_FLAGS

include/libavutil/dict.pxd

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,18 @@
11
cdef extern from "libavutil/dict.h" nogil:
2-
32
# See: http://ffmpeg.org/doxygen/trunk/structAVDictionary.html
43
ctypedef struct AVDictionary:
54
pass
6-
7-
cdef void av_dict_free(AVDictionary **)
8-
95
# See: http://ffmpeg.org/doxygen/trunk/structAVDictionaryEntry.html
106
ctypedef struct AVDictionaryEntry:
117
char *key
128
char *value
13-
149
cdef int AV_DICT_IGNORE_SUFFIX
15-
10+
cdef void av_dict_free(AVDictionary **)
1611
cdef AVDictionaryEntry* av_dict_get(
17-
AVDictionary *dict,
18-
char *key,
19-
AVDictionaryEntry *prev,
20-
int flags,
12+
AVDictionary *dict, char *key, AVDictionaryEntry *prev, int flags
2113
)
22-
2314
cdef int av_dict_set(
24-
AVDictionary **pm,
25-
const char *key,
26-
const char *value,
27-
int flags
28-
)
29-
30-
cdef int av_dict_count(
31-
AVDictionary *m
32-
)
33-
34-
cdef int av_dict_copy(
35-
AVDictionary **dst,
36-
AVDictionary *src,
37-
int flags
15+
AVDictionary **pm, const char *key, const char *value, int flags
3816
)
17+
cdef int av_dict_count(AVDictionary *m)
18+
cdef int av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags)

include/libavutil/error.pxd

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
cdef extern from "libavutil/error.h" nogil:
2-
3-
# Not actually from here, but whatever.
4-
cdef int ENOMEM
5-
cdef int EAGAIN
6-
72
cdef int AVERROR_BSF_NOT_FOUND
83
cdef int AVERROR_BUG
94
cdef int AVERROR_BUFFER_TOO_SMALL
@@ -23,21 +18,13 @@ cdef extern from "libavutil/error.h" nogil:
2318
cdef int AVERROR_EXPERIMENTAL
2419
cdef int AVERROR_INPUT_CHANGED
2520
cdef int AVERROR_OUTPUT_CHANGED
26-
2721
cdef int AVERROR_HTTP_BAD_REQUEST
2822
cdef int AVERROR_HTTP_UNAUTHORIZED
2923
cdef int AVERROR_HTTP_FORBIDDEN
3024
cdef int AVERROR_HTTP_NOT_FOUND
3125
cdef int AVERROR_HTTP_OTHER_4XX
3226
cdef int AVERROR_HTTP_SERVER_ERROR
33-
34-
cdef int AVERROR_NOMEM "AVERROR(ENOMEM)"
35-
36-
# cdef int FFERRTAG(int, int, int, int)
37-
3827
cdef int AVERROR(int error)
39-
4028
cdef int AV_ERROR_MAX_STRING_SIZE
41-
4229
cdef int av_strerror(int errno, char *output, size_t output_size)
4330
cdef char* av_err2str(int errnum)

include/libavutil/hwcontext.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
cdef extern from "libavutil/hwcontext.h" nogil:
2-
32
enum AVHWDeviceType:
43
AV_HWDEVICE_TYPE_NONE
54
AV_HWDEVICE_TYPE_VDPAU

include/libavutil/motion_vector.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ from libc.stdint cimport int16_t, int32_t, uint8_t, uint16_t, uint64_t
22

33

44
cdef extern from "libavutil/motion_vector.h" nogil:
5-
65
cdef struct AVMotionVector:
76
int32_t source
87
uint8_t w

include/libavutil/samplefmt.pxd

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
cdef extern from "libavutil/samplefmt.h" nogil:
2-
32
cdef enum AVSampleFormat:
43
AV_SAMPLE_FMT_NONE
54
AV_SAMPLE_FMT_U8
@@ -12,20 +11,14 @@ cdef extern from "libavutil/samplefmt.h" nogil:
1211
AV_SAMPLE_FMT_S32P
1312
AV_SAMPLE_FMT_FLTP
1413
AV_SAMPLE_FMT_DBLP
15-
AV_SAMPLE_FMT_NB # Number.
14+
AV_SAMPLE_FMT_NB
1615

17-
# Find by name.
1816
cdef AVSampleFormat av_get_sample_fmt(char* name)
19-
20-
# Inspection.
21-
cdef char * av_get_sample_fmt_name(AVSampleFormat sample_fmt)
22-
cdef int av_get_bytes_per_sample(AVSampleFormat sample_fmt)
23-
cdef int av_sample_fmt_is_planar(AVSampleFormat sample_fmt)
24-
25-
# Alternative forms.
17+
cdef char *av_get_sample_fmt_name(AVSampleFormat sample_fmt)
18+
cdef int av_get_bytes_per_sample(AVSampleFormat sample_fmt)
19+
cdef int av_sample_fmt_is_planar(AVSampleFormat sample_fmt)
2620
cdef AVSampleFormat av_get_packed_sample_fmt(AVSampleFormat sample_fmt)
2721
cdef AVSampleFormat av_get_planar_sample_fmt(AVSampleFormat sample_fmt)
28-
2922
cdef int av_samples_get_buffer_size(
3023
int *linesize,
3124
int nb_channels,

0 commit comments

Comments
 (0)