From a3879e01b534e0521142f67dd7060488f5a02e34 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Fri, 23 Jan 2026 14:32:48 -0500 Subject: [PATCH] Remove unused libavutil bindings --- include/libav.pxd | 1 - include/libavutil/avutil.pxd | 119 ++------------------------- include/libavutil/channel_layout.pxd | 11 --- 3 files changed, 6 insertions(+), 125 deletions(-) delete mode 100644 include/libavutil/channel_layout.pxd diff --git a/include/libav.pxd b/include/libav.pxd index 5e074a1b8..15e086f93 100644 --- a/include/libav.pxd +++ b/include/libav.pxd @@ -1,6 +1,5 @@ include "libavutil/avutil.pxd" include "libavutil/buffer.pxd" -include "libavutil/channel_layout.pxd" include "libavutil/dict.pxd" include "libavutil/error.pxd" include "libavutil/frame.pxd" diff --git a/include/libavutil/avutil.pxd b/include/libavutil/avutil.pxd index 1bfbd2c5d..790469ff7 100644 --- a/include/libavutil/avutil.pxd +++ b/include/libavutil/avutil.pxd @@ -11,7 +11,6 @@ cdef extern from "libavutil/rational.h" nogil: cdef int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max) cdef extern from "libavutil/avutil.h" nogil: - cdef const char* av_version_info() cdef int avutil_version() cdef char* avutil_configuration() @@ -107,13 +106,9 @@ cdef extern from "libavutil/avutil.h" nogil: AVCOL_TRC_ARIB_STD_B67 AVCOL_TRC_NB - cdef double M_PI - cdef void* av_malloc(size_t size) cdef void* av_mallocz(size_t size) - cdef void *av_calloc(size_t nmemb, size_t size) - cdef void *av_realloc(void *ptr, size_t size) - + cdef void* av_realloc(void *ptr, size_t size) cdef void av_free(void *ptr) cdef void av_freep(void *ptr) @@ -126,56 +121,15 @@ cdef extern from "libavutil/avutil.h" nogil: AVSampleFormat sample_fmt, int align ) - - # See: http://ffmpeg.org/doxygen/trunk/structAVRational.html ctypedef struct AVRational: int num int den - cdef AVRational AV_TIME_BASE_Q - - # Rescales from one time base to another - cdef int64_t av_rescale_q( - int64_t a, # time stamp - AVRational bq, # source time base - AVRational cq # target time base - ) - - # Rescale a 64-bit integer with specified rounding. - # A simple a*b/c isn't possible as it can overflow - cdef int64_t av_rescale_rnd( - int64_t a, - int64_t b, - int64_t c, - int r # should be AVRounding, but then we can't use bitwise logic. - ) - - cdef int64_t av_rescale_q_rnd( - int64_t a, - AVRational bq, - AVRational cq, - int r # should be AVRounding, but then we can't use bitwise logic. - ) - - cdef int64_t av_rescale( - int64_t a, - int64_t b, - int64_t c - ) - - cdef char* av_strdup(char *s) - - cdef int av_opt_set_int( - void *obj, - char *name, - int64_t value, - int search_flags - ) - + cdef int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) + cdef int64_t av_rescale(int64_t a, int64_t b, int64_t c) cdef const char* av_get_media_type_string(AVMediaType media_type) cdef extern from "libavutil/pixdesc.h" nogil: - # See: http://ffmpeg.org/doxygen/trunk/structAVComponentDescriptor.html cdef struct AVComponentDescriptor: unsigned int plane @@ -215,56 +169,25 @@ cdef extern from "libavutil/pixdesc.h" nogil: int av_get_padded_bits_per_pixel(AVPixFmtDescriptor *pixdesc) -cdef extern from "libavutil/channel_layout.h" nogil: - - # Layouts. - cdef uint64_t av_get_channel_layout(char* name) - cdef int av_get_channel_layout_nb_channels(uint64_t channel_layout) - cdef int64_t av_get_default_channel_layout(int nb_channels) - - # Channels. - cdef uint64_t av_channel_layout_extract_channel(uint64_t layout, int index) - cdef char* av_get_channel_name(uint64_t channel) - cdef char* av_get_channel_description(uint64_t channel) - - cdef extern from "libavutil/audio_fifo.h" nogil: - cdef struct AVAudioFifo: pass cdef void av_audio_fifo_free(AVAudioFifo *af) - cdef AVAudioFifo* av_audio_fifo_alloc( - AVSampleFormat sample_fmt, - int channels, - int nb_samples + AVSampleFormat sample_fmt, int channels, int nb_samples ) - - cdef int av_audio_fifo_write( - AVAudioFifo *af, - void **data, - int nb_samples - ) - - cdef int av_audio_fifo_read( - AVAudioFifo *af, - void **data, - int nb_samples - ) - + cdef int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples) + cdef int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples) cdef int av_audio_fifo_size(AVAudioFifo *af) - cdef int av_audio_fifo_space (AVAudioFifo *af) cdef extern from "stdarg.h" nogil: - # For logging. Should really be in another PXD. ctypedef struct va_list: pass cdef extern from "Python.h" nogil: - # For logging. See av/logging.pyx for an explanation. cdef int Py_AddPendingCall(void *, void *) void PyErr_PrintEx(int set_sys_last_vars) int Py_IsInitialized() @@ -310,7 +233,6 @@ cdef extern from "libavutil/opt.h" nogil: AV_OPT_FLAG_FILTERING_PARAM cdef struct AVOption: - const char *name const char *help AVOptionType type @@ -325,7 +247,6 @@ cdef extern from "libavutil/opt.h" nogil: cdef extern from "libavutil/imgutils.h" nogil: - cdef int av_image_alloc( uint8_t *pointers[4], int linesizes[4], @@ -341,37 +262,12 @@ cdef extern from "libavutil/imgutils.h" nogil: uint8_t *ptr, const int linesizes[4] ) - cdef int av_image_fill_linesizes( - int linesizes[4], - AVPixelFormat pix_fmt, - int width, - ) - cdef extern from "libavutil/log.h" nogil: - - cdef enum AVClassCategory: - AV_CLASS_CATEGORY_NA - AV_CLASS_CATEGORY_INPUT - AV_CLASS_CATEGORY_OUTPUT - AV_CLASS_CATEGORY_MUXER - AV_CLASS_CATEGORY_DEMUXER - AV_CLASS_CATEGORY_ENCODER - AV_CLASS_CATEGORY_DECODER - AV_CLASS_CATEGORY_FILTER - AV_CLASS_CATEGORY_BITSTREAM_FILTER - AV_CLASS_CATEGORY_SWSCALER - AV_CLASS_CATEGORY_SWRESAMPLER - AV_CLASS_CATEGORY_NB - cdef struct AVClass: - const char *class_name const char *(*item_name)(void*) nogil - - AVClassCategory category int parent_log_context_offset - const AVOption *option cdef enum: @@ -386,10 +282,7 @@ cdef extern from "libavutil/log.h" nogil: AV_LOG_TRACE AV_LOG_MAX_OFFSET - # Send a log. void av_log(void *ptr, int level, const char *fmt, ...) - - # Get the logs. ctypedef void(*av_log_callback)(void *, int, const char *, va_list) void av_log_default_callback(void *, int, const char *, va_list) void av_log_set_callback (av_log_callback callback) diff --git a/include/libavutil/channel_layout.pxd b/include/libavutil/channel_layout.pxd deleted file mode 100644 index 1459fbd22..000000000 --- a/include/libavutil/channel_layout.pxd +++ /dev/null @@ -1,11 +0,0 @@ -cdef extern from "libavutil/channel_layout.h" nogil: - - # This is not a comprehensive list. - cdef uint64_t AV_CH_LAYOUT_MONO - cdef uint64_t AV_CH_LAYOUT_STEREO - cdef uint64_t AV_CH_LAYOUT_2POINT1 - cdef uint64_t AV_CH_LAYOUT_4POINT0 - cdef uint64_t AV_CH_LAYOUT_5POINT0_BACK - cdef uint64_t AV_CH_LAYOUT_5POINT1_BACK - cdef uint64_t AV_CH_LAYOUT_6POINT1 - cdef uint64_t AV_CH_LAYOUT_7POINT1