/src/ffmpeg/libavcodec/avcodec_internal.h
Line | Count | Source |
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 "avcodec.h" |
31 | | #include "packet.h" |
32 | | |
33 | | typedef struct FFCodecContext { |
34 | | /** |
35 | | * The public context. |
36 | | */ |
37 | | AVCodecContext pub; |
38 | | |
39 | | struct AVDictionary *lcevc_params; |
40 | | } FFCodecContext; |
41 | | |
42 | | static av_always_inline FFCodecContext *ffcodeccontext(AVCodecContext *avctx) |
43 | 0 | { |
44 | 0 | return (FFCodecContext*)avctx; |
45 | 0 | } Unexecuted instantiation: avcodec.c:ffcodeccontext Unexecuted instantiation: decode.c:ffcodeccontext Unexecuted instantiation: encode.c:ffcodeccontext Unexecuted instantiation: options.c:ffcodeccontext Unexecuted instantiation: pthread.c:ffcodeccontext Unexecuted instantiation: pthread_frame.c:ffcodeccontext |
46 | | |
47 | | typedef struct SideDataMap { |
48 | | enum AVPacketSideDataType packet; |
49 | | enum AVFrameSideDataType frame; |
50 | | } SideDataMap; |
51 | | |
52 | | /** |
53 | | * A map between packet and frame side data types. |
54 | | * Terminated with an entry where packet=AV_PKT_DATA_NB. |
55 | | */ |
56 | | extern const SideDataMap ff_sd_global_map[]; |
57 | | |
58 | | /** |
59 | | * avcodec_receive_frame() implementation for decoders. |
60 | | */ |
61 | | int ff_decode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame, |
62 | | unsigned flags); |
63 | | |
64 | | /** |
65 | | * avcodec_receive_frame() implementation for encoders. |
66 | | */ |
67 | | int ff_encode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame); |
68 | | |
69 | | /* |
70 | | * Perform encoder initialization and validation. |
71 | | * Called when opening the encoder, before the FFCodec.init() call. |
72 | | */ |
73 | | int ff_encode_preinit(struct AVCodecContext *avctx); |
74 | | |
75 | | /** |
76 | | * Perform decoder initialization and validation. |
77 | | * Called when opening the decoder, before the FFCodec.init() call. |
78 | | */ |
79 | | int ff_decode_preinit(struct AVCodecContext *avctx); |
80 | | |
81 | | void ff_decode_flush_buffers(struct AVCodecContext *avctx); |
82 | | void ff_encode_flush_buffers(struct AVCodecContext *avctx); |
83 | | |
84 | | struct AVCodecInternal *ff_decode_internal_alloc(void); |
85 | | void ff_decode_internal_sync(struct AVCodecContext *dst, |
86 | | const struct AVCodecContext *src); |
87 | | void ff_decode_internal_uninit(struct AVCodecContext *avctx); |
88 | | |
89 | | struct AVCodecInternal *ff_encode_internal_alloc(void); |
90 | | |
91 | | void ff_codec_close(struct AVCodecContext *avctx); |
92 | | |
93 | | int ff_thread_init(struct AVCodecContext *s); |
94 | | void ff_thread_free(struct AVCodecContext *s); |
95 | | |
96 | | /** |
97 | | * Wait for decoding threads to finish and reset internal state. |
98 | | * Called by avcodec_flush_buffers(). |
99 | | * |
100 | | * @param avctx The context. |
101 | | */ |
102 | | void ff_thread_flush(struct AVCodecContext *avctx); |
103 | | |
104 | | /** |
105 | | * Submit available packets for decoding to worker threads, return a |
106 | | * decoded frame if available. Returns AVERROR(EAGAIN) if none is available. |
107 | | * |
108 | | * Parameters are the same as FFCodec.receive_frame, plus flags. |
109 | | */ |
110 | | int ff_thread_receive_frame(struct AVCodecContext *avctx, AVFrame *frame, |
111 | | unsigned flags); |
112 | | |
113 | | /** |
114 | | * Do the actual decoding and obtain a decoded frame from the decoder, if |
115 | | * available. When frame threading is used, this is invoked by the worker |
116 | | * threads, otherwise by the top layer directly. |
117 | | */ |
118 | | int ff_decode_receive_frame_internal(struct AVCodecContext *avctx, AVFrame *frame); |
119 | | |
120 | | /** |
121 | | * Get a packet for decoding. This gets invoked by the worker threads. |
122 | | */ |
123 | | int ff_thread_get_packet(struct AVCodecContext *avctx, AVPacket *pkt); |
124 | | |
125 | | #endif // AVCODEC_AVCODEC_INTERNAL_H |