FFmpeg
Loading...
Searching...
No Matches
avcodec_internal.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19/*
20 * APIs internal to the generic codec layer.
21 *
22 * MUST NOT be included by individual encoders or decoders.
23 */
24
25#ifndef AVCODEC_AVCODEC_INTERNAL_H
26#define AVCODEC_AVCODEC_INTERNAL_H
27
28#include "libavutil/frame.h"
29
30#include "packet.h"
31
32struct AVCodecContext;
33
38
39/**
40 * A map between packet and frame side data types.
41 * Terminated with an entry where packet=AV_PKT_DATA_NB.
42 */
43extern const SideDataMap ff_sd_global_map[];
44
45/**
46 * avcodec_receive_frame() implementation for decoders.
47 */
48int ff_decode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame,
49 unsigned flags);
50
51/**
52 * avcodec_receive_frame() implementation for encoders.
53 */
54int ff_encode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame);
55
56/*
57 * Perform encoder initialization and validation.
58 * Called when opening the encoder, before the FFCodec.init() call.
59 */
60int ff_encode_preinit(struct AVCodecContext *avctx);
61
62/**
63 * Perform decoder initialization and validation.
64 * Called when opening the decoder, before the FFCodec.init() call.
65 */
66int ff_decode_preinit(struct AVCodecContext *avctx);
67
68void ff_decode_flush_buffers(struct AVCodecContext *avctx);
69void ff_encode_flush_buffers(struct AVCodecContext *avctx);
70
73 const struct AVCodecContext *src);
75
77
78void ff_codec_close(struct AVCodecContext *avctx);
79
81void ff_thread_free(struct AVCodecContext *s);
82
83/**
84 * Wait for decoding threads to finish and reset internal state.
85 * Called by avcodec_flush_buffers().
86 *
87 * @param avctx The context.
88 */
89void ff_thread_flush(struct AVCodecContext *avctx);
90
91/**
92 * Submit available packets for decoding to worker threads, return a
93 * decoded frame if available. Returns AVERROR(EAGAIN) if none is available.
94 *
95 * Parameters are the same as FFCodec.receive_frame, plus flags.
96 */
98 unsigned flags);
99
100/**
101 * Do the actual decoding and obtain a decoded frame from the decoder, if
102 * available. When frame threading is used, this is invoked by the worker
103 * threads, otherwise by the top layer directly.
104 */
106
107/**
108 * Get a packet for decoding. This gets invoked by the worker threads.
109 */
111
112#endif // AVCODEC_AVCODEC_INTERNAL_H
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const SideDataMap ff_sd_global_map[]
A map between packet and frame side data types.
Definition avcodec.c:57
void ff_thread_free(struct AVCodecContext *s)
Definition pthread.c:84
int ff_encode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame)
avcodec_receive_frame() implementation for encoders.
Definition encode.c:1011
void ff_thread_flush(struct AVCodecContext *avctx)
Wait for decoding threads to finish and reset internal state.
int ff_decode_preinit(struct AVCodecContext *avctx)
Perform decoder initialization and validation.
Definition decode.c:2029
void ff_encode_flush_buffers(struct AVCodecContext *avctx)
Definition encode.c:1024
void ff_decode_flush_buffers(struct AVCodecContext *avctx)
Definition decode.c:2365
void ff_decode_internal_uninit(struct AVCodecContext *avctx)
Definition decode.c:2406
void ff_codec_close(struct AVCodecContext *avctx)
Definition avcodec.c:443
int ff_decode_receive_frame_internal(struct AVCodecContext *avctx, AVFrame *frame)
Do the actual decoding and obtain a decoded frame from the decoder, if available.
Definition decode.c:625
int ff_encode_preinit(struct AVCodecContext *avctx)
Definition encode.c:898
int ff_decode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame, unsigned flags)
avcodec_receive_frame() implementation for decoders.
Definition decode.c:817
int ff_thread_init(struct AVCodecContext *s)
Definition pthread.c:72
void ff_decode_internal_sync(struct AVCodecContext *dst, const struct AVCodecContext *src)
struct AVCodecInternal * ff_decode_internal_alloc(void)
Definition decode.c:2385
struct AVCodecInternal * ff_encode_internal_alloc(void)
Definition encode.c:1034
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define s(width, name)
Definition cbs_vp9.c:198
#define ff_thread_get_packet(avctx, pkt)
Definition decode.c:225
#define ff_thread_receive_frame(avctx, frame, flags)
Definition decode.c:226
static AVPacket * pkt
static AVFrame * frame
reference-counted frame API
AVPacketSideDataType
Definition packet.h:41
AVFrameSideDataType
Definition frame.h:49
main external API structure.
Definition avcodec.h:443
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
This structure stores compressed data.
Definition packet.h:580
enum AVFrameSideDataType frame
enum AVPacketSideDataType packet
#define src
Definition vp8dsp.c:248