48 cad->
param.info_level = 0;
63 davs2_seq_info_t *headerset,
int ret_type,
AVFrame *
frame)
66 int bytes_per_sample = pic->bytes_per_sample;
75 if (!pic || ret_type == DAVS2_GOT_HEADER) {
76 avctx->
width = headerset->width;
77 avctx->
height = headerset->height;
78 avctx->
pix_fmt = headerset->output_bit_depth == 10 ?
106 for (plane = 0; plane < 3; ++plane) {
107 int size_line = pic->widths[plane] * bytes_per_sample;
111 av_log(avctx,
AV_LOG_ERROR,
"Decoder error: allocation failure, can't dump frames.\n");
120 pic->planes[plane] +
line * pic->strides[plane],
121 pic->widths[plane] * bytes_per_sample);
136 int ret = DAVS2_GOT_FRAME;
138 while (ret == DAVS2_GOT_FRAME) {
143 if (ret == DAVS2_ERROR) {
151 int ret = DAVS2_DEFAULT;
154 if (ret == DAVS2_ERROR) {
158 if (ret == DAVS2_GOT_FRAME) {
171 davs2_decoder_close(cad->
decoder);
182 int buf_size = avpkt->
size;
185 int ret = DAVS2_DEFAULT;
192 cad->
packet.data = buf_ptr;
193 cad->
packet.len = buf_size;
200 if (ret == DAVS2_ERROR) {
207 if (ret != DAVS2_DEFAULT) {
212 return ret == 0 ? buf_size : ret;
229 .wrapper_name =
"libdavs2",
static void flush(AVCodecContext *avctx)
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
static atomic_int cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
#define AV_CPU_FLAG_AVX2
AVX2 functions: requires OS support even if YMM registers aren't used.
#define AV_CPU_FLAG_AVX
AVX functions: requires OS support even if YMM registers aren't used.
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
AVBufferRef * av_buffer_alloc(buffer_size_t size)
Allocate an AVBuffer of the given size using av_malloc().
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVRational av_d2q(double d, int max)
Convert a double precision floating point number to a rational.
@ AV_PICTURE_TYPE_I
Intra.
@ AV_PICTURE_TYPE_P
Predicted.
@ AV_PICTURE_TYPE_S
S(GMC)-VOP MPEG-4.
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int davs2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static av_cold int davs2_init(AVCodecContext *avctx)
AVCodec ff_libdavs2_decoder
static int davs2_dump_frames(AVCodecContext *avctx, davs2_picture_t *pic, int *got_frame, davs2_seq_info_t *headerset, int ret_type, AVFrame *frame)
static int send_delayed_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
static void davs2_flush(AVCodecContext *avctx)
static av_cold int davs2_end(AVCodecContext *avctx)
static enum AVPixelFormat pix_fmts[]
#define AV_PIX_FMT_YUV420P10
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
uint8_t * data
The data buffer.
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
enum AVPictureType pict_type
Picture type of the frame.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
int64_t dts
Decompression timestamp in AVStream->time_base units; the time at which the packet is decompressed.
davs2_picture_t out_frame
davs2_seq_info_t headerset