Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions include/libav.pxd
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
include "libavutil/avutil.pxd"
include "libavutil/buffer.pxd"
include "libavutil/dict.pxd"
include "libavutil/error.pxd"
include "libavutil/frame.pxd"
include "libavutil/hwcontext.pxd"
include "libavutil/samplefmt.pxd"
include "libavutil/motion_vector.pxd"
include "libavutil/video_enc_params.pxd"

include "libavcodec/avcodec.pxd"
include "libavcodec/bsf.pxd"
include "libavcodec/hwaccel.pxd"
Expand Down
124 changes: 24 additions & 100 deletions include/libavcodec/avcodec.pxd
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
from libc.stdint cimport int64_t, uint16_t, uint32_t, uint8_t

cdef extern from "libavcodec/packet.h" nogil:
const AVPacketSideData *av_packet_side_data_get(const AVPacketSideData *sd,
int nb_sd,
AVPacketSideDataType type)

uint8_t* av_packet_get_side_data(const AVPacket *pkt, AVPacketSideDataType type,
size_t *size)

int av_packet_add_side_data(AVPacket *pkt, AVPacketSideDataType type,
uint8_t *data, size_t size)

const AVPacketSideData *av_packet_side_data_get(
const AVPacketSideData *sd, int nb_sd, AVPacketSideDataType type
)
uint8_t* av_packet_get_side_data(
const AVPacket *pkt, AVPacketSideDataType type, size_t *size
)
int av_packet_add_side_data(
AVPacket *pkt, AVPacketSideDataType type, uint8_t *data, size_t size
)
const char *av_packet_side_data_name(AVPacketSideDataType type)

cdef extern from "libavutil/channel_layout.h":
ctypedef enum AVChannelOrder:
AV_CHANNEL_ORDER_UNSPEC
AV_CHANNEL_ORDER_NATIVE
AV_CHANNEL_ORDER_CUSTOM
AV_CHANNEL_ORDER_AMBISONIC

pass
ctypedef enum AVChannel:
AV_CHAN_NONE = -1
AV_CHAN_FRONT_LEFT
AV_CHAN_FRONT_RIGHT
AV_CHAN_FRONT_CENTER

ctypedef struct AVChannelLayout:
AVChannelOrder order
int nb_channels
Expand All @@ -36,10 +30,7 @@ cdef extern from "libavutil/channel_layout.h":
void *opaque

int av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask)
int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str)
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
int av_channel_layout_copy(AVChannelLayout *dst, const AVChannelLayout *src)
int av_channel_layout_describe(const AVChannelLayout *channel_layout, char *buf, size_t buf_size)
int av_channel_name(char *buf, size_t buf_size, AVChannel channel_id)
int av_channel_description(char *buf, size_t buf_size, AVChannel channel_id)
Expand All @@ -48,8 +39,7 @@ cdef extern from "libavutil/channel_layout.h":

cdef extern from "libavcodec/avcodec.h" nogil:
cdef set pyav_get_available_codecs()

cdef int avcodec_version()
cdef int avcodec_version()
cdef char* avcodec_configuration()
cdef char* avcodec_license()

Expand Down Expand Up @@ -293,72 +283,24 @@ cdef extern from "libavcodec/avcodec.h" nogil:
int subtitle_header_size
uint8_t *subtitle_header


cdef AVCodecContext* avcodec_alloc_context3(AVCodec *codec)
cdef void avcodec_free_context(AVCodecContext **ctx)

cdef AVClass* avcodec_get_class()

cdef AVCodec* avcodec_find_decoder(AVCodecID id)
cdef AVCodec* avcodec_find_encoder(AVCodecID id)

cdef AVCodec* avcodec_find_decoder_by_name(char *name)
cdef AVCodec* avcodec_find_encoder_by_name(char *name)

cdef const AVCodec* av_codec_iterate(void **opaque)

cdef AVCodecDescriptor* avcodec_descriptor_get (AVCodecID id)
cdef AVCodecDescriptor* avcodec_descriptor_get_by_name (char *name)

cdef AVCodecDescriptor* avcodec_descriptor_get(AVCodecID id)
cdef AVCodecDescriptor* avcodec_descriptor_get_by_name(char *name)
cdef char* avcodec_get_name(AVCodecID id)

cdef int avcodec_open2(
AVCodecContext *ctx,
AVCodec *codec,
AVDictionary **options,
)

cdef int AV_NUM_DATA_POINTERS

cdef int avcodec_open2(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options)
cdef enum AVPacketSideDataType:
AV_PKT_DATA_PALETTE
AV_PKT_DATA_NEW_EXTRADATA
AV_PKT_DATA_PARAM_CHANGE
AV_PKT_DATA_H263_MB_INFO
AV_PKT_DATA_REPLAYGAIN
AV_PKT_DATA_DISPLAYMATRIX
AV_PKT_DATA_STEREO3D
AV_PKT_DATA_AUDIO_SERVICE_TYPE
AV_PKT_DATA_QUALITY_STATS
AV_PKT_DATA_FALLBACK_TRACK
AV_PKT_DATA_CPB_PROPERTIES
AV_PKT_DATA_SKIP_SAMPLES
AV_PKT_DATA_JP_DUALMONO
AV_PKT_DATA_STRINGS_METADATA
AV_PKT_DATA_SUBTITLE_POSITION
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL
AV_PKT_DATA_WEBVTT_IDENTIFIER
AV_PKT_DATA_WEBVTT_SETTINGS
AV_PKT_DATA_METADATA_UPDATE
AV_PKT_DATA_MPEGTS_STREAM_ID
AV_PKT_DATA_MASTERING_DISPLAY_METADATA
AV_PKT_DATA_SPHERICAL
AV_PKT_DATA_CONTENT_LIGHT_LEVEL
AV_PKT_DATA_A53_CC
AV_PKT_DATA_ENCRYPTION_INIT_INFO
AV_PKT_DATA_ENCRYPTION_INFO
AV_PKT_DATA_AFD
AV_PKT_DATA_PRFT
AV_PKT_DATA_ICC_PROFILE
AV_PKT_DATA_DOVI_CONF
AV_PKT_DATA_S12M_TIMECODE
AV_PKT_DATA_DYNAMIC_HDR10_PLUS
AV_PKT_DATA_NB

pass
cdef struct AVPacketSideData:
uint8_t *data;
size_t size;
AVPacketSideDataType type;
uint8_t *data
size_t size
AVPacketSideDataType type

cdef enum AVFrameSideDataType:
AV_FRAME_DATA_PANSCAN
Expand Down Expand Up @@ -427,7 +369,7 @@ cdef extern from "libavcodec/avcodec.h" nogil:
int64_t duration

cdef struct AVPacket:
void *buf # ptr[AVBufferRef]
void *buf
int64_t pts
int64_t dts
uint8_t *data
Expand All @@ -450,7 +392,6 @@ cdef extern from "libavcodec/avcodec.h" nogil:
int buf_size,
int align
)

cdef AVPacket* av_packet_alloc()
cdef void av_packet_free(AVPacket **)
cdef int av_new_packet(AVPacket*, int)
Expand Down Expand Up @@ -485,30 +426,18 @@ cdef extern from "libavcodec/avcodec.h" nogil:
int64_t pts

cdef int avcodec_decode_subtitle2(
AVCodecContext *ctx,
AVSubtitle *sub,
int *done,
AVPacket *pkt,
AVCodecContext *ctx, AVSubtitle *sub, int *done, AVPacket *pkt,
)

cdef int avcodec_encode_subtitle(
AVCodecContext *avctx,
uint8_t *buf,
int buf_size,
AVSubtitle *sub
AVCodecContext *avctx, uint8_t *buf, int buf_size, AVSubtitle *sub
)

cdef void avsubtitle_free(AVSubtitle*)
cdef void avcodec_flush_buffers(AVCodecContext *ctx)

# === New-style Transcoding
cdef int avcodec_send_packet(AVCodecContext *avctx, AVPacket *packet)
cdef int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame)
cdef int avcodec_send_frame(AVCodecContext *avctx, AVFrame *frame)
cdef int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)

# === Parsers

cdef struct AVCodecParser:
int codec_ids[5]

Expand All @@ -529,20 +458,15 @@ cdef extern from "libavcodec/avcodec.h" nogil:
cdef struct AVCodecParameters:
AVMediaType codec_type
AVCodecID codec_id
AVPacketSideData *coded_side_data
int nb_coded_side_data
uint8_t *extradata
int extradata_size

cdef int avcodec_parameters_copy(
AVCodecParameters *dst,
const AVCodecParameters *src
AVCodecParameters *dst, const AVCodecParameters *src
)
cdef int avcodec_parameters_from_context(
AVCodecParameters *par,
const AVCodecContext *codec,
AVCodecParameters *par, const AVCodecContext *codec
)
cdef int avcodec_parameters_to_context(
AVCodecContext *codec,
const AVCodecParameters *par
AVCodecContext *codec, const AVCodecParameters *par
)
3 changes: 1 addition & 2 deletions include/libavfilter/avfilter.pxd
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
cdef extern from "libavfilter/avfilter.h" nogil:
cdef int avfilter_version()
cdef int avfilter_version()
cdef char* avfilter_configuration()
cdef char* avfilter_license()

cdef struct AVFilterPad:
# This struct is opaque.
pass

const char* avfilter_pad_get_name(const AVFilterPad *pads, int index)
Expand Down
6 changes: 1 addition & 5 deletions include/libavfilter/buffersrc.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
cdef extern from "libavfilter/buffersrc.h" nogil:

int av_buffersrc_write_frame(
AVFilterContext *ctx,
const AVFrame *frame
)
int av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame)
Loading
Loading