Showing
33 changed files
with
0 additions
and
4259 deletions
Too many changes to show.
To preserve performance only 33 of 33+ files are displayed.
No preview for this file type
No preview for this file type
1 | -<?xml version="1.0" encoding="UTF-8"?> | ||
2 | -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
3 | -<plist version="1.0"> | ||
4 | -<dict> | ||
5 | - <key>AvailableLibraries</key> | ||
6 | - <array> | ||
7 | - <dict> | ||
8 | - <key>LibraryIdentifier</key> | ||
9 | - <string>ios-arm64_armv7</string> | ||
10 | - <key>LibraryPath</key> | ||
11 | - <string>TXFFmpeg.framework</string> | ||
12 | - <key>SupportedArchitectures</key> | ||
13 | - <array> | ||
14 | - <string>arm64</string> | ||
15 | - <string>armv7</string> | ||
16 | - </array> | ||
17 | - <key>SupportedPlatform</key> | ||
18 | - <string>ios</string> | ||
19 | - </dict> | ||
20 | - <dict> | ||
21 | - <key>LibraryIdentifier</key> | ||
22 | - <string>ios-x86_64-simulator</string> | ||
23 | - <key>LibraryPath</key> | ||
24 | - <string>TXFFmpeg.framework</string> | ||
25 | - <key>SupportedArchitectures</key> | ||
26 | - <array> | ||
27 | - <string>x86_64</string> | ||
28 | - </array> | ||
29 | - <key>SupportedPlatform</key> | ||
30 | - <string>ios</string> | ||
31 | - <key>SupportedPlatformVariant</key> | ||
32 | - <string>simulator</string> | ||
33 | - </dict> | ||
34 | - </array> | ||
35 | - <key>CFBundlePackageType</key> | ||
36 | - <string>XFWK</string> | ||
37 | - <key>XCFrameworkFormatVersion</key> | ||
38 | - <string>1.0</string> | ||
39 | -</dict> | ||
40 | -</plist> |
No preview for this file type
No preview for this file type
HHVDoctorSDK/TXFFmpeg.xcframework/ios-arm64_armv7/TXFFmpeg.framework/Headers/TXFFmpeg.h
deleted
100644 → 0
1 | -/* | ||
2 | - * Copyright (c) 2022 Tencent. All Rights Reserved. | ||
3 | - * | ||
4 | - */ | ||
5 | - | ||
6 | -#import <TXFFmpeg/ffmpeg_rename_defines.h> | ||
7 | -#import <TXFFmpeg/libavutil/adler32.h> | ||
8 | -#import <TXFFmpeg/libavutil/aes.h> | ||
9 | -#import <TXFFmpeg/libavutil/aes_ctr.h> | ||
10 | -#import <TXFFmpeg/libavutil/attributes.h> | ||
11 | -#import <TXFFmpeg/libavutil/audio_fifo.h> | ||
12 | -#import <TXFFmpeg/libavutil/avassert.h> | ||
13 | -#import <TXFFmpeg/libavutil/avstring.h> | ||
14 | -#import <TXFFmpeg/libavutil/avutil.h> | ||
15 | -#import <TXFFmpeg/libavutil/base64.h> | ||
16 | -#import <TXFFmpeg/libavutil/blowfish.h> | ||
17 | -#import <TXFFmpeg/libavutil/bprint.h> | ||
18 | -#import <TXFFmpeg/libavutil/bswap.h> | ||
19 | -#import <TXFFmpeg/libavutil/buffer.h> | ||
20 | -#import <TXFFmpeg/libavutil/cast5.h> | ||
21 | -#import <TXFFmpeg/libavutil/camellia.h> | ||
22 | -#import <TXFFmpeg/libavutil/channel_layout.h> | ||
23 | -#import <TXFFmpeg/libavutil/common.h> | ||
24 | -#import <TXFFmpeg/libavutil/cpu.h> | ||
25 | -#import <TXFFmpeg/libavutil/crc.h> | ||
26 | -#import <TXFFmpeg/libavutil/des.h> | ||
27 | -#import <TXFFmpeg/libavutil/dict.h> | ||
28 | -#import <TXFFmpeg/libavutil/display.h> | ||
29 | -#import <TXFFmpeg/libavutil/dovi_meta.h> | ||
30 | -#import <TXFFmpeg/libavutil/downmix_info.h> | ||
31 | -#import <TXFFmpeg/libavutil/encryption_info.h> | ||
32 | -#import <TXFFmpeg/libavutil/error.h> | ||
33 | -#import <TXFFmpeg/libavutil/eval.h> | ||
34 | -#import <TXFFmpeg/libavutil/fifo.h> | ||
35 | -#import <TXFFmpeg/libavutil/file.h> | ||
36 | -#import <TXFFmpeg/libavutil/frame.h> | ||
37 | -#import <TXFFmpeg/libavutil/hash.h> | ||
38 | -#import <TXFFmpeg/libavutil/hmac.h> | ||
39 | -#import <TXFFmpeg/libavutil/hwcontext.h> | ||
40 | -#import <TXFFmpeg/libavutil/hwcontext_cuda.h> | ||
41 | -#import <TXFFmpeg/libavutil/hwcontext_d3d11va.h> | ||
42 | -#import <TXFFmpeg/libavutil/hwcontext_drm.h> | ||
43 | -#import <TXFFmpeg/libavutil/hwcontext_dxva2.h> | ||
44 | -#import <TXFFmpeg/libavutil/hwcontext_qsv.h> | ||
45 | -#import <TXFFmpeg/libavutil/hwcontext_mediacodec.h> | ||
46 | -#import <TXFFmpeg/libavutil/hwcontext_vaapi.h> | ||
47 | -#import <TXFFmpeg/libavutil/hwcontext_videotoolbox.h> | ||
48 | -#import <TXFFmpeg/libavutil/hwcontext_vdpau.h> | ||
49 | -#import <TXFFmpeg/libavutil/imgutils.h> | ||
50 | -#import <TXFFmpeg/libavutil/intfloat.h> | ||
51 | -#import <TXFFmpeg/libavutil/intreadwrite.h> | ||
52 | -#import <TXFFmpeg/libavutil/lfg.h> | ||
53 | -#import <TXFFmpeg/libavutil/log.h> | ||
54 | -#import <TXFFmpeg/libavutil/macros.h> | ||
55 | -#import <TXFFmpeg/libavutil/mathematics.h> | ||
56 | -#import <TXFFmpeg/libavutil/mastering_display_metadata.h> | ||
57 | -#import <TXFFmpeg/libavutil/md5.h> | ||
58 | -#import <TXFFmpeg/libavutil/mem.h> | ||
59 | -#import <TXFFmpeg/libavutil/motion_vector.h> | ||
60 | -#import <TXFFmpeg/libavutil/murmur3.h> | ||
61 | -#import <TXFFmpeg/libavutil/opt.h> | ||
62 | -#import <TXFFmpeg/libavutil/parseutils.h> | ||
63 | -#import <TXFFmpeg/libavutil/pixdesc.h> | ||
64 | -#import <TXFFmpeg/libavutil/pixfmt.h> | ||
65 | -#import <TXFFmpeg/libavutil/random_seed.h> | ||
66 | -#import <TXFFmpeg/libavutil/rc4.h> | ||
67 | -#import <TXFFmpeg/libavutil/rational.h> | ||
68 | -#import <TXFFmpeg/libavutil/replaygain.h> | ||
69 | -#import <TXFFmpeg/libavutil/ripemd.h> | ||
70 | -#import <TXFFmpeg/libavutil/samplefmt.h> | ||
71 | -#import <TXFFmpeg/libavutil/sha.h> | ||
72 | -#import <TXFFmpeg/libavutil/sha512.h> | ||
73 | -#import <TXFFmpeg/libavutil/spherical.h> | ||
74 | -#import <TXFFmpeg/libavutil/stereo3d.h> | ||
75 | -#import <TXFFmpeg/libavutil/threadmessage.h> | ||
76 | -#import <TXFFmpeg/libavutil/time.h> | ||
77 | -#import <TXFFmpeg/libavutil/timecode.h> | ||
78 | -#import <TXFFmpeg/libavutil/timestamp.h> | ||
79 | -#import <TXFFmpeg/libavutil/tree.h> | ||
80 | -#import <TXFFmpeg/libavutil/twofish.h> | ||
81 | -#import <TXFFmpeg/libavutil/version.h> | ||
82 | -#import <TXFFmpeg/libavutil/xtea.h> | ||
83 | -#import <TXFFmpeg/libavutil/tea.h> | ||
84 | -#import <TXFFmpeg/libavutil/pthread_helper.h> | ||
85 | -#import <TXFFmpeg/libavutil/tx.h> | ||
86 | -#import <TXFFmpeg/libavutil/avconfig.h> | ||
87 | -#import <TXFFmpeg/libavutil/ffversion.h> | ||
88 | -#import <TXFFmpeg/libavutil/lzo.h> | ||
89 | -#import <TXFFmpeg/libavfilter/avfilter.h> | ||
90 | -#import <TXFFmpeg/libavfilter/version.h> | ||
91 | -#import <TXFFmpeg/libavfilter/buffersink.h> | ||
92 | -#import <TXFFmpeg/libavfilter/buffersrc.h> | ||
93 | -#import <TXFFmpeg/libswresample/swresample.h> | ||
94 | -#import <TXFFmpeg/libswresample/version.h> | ||
95 | -#import <TXFFmpeg/libswscale/swscale.h> | ||
96 | -#import <TXFFmpeg/libswscale/version.h> | ||
97 | -#import <TXFFmpeg/libavcodec/ac3_parser.h> | ||
98 | -#import <TXFFmpeg/libavcodec/adts_parser.h> | ||
99 | -#import <TXFFmpeg/libavcodec/avcodec.h> | ||
100 | -#import <TXFFmpeg/libavcodec/avdct.h> | ||
101 | -#import <TXFFmpeg/libavcodec/avfft.h> | ||
102 | -#import <TXFFmpeg/libavcodec/d3d11va.h> | ||
103 | -#import <TXFFmpeg/libavcodec/dirac.h> | ||
104 | -#import <TXFFmpeg/libavcodec/dv_profile.h> | ||
105 | -#import <TXFFmpeg/libavcodec/dxva2.h> | ||
106 | -#import <TXFFmpeg/libavcodec/jni.h> | ||
107 | -#import <TXFFmpeg/libavcodec/mediacodec.h> | ||
108 | -#import <TXFFmpeg/libavcodec/qsv.h> | ||
109 | -#import <TXFFmpeg/libavcodec/vaapi.h> | ||
110 | -#import <TXFFmpeg/libavcodec/vdpau.h> | ||
111 | -#import <TXFFmpeg/libavcodec/version.h> | ||
112 | -#import <TXFFmpeg/libavcodec/videotoolbox.h> | ||
113 | -#import <TXFFmpeg/libavcodec/vorbis_parser.h> | ||
114 | -#import <TXFFmpeg/libavcodec/xvmc.h> | ||
115 | -#import <TXFFmpeg/libavcodec/ass_split.h> | ||
116 | -#import <TXFFmpeg/libavcodec/bytestream.h> | ||
117 | -#import <TXFFmpeg/libavformat/avformat.h> | ||
118 | -#import <TXFFmpeg/libavformat/avio.h> | ||
119 | -#import <TXFFmpeg/libavformat/version.h> | ||
120 | -#import <TXFFmpeg/libavformat/internal.h> | ||
121 | -#import <TXFFmpeg/libavformat/os_support.h> | ||
122 | -#import <TXFFmpeg/libavformat/avc.h> | ||
123 | -#import <TXFFmpeg/libavformat/url.h> |
This diff could not be displayed because it is too large.
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * AC-3 parser prototypes | ||
4 | - * Copyright (c) 2003 Fabrice Bellard | ||
5 | - * Copyright (c) 2003 Michael Niedermayer | ||
6 | - * | ||
7 | - * This file is part of FFmpeg. | ||
8 | - * | ||
9 | - * FFmpeg is free software; you can redistribute it and/or | ||
10 | - * modify it under the terms of the GNU Lesser General Public | ||
11 | - * License as published by the Free Software Foundation; either | ||
12 | - * version 2.1 of the License, or (at your option) any later version. | ||
13 | - * | ||
14 | - * FFmpeg is distributed in the hope that it will be useful, | ||
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | - * Lesser General Public License for more details. | ||
18 | - * | ||
19 | - * You should have received a copy of the GNU Lesser General Public | ||
20 | - * License along with FFmpeg; if not, write to the Free Software | ||
21 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | - */ | ||
23 | - | ||
24 | -#ifndef AVCODEC_AC3_PARSER_H | ||
25 | -#define AVCODEC_AC3_PARSER_H | ||
26 | - | ||
27 | -#include <stddef.h> | ||
28 | -#include <stdint.h> | ||
29 | - | ||
30 | -/** | ||
31 | - * Extract the bitstream ID and the frame size from AC-3 data. | ||
32 | - */ | ||
33 | -int liteav_av_ac3_parse_header(const uint8_t *buf, size_t size, | ||
34 | - uint8_t *bitstream_id, uint16_t *frame_size); | ||
35 | - | ||
36 | - | ||
37 | -#endif /* AVCODEC_AC3_PARSER_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -#ifndef AVCODEC_ADTS_PARSER_H | ||
21 | -#define AVCODEC_ADTS_PARSER_H | ||
22 | - | ||
23 | -#include <stddef.h> | ||
24 | -#include <stdint.h> | ||
25 | - | ||
26 | -#define AV_AAC_ADTS_HEADER_SIZE 7 | ||
27 | - | ||
28 | -/** | ||
29 | - * Extract the number of samples and frames from AAC data. | ||
30 | - * @param[in] buf pointer to AAC data buffer | ||
31 | - * @param[out] samples Pointer to where number of samples is written | ||
32 | - * @param[out] frames Pointer to where number of frames is written | ||
33 | - * @return Returns 0 on success, error code on failure. | ||
34 | - */ | ||
35 | -int liteav_av_adts_header_parse(const uint8_t *buf, uint32_t *samples, | ||
36 | - uint8_t *frames); | ||
37 | - | ||
38 | -#endif /* AVCODEC_ADTS_PARSER_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * SSA/ASS spliting functions | ||
4 | - * Copyright (c) 2010 Aurelien Jacobs <aurel@gnuage.org> | ||
5 | - * | ||
6 | - * This file is part of FFmpeg. | ||
7 | - * | ||
8 | - * FFmpeg is free software; you can redistribute it and/or | ||
9 | - * modify it under the terms of the GNU Lesser General Public | ||
10 | - * License as published by the Free Software Foundation; either | ||
11 | - * version 2.1 of the License, or (at your option) any later version. | ||
12 | - * | ||
13 | - * FFmpeg is distributed in the hope that it will be useful, | ||
14 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | - * Lesser General Public License for more details. | ||
17 | - * | ||
18 | - * You should have received a copy of the GNU Lesser General Public | ||
19 | - * License along with FFmpeg; if not, write to the Free Software | ||
20 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | - */ | ||
22 | - | ||
23 | -#ifndef AVCODEC_ASS_SPLIT_H | ||
24 | -#define AVCODEC_ASS_SPLIT_H | ||
25 | - | ||
26 | -/** | ||
27 | - * fields extracted from the [Script Info] section | ||
28 | - */ | ||
29 | -typedef struct { | ||
30 | - char *script_type; /**< SSA script format version (eg. v4.00) */ | ||
31 | - char *collisions; /**< how subtitles are moved to prevent collisions */ | ||
32 | - int play_res_x; /**< video width that ASS coords are referring to */ | ||
33 | - int play_res_y; /**< video height that ASS coords are referring to */ | ||
34 | - float timer; /**< time multiplier to apply to SSA clock (in %) */ | ||
35 | -} ASSScriptInfo; | ||
36 | - | ||
37 | -/** | ||
38 | - * fields extracted from the [V4(+) Styles] section | ||
39 | - */ | ||
40 | -typedef struct { | ||
41 | - char *name; /**< name of the tyle (case sensitive) */ | ||
42 | - char *font_name; /**< font face (case sensitive) */ | ||
43 | - int font_size; /**< font height */ | ||
44 | - int primary_color; /**< color that a subtitle will normally appear in */ | ||
45 | - int secondary_color; | ||
46 | - int outline_color; /**< color for outline in ASS, called tertiary in SSA */ | ||
47 | - int back_color; /**< color of the subtitle outline or shadow */ | ||
48 | - int bold; /**< whether text is bold (1) or not (0) */ | ||
49 | - int italic; /**< whether text is italic (1) or not (0) */ | ||
50 | - int underline; /**< whether text is underlined (1) or not (0) */ | ||
51 | - int strikeout; | ||
52 | - float scalex; | ||
53 | - float scaley; | ||
54 | - float spacing; | ||
55 | - float angle; | ||
56 | - int border_style; | ||
57 | - float outline; | ||
58 | - float shadow; | ||
59 | - int alignment; /**< position of the text (left, center, top...), | ||
60 | - defined after the layout of the numpad | ||
61 | - (1-3 sub, 4-6 mid, 7-9 top) */ | ||
62 | - int margin_l; | ||
63 | - int margin_r; | ||
64 | - int margin_v; | ||
65 | - int alpha_level; | ||
66 | - int encoding; | ||
67 | -} ASSStyle; | ||
68 | - | ||
69 | -/** | ||
70 | - * fields extracted from the [Events] section | ||
71 | - */ | ||
72 | -typedef struct { | ||
73 | - int readorder; | ||
74 | - int layer; /**< higher numbered layers are drawn over lower numbered */ | ||
75 | - int start; /**< start time of the dialog in centiseconds */ | ||
76 | - int end; /**< end time of the dialog in centiseconds */ | ||
77 | - char *style; /**< name of the ASSStyle to use with this dialog */ | ||
78 | - char *name; | ||
79 | - int margin_l; | ||
80 | - int margin_r; | ||
81 | - int margin_v; | ||
82 | - char *effect; | ||
83 | - char *text; /**< actual text which will be displayed as a subtitle, | ||
84 | - can include style override control codes (see | ||
85 | - liteav_ff_ass_split_override_codes()) */ | ||
86 | -} ASSDialog; | ||
87 | - | ||
88 | -/** | ||
89 | - * structure containing the whole split ASS data | ||
90 | - */ | ||
91 | -typedef struct { | ||
92 | - ASSScriptInfo script_info; /**< general information about the SSA script*/ | ||
93 | - ASSStyle *styles; /**< array of split out styles */ | ||
94 | - int styles_count; /**< number of ASSStyle in the styles array */ | ||
95 | - ASSDialog *dialogs; /**< array of split out dialogs */ | ||
96 | - int dialogs_count; /**< number of ASSDialog in the dialogs array*/ | ||
97 | -} ASS; | ||
98 | - | ||
99 | -typedef enum { | ||
100 | - ASS_STR, | ||
101 | - ASS_INT, | ||
102 | - ASS_FLT, | ||
103 | - ASS_COLOR, | ||
104 | - ASS_TIMESTAMP, | ||
105 | - ASS_ALGN, | ||
106 | -} ASSFieldType; | ||
107 | - | ||
108 | -typedef struct { | ||
109 | - const char *name; | ||
110 | - int type; | ||
111 | - int offset; | ||
112 | -} ASSFields; | ||
113 | - | ||
114 | -typedef struct { | ||
115 | - const char *section; | ||
116 | - const char *format_header; | ||
117 | - const char *fields_header; | ||
118 | - int size; | ||
119 | - int offset; | ||
120 | - int offset_count; | ||
121 | - ASSFields fields[24]; | ||
122 | -} ASSSection; | ||
123 | - | ||
124 | -static const ASSSection ass_sections[] = { | ||
125 | - { .section = "Script Info", | ||
126 | - .offset = offsetof(ASS, script_info), | ||
127 | - .fields = {{"ScriptType", ASS_STR, offsetof(ASSScriptInfo, script_type)}, | ||
128 | - {"Collisions", ASS_STR, offsetof(ASSScriptInfo, collisions) }, | ||
129 | - {"PlayResX", ASS_INT, offsetof(ASSScriptInfo, play_res_x) }, | ||
130 | - {"PlayResY", ASS_INT, offsetof(ASSScriptInfo, play_res_y) }, | ||
131 | - {"Timer", ASS_FLT, offsetof(ASSScriptInfo, timer) }, | ||
132 | - {0}, | ||
133 | - } | ||
134 | - }, | ||
135 | - { .section = "V4+ Styles", | ||
136 | - .format_header = "Format", | ||
137 | - .fields_header = "Style", | ||
138 | - .size = sizeof(ASSStyle), | ||
139 | - .offset = offsetof(ASS, styles), | ||
140 | - .offset_count = offsetof(ASS, styles_count), | ||
141 | - .fields = {{"Name", ASS_STR, offsetof(ASSStyle, name) }, | ||
142 | - {"Fontname", ASS_STR, offsetof(ASSStyle, font_name) }, | ||
143 | - {"Fontsize", ASS_INT, offsetof(ASSStyle, font_size) }, | ||
144 | - {"PrimaryColour", ASS_COLOR, offsetof(ASSStyle, primary_color) }, | ||
145 | - {"SecondaryColour", ASS_COLOR, offsetof(ASSStyle, secondary_color)}, | ||
146 | - {"OutlineColour", ASS_COLOR, offsetof(ASSStyle, outline_color) }, | ||
147 | - {"BackColour", ASS_COLOR, offsetof(ASSStyle, back_color) }, | ||
148 | - {"Bold", ASS_INT, offsetof(ASSStyle, bold) }, | ||
149 | - {"Italic", ASS_INT, offsetof(ASSStyle, italic) }, | ||
150 | - {"Underline", ASS_INT, offsetof(ASSStyle, underline) }, | ||
151 | - {"StrikeOut", ASS_INT, offsetof(ASSStyle, strikeout) }, | ||
152 | - {"ScaleX", ASS_FLT, offsetof(ASSStyle, scalex) }, | ||
153 | - {"ScaleY", ASS_FLT, offsetof(ASSStyle, scaley) }, | ||
154 | - {"Spacing", ASS_FLT, offsetof(ASSStyle, spacing) }, | ||
155 | - {"Angle", ASS_FLT, offsetof(ASSStyle, angle) }, | ||
156 | - {"BorderStyle", ASS_INT, offsetof(ASSStyle, border_style) }, | ||
157 | - {"Outline", ASS_FLT, offsetof(ASSStyle, outline) }, | ||
158 | - {"Shadow", ASS_FLT, offsetof(ASSStyle, shadow) }, | ||
159 | - {"Alignment", ASS_INT, offsetof(ASSStyle, alignment) }, | ||
160 | - {"MarginL", ASS_INT, offsetof(ASSStyle, margin_l) }, | ||
161 | - {"MarginR", ASS_INT, offsetof(ASSStyle, margin_r) }, | ||
162 | - {"MarginV", ASS_INT, offsetof(ASSStyle, margin_v) }, | ||
163 | - {"Encoding", ASS_INT, offsetof(ASSStyle, encoding) }, | ||
164 | - {0}, | ||
165 | - } | ||
166 | - }, | ||
167 | - { .section = "V4 Styles", | ||
168 | - .format_header = "Format", | ||
169 | - .fields_header = "Style", | ||
170 | - .size = sizeof(ASSStyle), | ||
171 | - .offset = offsetof(ASS, styles), | ||
172 | - .offset_count = offsetof(ASS, styles_count), | ||
173 | - .fields = {{"Name", ASS_STR, offsetof(ASSStyle, name) }, | ||
174 | - {"Fontname", ASS_STR, offsetof(ASSStyle, font_name) }, | ||
175 | - {"Fontsize", ASS_INT, offsetof(ASSStyle, font_size) }, | ||
176 | - {"PrimaryColour", ASS_COLOR, offsetof(ASSStyle, primary_color) }, | ||
177 | - {"SecondaryColour", ASS_COLOR, offsetof(ASSStyle, secondary_color)}, | ||
178 | - {"TertiaryColour", ASS_COLOR, offsetof(ASSStyle, outline_color) }, | ||
179 | - {"BackColour", ASS_COLOR, offsetof(ASSStyle, back_color) }, | ||
180 | - {"Bold", ASS_INT, offsetof(ASSStyle, bold) }, | ||
181 | - {"Italic", ASS_INT, offsetof(ASSStyle, italic) }, | ||
182 | - {"BorderStyle", ASS_INT, offsetof(ASSStyle, border_style) }, | ||
183 | - {"Outline", ASS_FLT, offsetof(ASSStyle, outline) }, | ||
184 | - {"Shadow", ASS_FLT, offsetof(ASSStyle, shadow) }, | ||
185 | - {"Alignment", ASS_ALGN, offsetof(ASSStyle, alignment) }, | ||
186 | - {"MarginL", ASS_INT, offsetof(ASSStyle, margin_l) }, | ||
187 | - {"MarginR", ASS_INT, offsetof(ASSStyle, margin_r) }, | ||
188 | - {"MarginV", ASS_INT, offsetof(ASSStyle, margin_v) }, | ||
189 | - {"AlphaLevel", ASS_INT, offsetof(ASSStyle, alpha_level) }, | ||
190 | - {"Encoding", ASS_INT, offsetof(ASSStyle, encoding) }, | ||
191 | - {0}, | ||
192 | - } | ||
193 | - }, | ||
194 | - { .section = "Events", | ||
195 | - .format_header = "Format", | ||
196 | - .fields_header = "Dialogue", | ||
197 | - .size = sizeof(ASSDialog), | ||
198 | - .offset = offsetof(ASS, dialogs), | ||
199 | - .offset_count = offsetof(ASS, dialogs_count), | ||
200 | - .fields = {{"Layer", ASS_INT, offsetof(ASSDialog, layer) }, | ||
201 | - {"Start", ASS_TIMESTAMP, offsetof(ASSDialog, start) }, | ||
202 | - {"End", ASS_TIMESTAMP, offsetof(ASSDialog, end) }, | ||
203 | - {"Style", ASS_STR, offsetof(ASSDialog, style) }, | ||
204 | - {"Name", ASS_STR, offsetof(ASSDialog, name) }, | ||
205 | - {"MarginL", ASS_INT, offsetof(ASSDialog, margin_l)}, | ||
206 | - {"MarginR", ASS_INT, offsetof(ASSDialog, margin_r)}, | ||
207 | - {"MarginV", ASS_INT, offsetof(ASSDialog, margin_v)}, | ||
208 | - {"Effect", ASS_STR, offsetof(ASSDialog, effect) }, | ||
209 | - {"Text", ASS_STR, offsetof(ASSDialog, text) }, | ||
210 | - {0}, | ||
211 | - } | ||
212 | - }, | ||
213 | -}; | ||
214 | - | ||
215 | -struct ASSSplitContext { | ||
216 | - ASS ass; | ||
217 | - int current_section; | ||
218 | - int field_number[FF_ARRAY_ELEMS(ass_sections)]; | ||
219 | - int *field_order[FF_ARRAY_ELEMS(ass_sections)]; | ||
220 | -}; | ||
221 | - | ||
222 | -/** | ||
223 | - * This struct can be casted to ASS to access to the split data. | ||
224 | - */ | ||
225 | -typedef struct ASSSplitContext ASSSplitContext; | ||
226 | - | ||
227 | -/** | ||
228 | - * Split a full ASS file or a ASS header from a string buffer and store | ||
229 | - * the split structure in a newly allocated context. | ||
230 | - * | ||
231 | - * @param buf String containing the ASS formatted data. | ||
232 | - * @return Newly allocated struct containing split data. | ||
233 | - */ | ||
234 | -ASSSplitContext *liteav_ff_ass_split(const char *buf); | ||
235 | - | ||
236 | -/** | ||
237 | - * Split one or several ASS "Dialogue" lines from a string buffer and store | ||
238 | - * them in an already initialized context. | ||
239 | - * | ||
240 | - * @param ctx Context previously initialized by liteav_ff_ass_split(). | ||
241 | - * @param buf String containing the ASS "Dialogue" lines. | ||
242 | - * @param cache Set to 1 to keep all the previously split ASSDialog in | ||
243 | - * the context, or set to 0 to free all the previously split | ||
244 | - * ASSDialog. | ||
245 | - * @param number If not NULL, the pointed integer will be set to the number | ||
246 | - * of split ASSDialog. | ||
247 | - * @return Pointer to the first split ASSDialog. | ||
248 | - */ | ||
249 | -ASSDialog *liteav_ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf, | ||
250 | - int cache, int *number); | ||
251 | - | ||
252 | -/** | ||
253 | - * Free a dialogue obtained from liteav_ff_ass_split_dialog2(). | ||
254 | - */ | ||
255 | -void liteav_ff_ass_free_dialog(ASSDialog **dialogp); | ||
256 | - | ||
257 | -/** | ||
258 | - * Split one ASS Dialogue line from a string buffer. | ||
259 | - * | ||
260 | - * @param ctx Context previously initialized by liteav_ff_ass_split(). | ||
261 | - * @param buf String containing the ASS "Dialogue" line. | ||
262 | - * @return Pointer to the split ASSDialog. Must be freed with liteav_ff_ass_free_dialog() | ||
263 | - */ | ||
264 | -ASSDialog *liteav_ff_ass_split_dialog2(ASSSplitContext *ctx, const char *buf); | ||
265 | - | ||
266 | -/** | ||
267 | - * Free all the memory allocated for an ASSSplitContext. | ||
268 | - * | ||
269 | - * @param ctx Context previously initialized by liteav_ff_ass_split(). | ||
270 | - */ | ||
271 | -void liteav_ff_ass_split_free(ASSSplitContext *ctx); | ||
272 | - | ||
273 | - | ||
274 | -/** | ||
275 | - * Set of callback functions corresponding to each override codes that can | ||
276 | - * be encountered in a "Dialogue" Text field. | ||
277 | - */ | ||
278 | -typedef struct { | ||
279 | - /** | ||
280 | - * @defgroup ass_styles ASS styles | ||
281 | - * @{ | ||
282 | - */ | ||
283 | - void (*text)(void *priv, const char *text, int len); | ||
284 | - void (*new_line)(void *priv, int forced); | ||
285 | - void (*style)(void *priv, char style, int close); | ||
286 | - void (*color)(void *priv, unsigned int /* color */, unsigned int color_id); | ||
287 | - void (*alpha)(void *priv, int alpha, int alpha_id); | ||
288 | - void (*font_name)(void *priv, const char *name); | ||
289 | - void (*font_size)(void *priv, int size); | ||
290 | - void (*alignment)(void *priv, int alignment); | ||
291 | - void (*cancel_overrides)(void *priv, const char *style); | ||
292 | - /** @} */ | ||
293 | - | ||
294 | - /** | ||
295 | - * @defgroup ass_functions ASS functions | ||
296 | - * @{ | ||
297 | - */ | ||
298 | - void (*move)(void *priv, int x1, int y1, int x2, int y2, int t1, int t2); | ||
299 | - void (*origin)(void *priv, int x, int y); | ||
300 | - /** @} */ | ||
301 | - | ||
302 | - /** | ||
303 | - * @defgroup ass_end end of Dialogue Event | ||
304 | - * @{ | ||
305 | - */ | ||
306 | - void (*end)(void *priv); | ||
307 | - /** @} */ | ||
308 | -} ASSCodesCallbacks; | ||
309 | - | ||
310 | -/** | ||
311 | - * Split override codes out of a ASS "Dialogue" Text field. | ||
312 | - * | ||
313 | - * @param callbacks Set of callback functions called for each override code | ||
314 | - * encountered. | ||
315 | - * @param priv Opaque pointer passed to the callback functions. | ||
316 | - * @param buf The ASS "Dialogue" Text field to split. | ||
317 | - * @return >= 0 on success otherwise an error code <0 | ||
318 | - */ | ||
319 | -int liteav_ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv, | ||
320 | - const char *buf); | ||
321 | - | ||
322 | -/** | ||
323 | - * Find an ASSStyle structure by its name. | ||
324 | - * | ||
325 | - * @param ctx Context previously initialized by liteav_ff_ass_split(). | ||
326 | - * @param style name of the style to search for. | ||
327 | - * @return the ASSStyle corresponding to style, or NULL if style can't be found | ||
328 | - */ | ||
329 | -ASSStyle *liteav_ff_ass_style_get(ASSSplitContext *ctx, const char *style); | ||
330 | - | ||
331 | -#endif /* AVCODEC_ASS_SPLIT_H */ |
This diff could not be displayed because it is too large.
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -#ifndef AVCODEC_AVDCT_H | ||
21 | -#define AVCODEC_AVDCT_H | ||
22 | - | ||
23 | -#include "libavutil/opt.h" | ||
24 | - | ||
25 | -/** | ||
26 | - * AVDCT context. | ||
27 | - * @note function pointers can be NULL if the specific features have been | ||
28 | - * disabled at build time. | ||
29 | - */ | ||
30 | -typedef struct AVDCT { | ||
31 | - const AVClass *av_class; | ||
32 | - | ||
33 | - void (*idct)(int16_t *block /* align 16 */); | ||
34 | - | ||
35 | - /** | ||
36 | - * IDCT input permutation. | ||
37 | - * Several optimized IDCTs need a permutated input (relative to the | ||
38 | - * normal order of the reference IDCT). | ||
39 | - * This permutation must be performed before the idct_put/add. | ||
40 | - * Note, normally this can be merged with the zigzag/alternate scan<br> | ||
41 | - * An example to avoid confusion: | ||
42 | - * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...) | ||
43 | - * - (x -> reference DCT -> reference IDCT -> x) | ||
44 | - * - (x -> reference DCT -> simple_mmx_perm = idct_permutation | ||
45 | - * -> simple_idct_mmx -> x) | ||
46 | - * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant | ||
47 | - * -> simple_idct_mmx -> ...) | ||
48 | - */ | ||
49 | - uint8_t idct_permutation[64]; | ||
50 | - | ||
51 | - void (*fdct)(int16_t *block /* align 16 */); | ||
52 | - | ||
53 | - | ||
54 | - /** | ||
55 | - * DCT algorithm. | ||
56 | - * must use AVOptions to set this field. | ||
57 | - */ | ||
58 | - int dct_algo; | ||
59 | - | ||
60 | - /** | ||
61 | - * IDCT algorithm. | ||
62 | - * must use AVOptions to set this field. | ||
63 | - */ | ||
64 | - int idct_algo; | ||
65 | - | ||
66 | - void (*get_pixels)(int16_t *block /* align 16 */, | ||
67 | - const uint8_t *pixels /* align 8 */, | ||
68 | - ptrdiff_t line_size); | ||
69 | - | ||
70 | - int bits_per_sample; | ||
71 | -} AVDCT; | ||
72 | - | ||
73 | -/** | ||
74 | - * Allocates a AVDCT context. | ||
75 | - * This needs to be initialized with liteav_avcodec_dct_init() after optionally | ||
76 | - * configuring it with AVOptions. | ||
77 | - * | ||
78 | - * To free it use liteav_av_free() | ||
79 | - */ | ||
80 | -AVDCT *liteav_avcodec_dct_alloc(void); | ||
81 | -int liteav_avcodec_dct_init(AVDCT *); | ||
82 | - | ||
83 | -const AVClass *liteav_avcodec_dct_get_class(void); | ||
84 | - | ||
85 | -#endif /* AVCODEC_AVDCT_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -#ifndef AVCODEC_AVFFT_H | ||
21 | -#define AVCODEC_AVFFT_H | ||
22 | - | ||
23 | -/** | ||
24 | - * @file | ||
25 | - * @ingroup lavc_fft | ||
26 | - * FFT functions | ||
27 | - */ | ||
28 | - | ||
29 | -/** | ||
30 | - * @defgroup lavc_fft FFT functions | ||
31 | - * @ingroup lavc_misc | ||
32 | - * | ||
33 | - * @{ | ||
34 | - */ | ||
35 | - | ||
36 | -typedef float FFTSample; | ||
37 | - | ||
38 | -typedef struct FFTComplex { | ||
39 | - FFTSample re, im; | ||
40 | -} FFTComplex; | ||
41 | - | ||
42 | -typedef struct FFTContext FFTContext; | ||
43 | - | ||
44 | -/** | ||
45 | - * Set up a complex FFT. | ||
46 | - * @param nbits log2 of the length of the input array | ||
47 | - * @param inverse if 0 perform the forward transform, if 1 perform the inverse | ||
48 | - */ | ||
49 | -FFTContext *liteav_av_fft_init(int nbits, int inverse); | ||
50 | - | ||
51 | -/** | ||
52 | - * Do the permutation needed BEFORE calling liteav_ff_fft_calc(). | ||
53 | - */ | ||
54 | -void liteav_av_fft_permute(FFTContext *s, FFTComplex *z); | ||
55 | - | ||
56 | -/** | ||
57 | - * Do a complex FFT with the parameters defined in liteav_av_fft_init(). The | ||
58 | - * input data must be permuted before. No 1.0/sqrt(n) normalization is done. | ||
59 | - */ | ||
60 | -void liteav_av_fft_calc(FFTContext *s, FFTComplex *z); | ||
61 | - | ||
62 | -void liteav_av_fft_end(FFTContext *s); | ||
63 | - | ||
64 | -FFTContext *liteav_av_mdct_init(int nbits, int inverse, double scale); | ||
65 | -void liteav_av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); | ||
66 | -void liteav_av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); | ||
67 | -void liteav_av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); | ||
68 | -void liteav_av_mdct_end(FFTContext *s); | ||
69 | - | ||
70 | -/* Real Discrete Fourier Transform */ | ||
71 | - | ||
72 | -enum RDFTransformType { | ||
73 | - DFT_R2C, | ||
74 | - IDFT_C2R, | ||
75 | - IDFT_R2C, | ||
76 | - DFT_C2R, | ||
77 | -}; | ||
78 | - | ||
79 | -typedef struct RDFTContext RDFTContext; | ||
80 | - | ||
81 | -/** | ||
82 | - * Set up a real FFT. | ||
83 | - * @param nbits log2 of the length of the input array | ||
84 | - * @param trans the type of transform | ||
85 | - */ | ||
86 | -RDFTContext *liteav_av_rdft_init(int nbits, enum RDFTransformType trans); | ||
87 | -void liteav_av_rdft_calc(RDFTContext *s, FFTSample *data); | ||
88 | -void liteav_av_rdft_end(RDFTContext *s); | ||
89 | - | ||
90 | -/* Discrete Cosine Transform */ | ||
91 | - | ||
92 | -typedef struct DCTContext DCTContext; | ||
93 | - | ||
94 | -enum DCTTransformType { | ||
95 | - DCT_II = 0, | ||
96 | - DCT_III, | ||
97 | - DCT_I, | ||
98 | - DST_I, | ||
99 | -}; | ||
100 | - | ||
101 | -/** | ||
102 | - * Set up DCT. | ||
103 | - * | ||
104 | - * @param nbits size of the input array: | ||
105 | - * (1 << nbits) for DCT-II, DCT-III and DST-I | ||
106 | - * (1 << nbits) + 1 for DCT-I | ||
107 | - * @param type the type of transform | ||
108 | - * | ||
109 | - * @note the first element of the input of DST-I is ignored | ||
110 | - */ | ||
111 | -DCTContext *liteav_av_dct_init(int nbits, enum DCTTransformType type); | ||
112 | -void liteav_av_dct_calc(DCTContext *s, FFTSample *data); | ||
113 | -void liteav_av_dct_end (DCTContext *s); | ||
114 | - | ||
115 | -/** | ||
116 | - * @} | ||
117 | - */ | ||
118 | - | ||
119 | -#endif /* AVCODEC_AVFFT_H */ |
1 | -/* | ||
2 | - * Bytestream functions | ||
3 | - * copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@free.fr> | ||
4 | - * Copyright (c) 2012 Aneesh Dogra (lionaneesh) <lionaneesh@gmail.com> | ||
5 | - * | ||
6 | - * This file is part of FFmpeg. | ||
7 | - * | ||
8 | - * FFmpeg is free software; you can redistribute it and/or | ||
9 | - * modify it under the terms of the GNU Lesser General Public | ||
10 | - * License as published by the Free Software Foundation; either | ||
11 | - * version 2.1 of the License, or (at your option) any later version. | ||
12 | - * | ||
13 | - * FFmpeg is distributed in the hope that it will be useful, | ||
14 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | - * Lesser General Public License for more details. | ||
17 | - * | ||
18 | - * You should have received a copy of the GNU Lesser General Public | ||
19 | - * License along with FFmpeg; if not, write to the Free Software | ||
20 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | - */ | ||
22 | - | ||
23 | -#ifndef AVCODEC_BYTESTREAM_H | ||
24 | -#define AVCODEC_BYTESTREAM_H | ||
25 | - | ||
26 | -#include <stdint.h> | ||
27 | -#include <string.h> | ||
28 | - | ||
29 | -#include "libavutil/avassert.h" | ||
30 | -#include "libavutil/common.h" | ||
31 | -#include "libavutil/intreadwrite.h" | ||
32 | - | ||
33 | -typedef struct GetByteContext { | ||
34 | - const uint8_t *buffer, *buffer_end, *buffer_start; | ||
35 | -} GetByteContext; | ||
36 | - | ||
37 | -typedef struct PutByteContext { | ||
38 | - uint8_t *buffer, *buffer_end, *buffer_start; | ||
39 | - int eof; | ||
40 | -} PutByteContext; | ||
41 | - | ||
42 | -#define DEF(type, name, bytes, read, write) \ | ||
43 | -static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \ | ||
44 | -{ \ | ||
45 | - (*b) += bytes; \ | ||
46 | - return read(*b - bytes); \ | ||
47 | -} \ | ||
48 | -static av_always_inline void bytestream_put_ ## name(uint8_t **b, \ | ||
49 | - const type value) \ | ||
50 | -{ \ | ||
51 | - write(*b, value); \ | ||
52 | - (*b) += bytes; \ | ||
53 | -} \ | ||
54 | -static av_always_inline void bytestream2_put_ ## name ## u(PutByteContext *p, \ | ||
55 | - const type value) \ | ||
56 | -{ \ | ||
57 | - bytestream_put_ ## name(&p->buffer, value); \ | ||
58 | -} \ | ||
59 | -static av_always_inline void bytestream2_put_ ## name(PutByteContext *p, \ | ||
60 | - const type value) \ | ||
61 | -{ \ | ||
62 | - if (!p->eof && (p->buffer_end - p->buffer >= bytes)) { \ | ||
63 | - write(p->buffer, value); \ | ||
64 | - p->buffer += bytes; \ | ||
65 | - } else \ | ||
66 | - p->eof = 1; \ | ||
67 | -} \ | ||
68 | -static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \ | ||
69 | -{ \ | ||
70 | - return bytestream_get_ ## name(&g->buffer); \ | ||
71 | -} \ | ||
72 | -static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \ | ||
73 | -{ \ | ||
74 | - if (g->buffer_end - g->buffer < bytes) { \ | ||
75 | - g->buffer = g->buffer_end; \ | ||
76 | - return 0; \ | ||
77 | - } \ | ||
78 | - return bytestream2_get_ ## name ## u(g); \ | ||
79 | -} \ | ||
80 | -static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ | ||
81 | -{ \ | ||
82 | - if (g->buffer_end - g->buffer < bytes) \ | ||
83 | - return 0; \ | ||
84 | - return read(g->buffer); \ | ||
85 | -} | ||
86 | - | ||
87 | -DEF(uint64_t, le64, 8, AV_RL64, AV_WL64) | ||
88 | -DEF(unsigned int, le32, 4, AV_RL32, AV_WL32) | ||
89 | -DEF(unsigned int, le24, 3, AV_RL24, AV_WL24) | ||
90 | -DEF(unsigned int, le16, 2, AV_RL16, AV_WL16) | ||
91 | -DEF(uint64_t, be64, 8, AV_RB64, AV_WB64) | ||
92 | -DEF(unsigned int, be32, 4, AV_RB32, AV_WB32) | ||
93 | -DEF(unsigned int, be24, 3, AV_RB24, AV_WB24) | ||
94 | -DEF(unsigned int, be16, 2, AV_RB16, AV_WB16) | ||
95 | -DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8) | ||
96 | - | ||
97 | -#if AV_HAVE_BIGENDIAN | ||
98 | -# define bytestream2_get_ne16 bytestream2_get_be16 | ||
99 | -# define bytestream2_get_ne24 bytestream2_get_be24 | ||
100 | -# define bytestream2_get_ne32 bytestream2_get_be32 | ||
101 | -# define bytestream2_get_ne64 bytestream2_get_be64 | ||
102 | -# define bytestream2_get_ne16u bytestream2_get_be16u | ||
103 | -# define bytestream2_get_ne24u bytestream2_get_be24u | ||
104 | -# define bytestream2_get_ne32u bytestream2_get_be32u | ||
105 | -# define bytestream2_get_ne64u bytestream2_get_be64u | ||
106 | -# define bytestream2_put_ne16 bytestream2_put_be16 | ||
107 | -# define bytestream2_put_ne24 bytestream2_put_be24 | ||
108 | -# define bytestream2_put_ne32 bytestream2_put_be32 | ||
109 | -# define bytestream2_put_ne64 bytestream2_put_be64 | ||
110 | -# define bytestream2_peek_ne16 bytestream2_peek_be16 | ||
111 | -# define bytestream2_peek_ne24 bytestream2_peek_be24 | ||
112 | -# define bytestream2_peek_ne32 bytestream2_peek_be32 | ||
113 | -# define bytestream2_peek_ne64 bytestream2_peek_be64 | ||
114 | -#else | ||
115 | -# define bytestream2_get_ne16 bytestream2_get_le16 | ||
116 | -# define bytestream2_get_ne24 bytestream2_get_le24 | ||
117 | -# define bytestream2_get_ne32 bytestream2_get_le32 | ||
118 | -# define bytestream2_get_ne64 bytestream2_get_le64 | ||
119 | -# define bytestream2_get_ne16u bytestream2_get_le16u | ||
120 | -# define bytestream2_get_ne24u bytestream2_get_le24u | ||
121 | -# define bytestream2_get_ne32u bytestream2_get_le32u | ||
122 | -# define bytestream2_get_ne64u bytestream2_get_le64u | ||
123 | -# define bytestream2_put_ne16 bytestream2_put_le16 | ||
124 | -# define bytestream2_put_ne24 bytestream2_put_le24 | ||
125 | -# define bytestream2_put_ne32 bytestream2_put_le32 | ||
126 | -# define bytestream2_put_ne64 bytestream2_put_le64 | ||
127 | -# define bytestream2_peek_ne16 bytestream2_peek_le16 | ||
128 | -# define bytestream2_peek_ne24 bytestream2_peek_le24 | ||
129 | -# define bytestream2_peek_ne32 bytestream2_peek_le32 | ||
130 | -# define bytestream2_peek_ne64 bytestream2_peek_le64 | ||
131 | -#endif | ||
132 | - | ||
133 | -static av_always_inline void bytestream2_init(GetByteContext *g, | ||
134 | - const uint8_t *buf, | ||
135 | - int buf_size) | ||
136 | -{ | ||
137 | - av_assert0(buf_size >= 0); | ||
138 | - g->buffer = buf; | ||
139 | - g->buffer_start = buf; | ||
140 | - g->buffer_end = buf + buf_size; | ||
141 | -} | ||
142 | - | ||
143 | -static av_always_inline void bytestream2_init_writer(PutByteContext *p, | ||
144 | - uint8_t *buf, | ||
145 | - int buf_size) | ||
146 | -{ | ||
147 | - av_assert0(buf_size >= 0); | ||
148 | - p->buffer = buf; | ||
149 | - p->buffer_start = buf; | ||
150 | - p->buffer_end = buf + buf_size; | ||
151 | - p->eof = 0; | ||
152 | -} | ||
153 | - | ||
154 | -static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g) | ||
155 | -{ | ||
156 | - return g->buffer_end - g->buffer; | ||
157 | -} | ||
158 | - | ||
159 | -static av_always_inline unsigned int bytestream2_get_bytes_left_p(PutByteContext *p) | ||
160 | -{ | ||
161 | - return p->buffer_end - p->buffer; | ||
162 | -} | ||
163 | - | ||
164 | -static av_always_inline void bytestream2_skip(GetByteContext *g, | ||
165 | - unsigned int size) | ||
166 | -{ | ||
167 | - g->buffer += FFMIN(g->buffer_end - g->buffer, size); | ||
168 | -} | ||
169 | - | ||
170 | -static av_always_inline void bytestream2_skipu(GetByteContext *g, | ||
171 | - unsigned int size) | ||
172 | -{ | ||
173 | - g->buffer += size; | ||
174 | -} | ||
175 | - | ||
176 | -static av_always_inline void bytestream2_skip_p(PutByteContext *p, | ||
177 | - unsigned int size) | ||
178 | -{ | ||
179 | - int size2; | ||
180 | - if (p->eof) | ||
181 | - return; | ||
182 | - size2 = FFMIN(p->buffer_end - p->buffer, size); | ||
183 | - if (size2 != size) | ||
184 | - p->eof = 1; | ||
185 | - p->buffer += size2; | ||
186 | -} | ||
187 | - | ||
188 | -static av_always_inline int bytestream2_tell(GetByteContext *g) | ||
189 | -{ | ||
190 | - return (int)(g->buffer - g->buffer_start); | ||
191 | -} | ||
192 | - | ||
193 | -static av_always_inline int bytestream2_tell_p(PutByteContext *p) | ||
194 | -{ | ||
195 | - return (int)(p->buffer - p->buffer_start); | ||
196 | -} | ||
197 | - | ||
198 | -static av_always_inline int bytestream2_size(GetByteContext *g) | ||
199 | -{ | ||
200 | - return (int)(g->buffer_end - g->buffer_start); | ||
201 | -} | ||
202 | - | ||
203 | -static av_always_inline int bytestream2_size_p(PutByteContext *p) | ||
204 | -{ | ||
205 | - return (int)(p->buffer_end - p->buffer_start); | ||
206 | -} | ||
207 | - | ||
208 | -static av_always_inline int bytestream2_seek(GetByteContext *g, | ||
209 | - int offset, | ||
210 | - int whence) | ||
211 | -{ | ||
212 | - switch (whence) { | ||
213 | - case SEEK_CUR: | ||
214 | - offset = av_clip(offset, -(g->buffer - g->buffer_start), | ||
215 | - g->buffer_end - g->buffer); | ||
216 | - g->buffer += offset; | ||
217 | - break; | ||
218 | - case SEEK_END: | ||
219 | - offset = av_clip(offset, -(g->buffer_end - g->buffer_start), 0); | ||
220 | - g->buffer = g->buffer_end + offset; | ||
221 | - break; | ||
222 | - case SEEK_SET: | ||
223 | - offset = av_clip(offset, 0, g->buffer_end - g->buffer_start); | ||
224 | - g->buffer = g->buffer_start + offset; | ||
225 | - break; | ||
226 | - default: | ||
227 | - return AVERROR(EINVAL); | ||
228 | - } | ||
229 | - return bytestream2_tell(g); | ||
230 | -} | ||
231 | - | ||
232 | -static av_always_inline int bytestream2_seek_p(PutByteContext *p, | ||
233 | - int offset, | ||
234 | - int whence) | ||
235 | -{ | ||
236 | - p->eof = 0; | ||
237 | - switch (whence) { | ||
238 | - case SEEK_CUR: | ||
239 | - if (p->buffer_end - p->buffer < offset) | ||
240 | - p->eof = 1; | ||
241 | - offset = av_clip(offset, -(p->buffer - p->buffer_start), | ||
242 | - p->buffer_end - p->buffer); | ||
243 | - p->buffer += offset; | ||
244 | - break; | ||
245 | - case SEEK_END: | ||
246 | - if (offset > 0) | ||
247 | - p->eof = 1; | ||
248 | - offset = av_clip(offset, -(p->buffer_end - p->buffer_start), 0); | ||
249 | - p->buffer = p->buffer_end + offset; | ||
250 | - break; | ||
251 | - case SEEK_SET: | ||
252 | - if (p->buffer_end - p->buffer_start < offset) | ||
253 | - p->eof = 1; | ||
254 | - offset = av_clip(offset, 0, p->buffer_end - p->buffer_start); | ||
255 | - p->buffer = p->buffer_start + offset; | ||
256 | - break; | ||
257 | - default: | ||
258 | - return AVERROR(EINVAL); | ||
259 | - } | ||
260 | - return bytestream2_tell_p(p); | ||
261 | -} | ||
262 | - | ||
263 | -static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, | ||
264 | - uint8_t *dst, | ||
265 | - unsigned int size) | ||
266 | -{ | ||
267 | - int size2 = FFMIN(g->buffer_end - g->buffer, size); | ||
268 | - memcpy(dst, g->buffer, size2); | ||
269 | - g->buffer += size2; | ||
270 | - return size2; | ||
271 | -} | ||
272 | - | ||
273 | -static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, | ||
274 | - uint8_t *dst, | ||
275 | - unsigned int size) | ||
276 | -{ | ||
277 | - memcpy(dst, g->buffer, size); | ||
278 | - g->buffer += size; | ||
279 | - return size; | ||
280 | -} | ||
281 | - | ||
282 | -static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p, | ||
283 | - const uint8_t *src, | ||
284 | - unsigned int size) | ||
285 | -{ | ||
286 | - int size2; | ||
287 | - if (p->eof) | ||
288 | - return 0; | ||
289 | - size2 = FFMIN(p->buffer_end - p->buffer, size); | ||
290 | - if (size2 != size) | ||
291 | - p->eof = 1; | ||
292 | - memcpy(p->buffer, src, size2); | ||
293 | - p->buffer += size2; | ||
294 | - return size2; | ||
295 | -} | ||
296 | - | ||
297 | -static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p, | ||
298 | - const uint8_t *src, | ||
299 | - unsigned int size) | ||
300 | -{ | ||
301 | - memcpy(p->buffer, src, size); | ||
302 | - p->buffer += size; | ||
303 | - return size; | ||
304 | -} | ||
305 | - | ||
306 | -static av_always_inline void bytestream2_set_buffer(PutByteContext *p, | ||
307 | - const uint8_t c, | ||
308 | - unsigned int size) | ||
309 | -{ | ||
310 | - int size2; | ||
311 | - if (p->eof) | ||
312 | - return; | ||
313 | - size2 = FFMIN(p->buffer_end - p->buffer, size); | ||
314 | - if (size2 != size) | ||
315 | - p->eof = 1; | ||
316 | - memset(p->buffer, c, size2); | ||
317 | - p->buffer += size2; | ||
318 | -} | ||
319 | - | ||
320 | -static av_always_inline void bytestream2_set_bufferu(PutByteContext *p, | ||
321 | - const uint8_t c, | ||
322 | - unsigned int size) | ||
323 | -{ | ||
324 | - memset(p->buffer, c, size); | ||
325 | - p->buffer += size; | ||
326 | -} | ||
327 | - | ||
328 | -static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p) | ||
329 | -{ | ||
330 | - return p->eof; | ||
331 | -} | ||
332 | - | ||
333 | -static av_always_inline unsigned int bytestream2_copy_bufferu(PutByteContext *p, | ||
334 | - GetByteContext *g, | ||
335 | - unsigned int size) | ||
336 | -{ | ||
337 | - memcpy(p->buffer, g->buffer, size); | ||
338 | - p->buffer += size; | ||
339 | - g->buffer += size; | ||
340 | - return size; | ||
341 | -} | ||
342 | - | ||
343 | -static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p, | ||
344 | - GetByteContext *g, | ||
345 | - unsigned int size) | ||
346 | -{ | ||
347 | - int size2; | ||
348 | - | ||
349 | - if (p->eof) | ||
350 | - return 0; | ||
351 | - size = FFMIN(g->buffer_end - g->buffer, size); | ||
352 | - size2 = FFMIN(p->buffer_end - p->buffer, size); | ||
353 | - if (size2 != size) | ||
354 | - p->eof = 1; | ||
355 | - | ||
356 | - return bytestream2_copy_bufferu(p, g, size2); | ||
357 | -} | ||
358 | - | ||
359 | -static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, | ||
360 | - uint8_t *dst, | ||
361 | - unsigned int size) | ||
362 | -{ | ||
363 | - memcpy(dst, *b, size); | ||
364 | - (*b) += size; | ||
365 | - return size; | ||
366 | -} | ||
367 | - | ||
368 | -static av_always_inline void bytestream_put_buffer(uint8_t **b, | ||
369 | - const uint8_t *src, | ||
370 | - unsigned int size) | ||
371 | -{ | ||
372 | - memcpy(*b, src, size); | ||
373 | - (*b) += size; | ||
374 | -} | ||
375 | - | ||
376 | -#endif /* AVCODEC_BYTESTREAM_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * Direct3D11 HW acceleration | ||
4 | - * | ||
5 | - * copyright (c) 2009 Laurent Aimar | ||
6 | - * copyright (c) 2015 Steve Lhomme | ||
7 | - * | ||
8 | - * This file is part of FFmpeg. | ||
9 | - * | ||
10 | - * FFmpeg is free software; you can redistribute it and/or | ||
11 | - * modify it under the terms of the GNU Lesser General Public | ||
12 | - * License as published by the Free Software Foundation; either | ||
13 | - * version 2.1 of the License, or (at your option) any later version. | ||
14 | - * | ||
15 | - * FFmpeg is distributed in the hope that it will be useful, | ||
16 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | - * Lesser General Public License for more details. | ||
19 | - * | ||
20 | - * You should have received a copy of the GNU Lesser General Public | ||
21 | - * License along with FFmpeg; if not, write to the Free Software | ||
22 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
23 | - */ | ||
24 | - | ||
25 | -#ifndef AVCODEC_D3D11VA_H | ||
26 | -#define AVCODEC_D3D11VA_H | ||
27 | - | ||
28 | -/** | ||
29 | - * @file | ||
30 | - * @ingroup lavc_codec_hwaccel_d3d11va | ||
31 | - * Public libavcodec D3D11VA header. | ||
32 | - */ | ||
33 | - | ||
34 | -#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 | ||
35 | -#undef _WIN32_WINNT | ||
36 | -#define _WIN32_WINNT 0x0602 | ||
37 | -#endif | ||
38 | - | ||
39 | -#include <stdint.h> | ||
40 | -#include <d3d11.h> | ||
41 | - | ||
42 | -/** | ||
43 | - * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11 | ||
44 | - * @ingroup lavc_codec_hwaccel | ||
45 | - * | ||
46 | - * @{ | ||
47 | - */ | ||
48 | - | ||
49 | -#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards | ||
50 | -#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface | ||
51 | - | ||
52 | -/** | ||
53 | - * This structure is used to provides the necessary configurations and data | ||
54 | - * to the Direct3D11 FFmpeg HWAccel implementation. | ||
55 | - * | ||
56 | - * The application must make it available as AVCodecContext.hwaccel_context. | ||
57 | - * | ||
58 | - * Use liteav_av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext. | ||
59 | - */ | ||
60 | -typedef struct AVD3D11VAContext { | ||
61 | - /** | ||
62 | - * D3D11 decoder object | ||
63 | - */ | ||
64 | - ID3D11VideoDecoder *decoder; | ||
65 | - | ||
66 | - /** | ||
67 | - * D3D11 VideoContext | ||
68 | - */ | ||
69 | - ID3D11VideoContext *video_context; | ||
70 | - | ||
71 | - /** | ||
72 | - * D3D11 configuration used to create the decoder | ||
73 | - */ | ||
74 | - D3D11_VIDEO_DECODER_CONFIG *cfg; | ||
75 | - | ||
76 | - /** | ||
77 | - * The number of surface in the surface array | ||
78 | - */ | ||
79 | - unsigned surface_count; | ||
80 | - | ||
81 | - /** | ||
82 | - * The array of Direct3D surfaces used to create the decoder | ||
83 | - */ | ||
84 | - ID3D11VideoDecoderOutputView **surface; | ||
85 | - | ||
86 | - /** | ||
87 | - * A bit field configuring the workarounds needed for using the decoder | ||
88 | - */ | ||
89 | - uint64_t workaround; | ||
90 | - | ||
91 | - /** | ||
92 | - * Private to the FFmpeg AVHWAccel implementation | ||
93 | - */ | ||
94 | - unsigned report_id; | ||
95 | - | ||
96 | - /** | ||
97 | - * Mutex to access video_context | ||
98 | - */ | ||
99 | - HANDLE context_mutex; | ||
100 | -} AVD3D11VAContext; | ||
101 | - | ||
102 | -/** | ||
103 | - * Allocate an AVD3D11VAContext. | ||
104 | - * | ||
105 | - * @return Newly-allocated AVD3D11VAContext or NULL on failure. | ||
106 | - */ | ||
107 | -AVD3D11VAContext *liteav_av_d3d11va_alloc_context(void); | ||
108 | - | ||
109 | -/** | ||
110 | - * @} | ||
111 | - */ | ||
112 | - | ||
113 | -#endif /* AVCODEC_D3D11VA_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * Copyright (C) 2007 Marco Gerards <marco@gnu.org> | ||
4 | - * Copyright (C) 2009 David Conrad | ||
5 | - * Copyright (C) 2011 Jordi Ortiz | ||
6 | - * | ||
7 | - * This file is part of FFmpeg. | ||
8 | - * | ||
9 | - * FFmpeg is free software; you can redistribute it and/or | ||
10 | - * modify it under the terms of the GNU Lesser General Public | ||
11 | - * License as published by the Free Software Foundation; either | ||
12 | - * version 2.1 of the License, or (at your option) any later version. | ||
13 | - * | ||
14 | - * FFmpeg is distributed in the hope that it will be useful, | ||
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | - * Lesser General Public License for more details. | ||
18 | - * | ||
19 | - * You should have received a copy of the GNU Lesser General Public | ||
20 | - * License along with FFmpeg; if not, write to the Free Software | ||
21 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | - */ | ||
23 | - | ||
24 | -#ifndef AVCODEC_DIRAC_H | ||
25 | -#define AVCODEC_DIRAC_H | ||
26 | - | ||
27 | -/** | ||
28 | - * @file | ||
29 | - * Interface to Dirac Decoder/Encoder | ||
30 | - * @author Marco Gerards <marco@gnu.org> | ||
31 | - * @author David Conrad | ||
32 | - * @author Jordi Ortiz | ||
33 | - */ | ||
34 | - | ||
35 | -#include "avcodec.h" | ||
36 | - | ||
37 | -/** | ||
38 | - * The spec limits the number of wavelet decompositions to 4 for both | ||
39 | - * level 1 (VC-2) and 128 (long-gop default). | ||
40 | - * 5 decompositions is the maximum before >16-bit buffers are needed. | ||
41 | - * Schroedinger allows this for DD 9,7 and 13,7 wavelets only, limiting | ||
42 | - * the others to 4 decompositions (or 3 for the fidelity filter). | ||
43 | - * | ||
44 | - * We use this instead of MAX_DECOMPOSITIONS to save some memory. | ||
45 | - */ | ||
46 | -#define MAX_DWT_LEVELS 5 | ||
47 | - | ||
48 | -/** | ||
49 | - * Parse code values: | ||
50 | - * | ||
51 | - * Dirac Specification -> | ||
52 | - * 9.6.1 Table 9.1 | ||
53 | - * | ||
54 | - * VC-2 Specification -> | ||
55 | - * 10.4.1 Table 10.1 | ||
56 | - */ | ||
57 | - | ||
58 | -enum DiracParseCodes { | ||
59 | - DIRAC_PCODE_SEQ_HEADER = 0x00, | ||
60 | - DIRAC_PCODE_END_SEQ = 0x10, | ||
61 | - DIRAC_PCODE_AUX = 0x20, | ||
62 | - DIRAC_PCODE_PAD = 0x30, | ||
63 | - DIRAC_PCODE_PICTURE_CODED = 0x08, | ||
64 | - DIRAC_PCODE_PICTURE_RAW = 0x48, | ||
65 | - DIRAC_PCODE_PICTURE_LOW_DEL = 0xC8, | ||
66 | - DIRAC_PCODE_PICTURE_HQ = 0xE8, | ||
67 | - DIRAC_PCODE_INTER_NOREF_CO1 = 0x0A, | ||
68 | - DIRAC_PCODE_INTER_NOREF_CO2 = 0x09, | ||
69 | - DIRAC_PCODE_INTER_REF_CO1 = 0x0D, | ||
70 | - DIRAC_PCODE_INTER_REF_CO2 = 0x0E, | ||
71 | - DIRAC_PCODE_INTRA_REF_CO = 0x0C, | ||
72 | - DIRAC_PCODE_INTRA_REF_RAW = 0x4C, | ||
73 | - DIRAC_PCODE_INTRA_REF_PICT = 0xCC, | ||
74 | - DIRAC_PCODE_MAGIC = 0x42424344, | ||
75 | -}; | ||
76 | - | ||
77 | -typedef struct DiracVersionInfo { | ||
78 | - int major; | ||
79 | - int minor; | ||
80 | -} DiracVersionInfo; | ||
81 | - | ||
82 | -typedef struct AVDiracSeqHeader { | ||
83 | - unsigned width; | ||
84 | - unsigned height; | ||
85 | - uint8_t chroma_format; ///< 0: 444 1: 422 2: 420 | ||
86 | - | ||
87 | - uint8_t interlaced; | ||
88 | - uint8_t top_field_first; | ||
89 | - | ||
90 | - uint8_t frame_rate_index; ///< index into dirac_frame_rate[] | ||
91 | - uint8_t aspect_ratio_index; ///< index into dirac_aspect_ratio[] | ||
92 | - | ||
93 | - uint16_t clean_width; | ||
94 | - uint16_t clean_height; | ||
95 | - uint16_t clean_left_offset; | ||
96 | - uint16_t clean_right_offset; | ||
97 | - | ||
98 | - uint8_t pixel_range_index; ///< index into dirac_pixel_range_presets[] | ||
99 | - uint8_t color_spec_index; ///< index into dirac_color_spec_presets[] | ||
100 | - | ||
101 | - int profile; | ||
102 | - int level; | ||
103 | - | ||
104 | - AVRational framerate; | ||
105 | - AVRational sample_aspect_ratio; | ||
106 | - | ||
107 | - enum AVPixelFormat pix_fmt; | ||
108 | - enum AVColorRange color_range; | ||
109 | - enum AVColorPrimaries color_primaries; | ||
110 | - enum AVColorTransferCharacteristic color_trc; | ||
111 | - enum AVColorSpace colorspace; | ||
112 | - | ||
113 | - DiracVersionInfo version; | ||
114 | - int bit_depth; | ||
115 | -} AVDiracSeqHeader; | ||
116 | - | ||
117 | -/** | ||
118 | - * Parse a Dirac sequence header. | ||
119 | - * | ||
120 | - * @param dsh this function will allocate and fill an AVDiracSeqHeader struct | ||
121 | - * and write it into this pointer. The caller must free it with | ||
122 | - * liteav_av_free(). | ||
123 | - * @param buf the data buffer | ||
124 | - * @param buf_size the size of the data buffer in bytes | ||
125 | - * @param log_ctx if non-NULL, this function will log errors here | ||
126 | - * @return 0 on success, a negative AVERROR code on failure | ||
127 | - */ | ||
128 | -int liteav_av_dirac_parse_sequence_header(AVDiracSeqHeader **dsh, | ||
129 | - const uint8_t *buf, size_t buf_size, | ||
130 | - void *log_ctx); | ||
131 | - | ||
132 | -#endif /* AVCODEC_DIRAC_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -#ifndef AVCODEC_DV_PROFILE_H | ||
21 | -#define AVCODEC_DV_PROFILE_H | ||
22 | - | ||
23 | -#include <stdint.h> | ||
24 | - | ||
25 | -#include "libavutil/pixfmt.h" | ||
26 | -#include "libavutil/rational.h" | ||
27 | -#include "avcodec.h" | ||
28 | - | ||
29 | -/* minimum number of bytes to read from a DV stream in order to | ||
30 | - * determine the profile */ | ||
31 | -#define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */ | ||
32 | - | ||
33 | - | ||
34 | -/* | ||
35 | - * AVDVProfile is used to express the differences between various | ||
36 | - * DV flavors. For now it's primarily used for differentiating | ||
37 | - * 525/60 and 625/50, but the plans are to use it for various | ||
38 | - * DV specs as well (e.g. SMPTE314M vs. IEC 61834). | ||
39 | - */ | ||
40 | -typedef struct AVDVProfile { | ||
41 | - int dsf; /* value of the dsf in the DV header */ | ||
42 | - int video_stype; /* stype for VAUX source pack */ | ||
43 | - int frame_size; /* total size of one frame in bytes */ | ||
44 | - int difseg_size; /* number of DIF segments per DIF channel */ | ||
45 | - int n_difchan; /* number of DIF channels per frame */ | ||
46 | - AVRational time_base; /* 1/framerate */ | ||
47 | - int ltc_divisor; /* FPS from the LTS standpoint */ | ||
48 | - int height; /* picture height in pixels */ | ||
49 | - int width; /* picture width in pixels */ | ||
50 | - AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */ | ||
51 | - enum AVPixelFormat pix_fmt; /* picture pixel format */ | ||
52 | - int bpm; /* blocks per macroblock */ | ||
53 | - const uint8_t *block_sizes; /* AC block sizes, in bits */ | ||
54 | - int audio_stride; /* size of audio_shuffle table */ | ||
55 | - int audio_min_samples[3]; /* min amount of audio samples */ | ||
56 | - /* for 48kHz, 44.1kHz and 32kHz */ | ||
57 | - int audio_samples_dist[5]; /* how many samples are supposed to be */ | ||
58 | - /* in each frame in a 5 frames window */ | ||
59 | - const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */ | ||
60 | -} AVDVProfile; | ||
61 | - | ||
62 | -/** | ||
63 | - * Get a DV profile for the provided compressed frame. | ||
64 | - * | ||
65 | - * @param sys the profile used for the previous frame, may be NULL | ||
66 | - * @param frame the compressed data buffer | ||
67 | - * @param buf_size size of the buffer in bytes | ||
68 | - * @return the DV profile for the supplied data or NULL on failure | ||
69 | - */ | ||
70 | -const AVDVProfile *liteav_av_dv_frame_profile(const AVDVProfile *sys, | ||
71 | - const uint8_t *frame, unsigned buf_size); | ||
72 | - | ||
73 | -/** | ||
74 | - * Get a DV profile for the provided stream parameters. | ||
75 | - */ | ||
76 | -const AVDVProfile *liteav_av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt); | ||
77 | - | ||
78 | -/** | ||
79 | - * Get a DV profile for the provided stream parameters. | ||
80 | - * The frame rate is used as a best-effort parameter. | ||
81 | - */ | ||
82 | -const AVDVProfile *liteav_av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate); | ||
83 | - | ||
84 | -#endif /* AVCODEC_DV_PROFILE_H */ |
1 | -/* | ||
2 | - * DXVA2 HW acceleration | ||
3 | - * | ||
4 | - * copyright (c) 2009 Laurent Aimar | ||
5 | - * | ||
6 | - * This file is part of FFmpeg. | ||
7 | - * | ||
8 | - * FFmpeg is free software; you can redistribute it and/or | ||
9 | - * modify it under the terms of the GNU Lesser General Public | ||
10 | - * License as published by the Free Software Foundation; either | ||
11 | - * version 2.1 of the License, or (at your option) any later version. | ||
12 | - * | ||
13 | - * FFmpeg is distributed in the hope that it will be useful, | ||
14 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | - * Lesser General Public License for more details. | ||
17 | - * | ||
18 | - * You should have received a copy of the GNU Lesser General Public | ||
19 | - * License along with FFmpeg; if not, write to the Free Software | ||
20 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | - */ | ||
22 | - | ||
23 | -#ifndef AVCODEC_DXVA2_H | ||
24 | -#define AVCODEC_DXVA2_H | ||
25 | - | ||
26 | -/** | ||
27 | - * @file | ||
28 | - * @ingroup lavc_codec_hwaccel_dxva2 | ||
29 | - * Public libavcodec DXVA2 header. | ||
30 | - */ | ||
31 | - | ||
32 | -#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602 | ||
33 | -#undef _WIN32_WINNT | ||
34 | -#define _WIN32_WINNT 0x0602 | ||
35 | -#endif | ||
36 | - | ||
37 | -#include <stdint.h> | ||
38 | -#include <d3d9.h> | ||
39 | -#include <dxva2api.h> | ||
40 | - | ||
41 | -/** | ||
42 | - * @defgroup lavc_codec_hwaccel_dxva2 DXVA2 | ||
43 | - * @ingroup lavc_codec_hwaccel | ||
44 | - * | ||
45 | - * @{ | ||
46 | - */ | ||
47 | - | ||
48 | -#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards | ||
49 | -#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface | ||
50 | - | ||
51 | -/** | ||
52 | - * This structure is used to provides the necessary configurations and data | ||
53 | - * to the DXVA2 FFmpeg HWAccel implementation. | ||
54 | - * | ||
55 | - * The application must make it available as AVCodecContext.hwaccel_context. | ||
56 | - */ | ||
57 | -struct dxva_context { | ||
58 | - /** | ||
59 | - * DXVA2 decoder object | ||
60 | - */ | ||
61 | - IDirectXVideoDecoder *decoder; | ||
62 | - | ||
63 | - /** | ||
64 | - * DXVA2 configuration used to create the decoder | ||
65 | - */ | ||
66 | - const DXVA2_ConfigPictureDecode *cfg; | ||
67 | - | ||
68 | - /** | ||
69 | - * The number of surface in the surface array | ||
70 | - */ | ||
71 | - unsigned surface_count; | ||
72 | - | ||
73 | - /** | ||
74 | - * The array of Direct3D surfaces used to create the decoder | ||
75 | - */ | ||
76 | - LPDIRECT3DSURFACE9 *surface; | ||
77 | - | ||
78 | - /** | ||
79 | - * A bit field configuring the workarounds needed for using the decoder | ||
80 | - */ | ||
81 | - uint64_t workaround; | ||
82 | - | ||
83 | - /** | ||
84 | - * Private to the FFmpeg AVHWAccel implementation | ||
85 | - */ | ||
86 | - unsigned report_id; | ||
87 | -}; | ||
88 | - | ||
89 | -/** | ||
90 | - * @} | ||
91 | - */ | ||
92 | - | ||
93 | -#endif /* AVCODEC_DXVA2_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * JNI public API functions | ||
4 | - * | ||
5 | - * Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com> | ||
6 | - * | ||
7 | - * This file is part of FFmpeg. | ||
8 | - * | ||
9 | - * FFmpeg is free software; you can redistribute it and/or | ||
10 | - * modify it under the terms of the GNU Lesser General Public | ||
11 | - * License as published by the Free Software Foundation; either | ||
12 | - * version 2.1 of the License, or (at your option) any later version. | ||
13 | - * | ||
14 | - * FFmpeg is distributed in the hope that it will be useful, | ||
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | - * Lesser General Public License for more details. | ||
18 | - * | ||
19 | - * You should have received a copy of the GNU Lesser General Public | ||
20 | - * License along with FFmpeg; if not, write to the Free Software | ||
21 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | - */ | ||
23 | - | ||
24 | -#ifndef AVCODEC_JNI_H | ||
25 | -#define AVCODEC_JNI_H | ||
26 | - | ||
27 | -/* | ||
28 | - * Manually set a Java virtual machine which will be used to retrieve the JNI | ||
29 | - * environment. Once a Java VM is set it cannot be changed afterwards, meaning | ||
30 | - * you can call multiple times liteav_av_jni_set_java_vm with the same Java VM pointer | ||
31 | - * however it will error out if you try to set a different Java VM. | ||
32 | - * | ||
33 | - * @param vm Java virtual machine | ||
34 | - * @param log_ctx context used for logging, can be NULL | ||
35 | - * @return 0 on success, < 0 otherwise | ||
36 | - */ | ||
37 | -int liteav_av_jni_set_java_vm(void *vm, void *log_ctx); | ||
38 | - | ||
39 | -/* | ||
40 | - * Get the Java virtual machine which has been set with liteav_av_jni_set_java_vm. | ||
41 | - * | ||
42 | - * @param vm Java virtual machine | ||
43 | - * @return a pointer to the Java virtual machine | ||
44 | - */ | ||
45 | -void *liteav_av_jni_get_java_vm(void *log_ctx); | ||
46 | - | ||
47 | -#endif /* AVCODEC_JNI_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * Android MediaCodec public API | ||
4 | - * | ||
5 | - * Copyright (c) 2016 Matthieu Bouron <matthieu.bouron stupeflix.com> | ||
6 | - * | ||
7 | - * This file is part of FFmpeg. | ||
8 | - * | ||
9 | - * FFmpeg is free software; you can redistribute it and/or | ||
10 | - * modify it under the terms of the GNU Lesser General Public | ||
11 | - * License as published by the Free Software Foundation; either | ||
12 | - * version 2.1 of the License, or (at your option) any later version. | ||
13 | - * | ||
14 | - * FFmpeg is distributed in the hope that it will be useful, | ||
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | - * Lesser General Public License for more details. | ||
18 | - * | ||
19 | - * You should have received a copy of the GNU Lesser General Public | ||
20 | - * License along with FFmpeg; if not, write to the Free Software | ||
21 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | - */ | ||
23 | - | ||
24 | -#ifndef AVCODEC_MEDIACODEC_H | ||
25 | -#define AVCODEC_MEDIACODEC_H | ||
26 | - | ||
27 | -#include "libavcodec/avcodec.h" | ||
28 | - | ||
29 | -/** | ||
30 | - * This structure holds a reference to a android/view/Surface object that will | ||
31 | - * be used as output by the decoder. | ||
32 | - * | ||
33 | - */ | ||
34 | -typedef struct AVMediaCodecContext { | ||
35 | - | ||
36 | - /** | ||
37 | - * android/view/Surface object reference. | ||
38 | - */ | ||
39 | - void *surface; | ||
40 | - | ||
41 | -} AVMediaCodecContext; | ||
42 | - | ||
43 | -/** | ||
44 | - * Allocate and initialize a MediaCodec context. | ||
45 | - * | ||
46 | - * When decoding with MediaCodec is finished, the caller must free the | ||
47 | - * MediaCodec context with liteav_av_mediacodec_default_free. | ||
48 | - * | ||
49 | - * @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise | ||
50 | - */ | ||
51 | -AVMediaCodecContext *liteav_av_mediacodec_alloc_context(void); | ||
52 | - | ||
53 | -/** | ||
54 | - * Convenience function that sets up the MediaCodec context. | ||
55 | - * | ||
56 | - * @param avctx codec context | ||
57 | - * @param ctx MediaCodec context to initialize | ||
58 | - * @param surface reference to an android/view/Surface | ||
59 | - * @return 0 on success, < 0 otherwise | ||
60 | - */ | ||
61 | -int liteav_av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface); | ||
62 | - | ||
63 | -/** | ||
64 | - * This function must be called to free the MediaCodec context initialized with | ||
65 | - * liteav_av_mediacodec_default_init(). | ||
66 | - * | ||
67 | - * @param avctx codec context | ||
68 | - */ | ||
69 | -void liteav_av_mediacodec_default_free(AVCodecContext *avctx); | ||
70 | - | ||
71 | -/** | ||
72 | - * Opaque structure representing a MediaCodec buffer to render. | ||
73 | - */ | ||
74 | -typedef struct MediaCodecBuffer AVMediaCodecBuffer; | ||
75 | - | ||
76 | -/** | ||
77 | - * Release a MediaCodec buffer and render it to the surface that is associated | ||
78 | - * with the decoder. This function should only be called once on a given | ||
79 | - * buffer, once released the underlying buffer returns to the codec, thus | ||
80 | - * subsequent calls to this function will have no effect. | ||
81 | - * | ||
82 | - * @param buffer the buffer to render | ||
83 | - * @param render 1 to release and render the buffer to the surface or 0 to | ||
84 | - * discard the buffer | ||
85 | - * @return 0 on success, < 0 otherwise | ||
86 | - */ | ||
87 | -int liteav_av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render); | ||
88 | - | ||
89 | -/** | ||
90 | - * Release a MediaCodec buffer and render it at the given time to the surface | ||
91 | - * that is associated with the decoder. The timestamp must be within one second | ||
92 | - * of the current java/lang/System#nanoTime() (which is implemented using | ||
93 | - * CLOCK_MONOTONIC on Android). See the Android MediaCodec documentation | ||
94 | - * of android/media/MediaCodec#releaseOutputBuffer(int,long) for more details. | ||
95 | - * | ||
96 | - * @param buffer the buffer to render | ||
97 | - * @param time timestamp in nanoseconds of when to render the buffer | ||
98 | - * @return 0 on success, < 0 otherwise | ||
99 | - */ | ||
100 | -int liteav_av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time); | ||
101 | - | ||
102 | -#endif /* AVCODEC_MEDIACODEC_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * Intel MediaSDK QSV public API | ||
4 | - * | ||
5 | - * This file is part of FFmpeg. | ||
6 | - * | ||
7 | - * FFmpeg is free software; you can redistribute it and/or | ||
8 | - * modify it under the terms of the GNU Lesser General Public | ||
9 | - * License as published by the Free Software Foundation; either | ||
10 | - * version 2.1 of the License, or (at your option) any later version. | ||
11 | - * | ||
12 | - * FFmpeg is distributed in the hope that it will be useful, | ||
13 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | - * Lesser General Public License for more details. | ||
16 | - * | ||
17 | - * You should have received a copy of the GNU Lesser General Public | ||
18 | - * License along with FFmpeg; if not, write to the Free Software | ||
19 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | - */ | ||
21 | - | ||
22 | -#ifndef AVCODEC_QSV_H | ||
23 | -#define AVCODEC_QSV_H | ||
24 | - | ||
25 | -#include <mfx/mfxvideo.h> | ||
26 | - | ||
27 | -#include "libavutil/buffer.h" | ||
28 | - | ||
29 | -/** | ||
30 | - * This struct is used for communicating QSV parameters between libavcodec and | ||
31 | - * the caller. It is managed by the caller and must be assigned to | ||
32 | - * AVCodecContext.hwaccel_context. | ||
33 | - * - decoding: hwaccel_context must be set on return from the get_format() | ||
34 | - * callback | ||
35 | - * - encoding: hwaccel_context must be set before avcodec_open2() | ||
36 | - */ | ||
37 | -typedef struct AVQSVContext { | ||
38 | - /** | ||
39 | - * If non-NULL, the session to use for encoding or decoding. | ||
40 | - * Otherwise, libavcodec will try to create an internal session. | ||
41 | - */ | ||
42 | - mfxSession session; | ||
43 | - | ||
44 | - /** | ||
45 | - * The IO pattern to use. | ||
46 | - */ | ||
47 | - int iopattern; | ||
48 | - | ||
49 | - /** | ||
50 | - * Extra buffers to pass to encoder or decoder initialization. | ||
51 | - */ | ||
52 | - mfxExtBuffer **ext_buffers; | ||
53 | - int nb_ext_buffers; | ||
54 | - | ||
55 | - /** | ||
56 | - * Encoding only. If this field is set to non-zero by the caller, libavcodec | ||
57 | - * will create an mfxExtOpaqueSurfaceAlloc extended buffer and pass it to | ||
58 | - * the encoder initialization. This only makes sense if iopattern is also | ||
59 | - * set to MFX_IOPATTERN_IN_OPAQUE_MEMORY. | ||
60 | - * | ||
61 | - * The number of allocated opaque surfaces will be the sum of the number | ||
62 | - * required by the encoder and the user-provided value nb_opaque_surfaces. | ||
63 | - * The array of the opaque surfaces will be exported to the caller through | ||
64 | - * the opaque_surfaces field. | ||
65 | - */ | ||
66 | - int opaque_alloc; | ||
67 | - | ||
68 | - /** | ||
69 | - * Encoding only, and only if opaque_alloc is set to non-zero. Before | ||
70 | - * calling avcodec_open2(), the caller should set this field to the number | ||
71 | - * of extra opaque surfaces to allocate beyond what is required by the | ||
72 | - * encoder. | ||
73 | - * | ||
74 | - * On return from avcodec_open2(), this field will be set by libavcodec to | ||
75 | - * the total number of allocated opaque surfaces. | ||
76 | - */ | ||
77 | - int nb_opaque_surfaces; | ||
78 | - | ||
79 | - /** | ||
80 | - * Encoding only, and only if opaque_alloc is set to non-zero. On return | ||
81 | - * from avcodec_open2(), this field will be used by libavcodec to export the | ||
82 | - * array of the allocated opaque surfaces to the caller, so they can be | ||
83 | - * passed to other parts of the pipeline. | ||
84 | - * | ||
85 | - * The buffer reference exported here is owned and managed by libavcodec, | ||
86 | - * the callers should make their own reference with liteav_av_buffer_ref() and free | ||
87 | - * it with liteav_av_buffer_unref() when it is no longer needed. | ||
88 | - * | ||
89 | - * The buffer data is an nb_opaque_surfaces-sized array of mfxFrameSurface1. | ||
90 | - */ | ||
91 | - AVBufferRef *opaque_surfaces; | ||
92 | - | ||
93 | - /** | ||
94 | - * Encoding only, and only if opaque_alloc is set to non-zero. On return | ||
95 | - * from avcodec_open2(), this field will be set to the surface type used in | ||
96 | - * the opaque allocation request. | ||
97 | - */ | ||
98 | - int opaque_alloc_type; | ||
99 | -} AVQSVContext; | ||
100 | - | ||
101 | -/** | ||
102 | - * Allocate a new context. | ||
103 | - * | ||
104 | - * It must be freed by the caller with liteav_av_free(). | ||
105 | - */ | ||
106 | -AVQSVContext *liteav_av_qsv_alloc_context(void); | ||
107 | - | ||
108 | -#endif /* AVCODEC_QSV_H */ |
1 | -/* | ||
2 | - * Video Acceleration API (shared data between FFmpeg and the video player) | ||
3 | - * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 | ||
4 | - * | ||
5 | - * Copyright (C) 2008-2009 Splitted-Desktop Systems | ||
6 | - * | ||
7 | - * This file is part of FFmpeg. | ||
8 | - * | ||
9 | - * FFmpeg is free software; you can redistribute it and/or | ||
10 | - * modify it under the terms of the GNU Lesser General Public | ||
11 | - * License as published by the Free Software Foundation; either | ||
12 | - * version 2.1 of the License, or (at your option) any later version. | ||
13 | - * | ||
14 | - * FFmpeg is distributed in the hope that it will be useful, | ||
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | - * Lesser General Public License for more details. | ||
18 | - * | ||
19 | - * You should have received a copy of the GNU Lesser General Public | ||
20 | - * License along with FFmpeg; if not, write to the Free Software | ||
21 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | - */ | ||
23 | - | ||
24 | -#ifndef AVCODEC_VAAPI_H | ||
25 | -#define AVCODEC_VAAPI_H | ||
26 | - | ||
27 | -/** | ||
28 | - * @file | ||
29 | - * @ingroup lavc_codec_hwaccel_vaapi | ||
30 | - * Public libavcodec VA API header. | ||
31 | - */ | ||
32 | - | ||
33 | -#include <stdint.h> | ||
34 | -#include "libavutil/attributes.h" | ||
35 | -#include "version.h" | ||
36 | - | ||
37 | -#if FF_API_STRUCT_VAAPI_CONTEXT | ||
38 | - | ||
39 | -/** | ||
40 | - * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding | ||
41 | - * @ingroup lavc_codec_hwaccel | ||
42 | - * @{ | ||
43 | - */ | ||
44 | - | ||
45 | -/** | ||
46 | - * This structure is used to share data between the FFmpeg library and | ||
47 | - * the client video application. | ||
48 | - * This shall be zero-allocated and available as | ||
49 | - * AVCodecContext.hwaccel_context. All user members can be set once | ||
50 | - * during initialization or through each AVCodecContext.get_buffer() | ||
51 | - * function call. In any case, they must be valid prior to calling | ||
52 | - * decoding functions. | ||
53 | - * | ||
54 | - * Deprecated: use AVCodecContext.hw_frames_ctx instead. | ||
55 | - */ | ||
56 | -struct attribute_deprecated vaapi_context { | ||
57 | - /** | ||
58 | - * Window system dependent data | ||
59 | - * | ||
60 | - * - encoding: unused | ||
61 | - * - decoding: Set by user | ||
62 | - */ | ||
63 | - void *display; | ||
64 | - | ||
65 | - /** | ||
66 | - * Configuration ID | ||
67 | - * | ||
68 | - * - encoding: unused | ||
69 | - * - decoding: Set by user | ||
70 | - */ | ||
71 | - uint32_t config_id; | ||
72 | - | ||
73 | - /** | ||
74 | - * Context ID (video decode pipeline) | ||
75 | - * | ||
76 | - * - encoding: unused | ||
77 | - * - decoding: Set by user | ||
78 | - */ | ||
79 | - uint32_t context_id; | ||
80 | -}; | ||
81 | - | ||
82 | -/* @} */ | ||
83 | - | ||
84 | -#endif /* FF_API_STRUCT_VAAPI_CONTEXT */ | ||
85 | - | ||
86 | -#endif /* AVCODEC_VAAPI_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * The Video Decode and Presentation API for UNIX (VDPAU) is used for | ||
4 | - * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. | ||
5 | - * | ||
6 | - * Copyright (C) 2008 NVIDIA | ||
7 | - * | ||
8 | - * This file is part of FFmpeg. | ||
9 | - * | ||
10 | - * FFmpeg is free software; you can redistribute it and/or | ||
11 | - * modify it under the terms of the GNU Lesser General Public | ||
12 | - * License as published by the Free Software Foundation; either | ||
13 | - * version 2.1 of the License, or (at your option) any later version. | ||
14 | - * | ||
15 | - * FFmpeg is distributed in the hope that it will be useful, | ||
16 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | - * Lesser General Public License for more details. | ||
19 | - * | ||
20 | - * You should have received a copy of the GNU Lesser General Public | ||
21 | - * License along with FFmpeg; if not, write to the Free Software | ||
22 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
23 | - */ | ||
24 | - | ||
25 | -#ifndef AVCODEC_VDPAU_H | ||
26 | -#define AVCODEC_VDPAU_H | ||
27 | - | ||
28 | -/** | ||
29 | - * @file | ||
30 | - * @ingroup lavc_codec_hwaccel_vdpau | ||
31 | - * Public libavcodec VDPAU header. | ||
32 | - */ | ||
33 | - | ||
34 | - | ||
35 | -/** | ||
36 | - * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer | ||
37 | - * @ingroup lavc_codec_hwaccel | ||
38 | - * | ||
39 | - * VDPAU hardware acceleration has two modules | ||
40 | - * - VDPAU decoding | ||
41 | - * - VDPAU presentation | ||
42 | - * | ||
43 | - * The VDPAU decoding module parses all headers using FFmpeg | ||
44 | - * parsing mechanisms and uses VDPAU for the actual decoding. | ||
45 | - * | ||
46 | - * As per the current implementation, the actual decoding | ||
47 | - * and rendering (API calls) are done as part of the VDPAU | ||
48 | - * presentation (vo_vdpau.c) module. | ||
49 | - * | ||
50 | - * @{ | ||
51 | - */ | ||
52 | - | ||
53 | -#include <vdpau/vdpau.h> | ||
54 | - | ||
55 | -#include "libavutil/avconfig.h" | ||
56 | -#include "libavutil/attributes.h" | ||
57 | - | ||
58 | -#include "avcodec.h" | ||
59 | -#include "version.h" | ||
60 | - | ||
61 | -struct AVCodecContext; | ||
62 | -struct AVFrame; | ||
63 | - | ||
64 | -typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, | ||
65 | - const VdpPictureInfo *, uint32_t, | ||
66 | - const VdpBitstreamBuffer *); | ||
67 | - | ||
68 | -/** | ||
69 | - * This structure is used to share data between the libavcodec library and | ||
70 | - * the client video application. | ||
71 | - * The user shall allocate the structure via the av_alloc_vdpau_hwaccel | ||
72 | - * function and make it available as | ||
73 | - * AVCodecContext.hwaccel_context. Members can be set by the user once | ||
74 | - * during initialization or through each AVCodecContext.get_buffer() | ||
75 | - * function call. In any case, they must be valid prior to calling | ||
76 | - * decoding functions. | ||
77 | - * | ||
78 | - * The size of this structure is not a part of the public ABI and must not | ||
79 | - * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an | ||
80 | - * AVVDPAUContext. | ||
81 | - */ | ||
82 | -typedef struct AVVDPAUContext { | ||
83 | - /** | ||
84 | - * VDPAU decoder handle | ||
85 | - * | ||
86 | - * Set by user. | ||
87 | - */ | ||
88 | - VdpDecoder decoder; | ||
89 | - | ||
90 | - /** | ||
91 | - * VDPAU decoder render callback | ||
92 | - * | ||
93 | - * Set by the user. | ||
94 | - */ | ||
95 | - VdpDecoderRender *render; | ||
96 | - | ||
97 | - AVVDPAU_Render2 render2; | ||
98 | -} AVVDPAUContext; | ||
99 | - | ||
100 | -/** | ||
101 | - * @brief allocation function for AVVDPAUContext | ||
102 | - * | ||
103 | - * Allows extending the struct without breaking API/ABI | ||
104 | - */ | ||
105 | -AVVDPAUContext *av_alloc_vdpaucontext(void); | ||
106 | - | ||
107 | -AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); | ||
108 | -void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); | ||
109 | - | ||
110 | -/** | ||
111 | - * Associate a VDPAU device with a codec context for hardware acceleration. | ||
112 | - * This function is meant to be called from the get_format() codec callback, | ||
113 | - * or earlier. It can also be called after liteav_avcodec_flush_buffers() to change | ||
114 | - * the underlying VDPAU device mid-stream (e.g. to recover from non-transparent | ||
115 | - * display preemption). | ||
116 | - * | ||
117 | - * @note get_format() must return AV_PIX_FMT_VDPAU if this function completes | ||
118 | - * successfully. | ||
119 | - * | ||
120 | - * @param avctx decoding context whose get_format() callback is invoked | ||
121 | - * @param device VDPAU device handle to use for hardware acceleration | ||
122 | - * @param get_proc_address VDPAU device driver | ||
123 | - * @param flags zero of more OR'd AV_HWACCEL_FLAG_* flags | ||
124 | - * | ||
125 | - * @return 0 on success, an AVERROR code on failure. | ||
126 | - */ | ||
127 | -int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, | ||
128 | - VdpGetProcAddress *get_proc_address, unsigned flags); | ||
129 | - | ||
130 | -/** | ||
131 | - * Gets the parameters to create an adequate VDPAU video surface for the codec | ||
132 | - * context using VDPAU hardware decoding acceleration. | ||
133 | - * | ||
134 | - * @note Behavior is undefined if the context was not successfully bound to a | ||
135 | - * VDPAU device using av_vdpau_bind_context(). | ||
136 | - * | ||
137 | - * @param avctx the codec context being used for decoding the stream | ||
138 | - * @param type storage space for the VDPAU video surface chroma type | ||
139 | - * (or NULL to ignore) | ||
140 | - * @param width storage space for the VDPAU video surface pixel width | ||
141 | - * (or NULL to ignore) | ||
142 | - * @param height storage space for the VDPAU video surface pixel height | ||
143 | - * (or NULL to ignore) | ||
144 | - * | ||
145 | - * @return 0 on success, a negative AVERROR code on failure. | ||
146 | - */ | ||
147 | -int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, | ||
148 | - uint32_t *width, uint32_t *height); | ||
149 | - | ||
150 | -/** | ||
151 | - * Allocate an AVVDPAUContext. | ||
152 | - * | ||
153 | - * @return Newly-allocated AVVDPAUContext or NULL on failure. | ||
154 | - */ | ||
155 | -AVVDPAUContext *av_vdpau_alloc_context(void); | ||
156 | - | ||
157 | -#if FF_API_VDPAU_PROFILE | ||
158 | -/** | ||
159 | - * Get a decoder profile that should be used for initializing a VDPAU decoder. | ||
160 | - * Should be called from the AVCodecContext.get_format() callback. | ||
161 | - * | ||
162 | - * @deprecated Use av_vdpau_bind_context() instead. | ||
163 | - * | ||
164 | - * @param avctx the codec context being used for decoding the stream | ||
165 | - * @param profile a pointer into which the result will be written on success. | ||
166 | - * The contents of profile are undefined if this function returns | ||
167 | - * an error. | ||
168 | - * | ||
169 | - * @return 0 on success (non-negative), a negative AVERROR on failure. | ||
170 | - */ | ||
171 | -attribute_deprecated | ||
172 | -int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile); | ||
173 | -#endif | ||
174 | - | ||
175 | -/* @}*/ | ||
176 | - | ||
177 | -#endif /* AVCODEC_VDPAU_H */ |
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 | -#ifndef AVCODEC_VERSION_H | ||
20 | -#define AVCODEC_VERSION_H | ||
21 | - | ||
22 | -/** | ||
23 | - * @file | ||
24 | - * @ingroup libavc | ||
25 | - * Libavcodec version macros. | ||
26 | - */ | ||
27 | - | ||
28 | -#include "libavutil/version.h" | ||
29 | - | ||
30 | -#define LIBAVCODEC_VERSION_MAJOR 58 | ||
31 | -#define LIBAVCODEC_VERSION_MINOR 35 | ||
32 | -#define LIBAVCODEC_VERSION_MICRO 100 | ||
33 | - | ||
34 | -#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | ||
35 | - LIBAVCODEC_VERSION_MINOR, \ | ||
36 | - LIBAVCODEC_VERSION_MICRO) | ||
37 | -#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ | ||
38 | - LIBAVCODEC_VERSION_MINOR, \ | ||
39 | - LIBAVCODEC_VERSION_MICRO) | ||
40 | -#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT | ||
41 | - | ||
42 | -#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) | ||
43 | - | ||
44 | -/** | ||
45 | - * FF_API_* defines may be placed below to indicate public API that will be | ||
46 | - * dropped at a future version bump. The defines themselves are not part of | ||
47 | - * the public API and may change, break or disappear at any time. | ||
48 | - * | ||
49 | - * @note, when bumping the major version it is recommended to manually | ||
50 | - * disable each FF_API_* in its own commit instead of disabling them all | ||
51 | - * at once through the bump. This improves the git bisect-ability of the change. | ||
52 | - */ | ||
53 | - | ||
54 | -#ifndef FF_API_LOWRES | ||
55 | -#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 59) | ||
56 | -#endif | ||
57 | -#ifndef FF_API_DEBUG_MV | ||
58 | -#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 58) | ||
59 | -#endif | ||
60 | -#ifndef FF_API_AVCTX_TIMEBASE | ||
61 | -#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59) | ||
62 | -#endif | ||
63 | -#ifndef FF_API_CODED_FRAME | ||
64 | -#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59) | ||
65 | -#endif | ||
66 | -#ifndef FF_API_SIDEDATA_ONLY_PKT | ||
67 | -#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59) | ||
68 | -#endif | ||
69 | -#ifndef FF_API_WITHOUT_PREFIX | ||
70 | -#define FF_API_WITHOUT_PREFIX (LIBAVCODEC_VERSION_MAJOR < 59) | ||
71 | -#endif | ||
72 | -#ifndef FF_API_VDPAU_PROFILE | ||
73 | -#define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59) | ||
74 | -#endif | ||
75 | -#ifndef FF_API_CONVERGENCE_DURATION | ||
76 | -#define FF_API_CONVERGENCE_DURATION (LIBAVCODEC_VERSION_MAJOR < 59) | ||
77 | -#endif | ||
78 | -#ifndef FF_API_AVPICTURE | ||
79 | -#define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59) | ||
80 | -#endif | ||
81 | -#ifndef FF_API_AVPACKET_OLD_API | ||
82 | -#define FF_API_AVPACKET_OLD_API (LIBAVCODEC_VERSION_MAJOR < 59) | ||
83 | -#endif | ||
84 | -#ifndef FF_API_RTP_CALLBACK | ||
85 | -#define FF_API_RTP_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 59) | ||
86 | -#endif | ||
87 | -#ifndef FF_API_VBV_DELAY | ||
88 | -#define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59) | ||
89 | -#endif | ||
90 | -#ifndef FF_API_CODER_TYPE | ||
91 | -#define FF_API_CODER_TYPE (LIBAVCODEC_VERSION_MAJOR < 59) | ||
92 | -#endif | ||
93 | -#ifndef FF_API_STAT_BITS | ||
94 | -#define FF_API_STAT_BITS (LIBAVCODEC_VERSION_MAJOR < 59) | ||
95 | -#endif | ||
96 | -#ifndef FF_API_PRIVATE_OPT | ||
97 | -#define FF_API_PRIVATE_OPT (LIBAVCODEC_VERSION_MAJOR < 59) | ||
98 | -#endif | ||
99 | -#ifndef FF_API_ASS_TIMING | ||
100 | -#define FF_API_ASS_TIMING (LIBAVCODEC_VERSION_MAJOR < 59) | ||
101 | -#endif | ||
102 | -#ifndef FF_API_OLD_BSF | ||
103 | -#define FF_API_OLD_BSF (LIBAVCODEC_VERSION_MAJOR < 59) | ||
104 | -#endif | ||
105 | -#ifndef FF_API_COPY_CONTEXT | ||
106 | -#define FF_API_COPY_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) | ||
107 | -#endif | ||
108 | -#ifndef FF_API_GET_CONTEXT_DEFAULTS | ||
109 | -#define FF_API_GET_CONTEXT_DEFAULTS (LIBAVCODEC_VERSION_MAJOR < 59) | ||
110 | -#endif | ||
111 | -#ifndef FF_API_NVENC_OLD_NAME | ||
112 | -#define FF_API_NVENC_OLD_NAME (LIBAVCODEC_VERSION_MAJOR < 59) | ||
113 | -#endif | ||
114 | -#ifndef FF_API_STRUCT_VAAPI_CONTEXT | ||
115 | -#define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59) | ||
116 | -#endif | ||
117 | -#ifndef FF_API_MERGE_SD_API | ||
118 | -#define FF_API_MERGE_SD_API (LIBAVCODEC_VERSION_MAJOR < 59) | ||
119 | -#endif | ||
120 | -#ifndef FF_API_TAG_STRING | ||
121 | -#define FF_API_TAG_STRING (LIBAVCODEC_VERSION_MAJOR < 59) | ||
122 | -#endif | ||
123 | -#ifndef FF_API_GETCHROMA | ||
124 | -#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59) | ||
125 | -#endif | ||
126 | -#ifndef FF_API_CODEC_GET_SET | ||
127 | -#define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59) | ||
128 | -#endif | ||
129 | -#ifndef FF_API_USER_VISIBLE_AVHWACCEL | ||
130 | -#define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59) | ||
131 | -#endif | ||
132 | -#ifndef FF_API_LOCKMGR | ||
133 | -#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59) | ||
134 | -#endif | ||
135 | -#ifndef FF_API_NEXT | ||
136 | -#define FF_API_NEXT (LIBAVCODEC_VERSION_MAJOR < 59) | ||
137 | -#endif | ||
138 | -#ifndef FF_API_CODEC_NAME | ||
139 | -#define FF_API_CODEC_NAME (LIBAVCODEC_VERSION_MAJOR < 59) | ||
140 | -#endif | ||
141 | -#ifndef FF_API_EMU_EDGE | ||
142 | -#define FF_API_EMU_EDGE (LIBAVCODEC_VERSION_MAJOR < 59) | ||
143 | -#endif | ||
144 | - | ||
145 | - | ||
146 | -#endif /* AVCODEC_VERSION_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * Videotoolbox hardware acceleration | ||
4 | - * | ||
5 | - * copyright (c) 2012 Sebastien Zwickert | ||
6 | - * | ||
7 | - * This file is part of FFmpeg. | ||
8 | - * | ||
9 | - * FFmpeg is free software; you can redistribute it and/or | ||
10 | - * modify it under the terms of the GNU Lesser General Public | ||
11 | - * License as published by the Free Software Foundation; either | ||
12 | - * version 2.1 of the License, or (at your option) any later version. | ||
13 | - * | ||
14 | - * FFmpeg is distributed in the hope that it will be useful, | ||
15 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | - * Lesser General Public License for more details. | ||
18 | - * | ||
19 | - * You should have received a copy of the GNU Lesser General Public | ||
20 | - * License along with FFmpeg; if not, write to the Free Software | ||
21 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
22 | - */ | ||
23 | - | ||
24 | -#ifndef AVCODEC_VIDEOTOOLBOX_H | ||
25 | -#define AVCODEC_VIDEOTOOLBOX_H | ||
26 | - | ||
27 | -/** | ||
28 | - * @file | ||
29 | - * @ingroup lavc_codec_hwaccel_videotoolbox | ||
30 | - * Public libavcodec Videotoolbox header. | ||
31 | - */ | ||
32 | - | ||
33 | -#include <stdint.h> | ||
34 | - | ||
35 | -#define Picture QuickdrawPicture | ||
36 | -#include <VideoToolbox/VideoToolbox.h> | ||
37 | -#undef Picture | ||
38 | - | ||
39 | -#include "libavcodec/avcodec.h" | ||
40 | - | ||
41 | -/** | ||
42 | - * This struct holds all the information that needs to be passed | ||
43 | - * between the caller and libavcodec for initializing Videotoolbox decoding. | ||
44 | - * Its size is not a part of the public ABI, it must be allocated with | ||
45 | - * liteav_av_videotoolbox_alloc_context() and freed with liteav_av_free(). | ||
46 | - */ | ||
47 | -typedef struct AVVideotoolboxContext { | ||
48 | - /** | ||
49 | - * Videotoolbox decompression session object. | ||
50 | - * Created and freed the caller. | ||
51 | - */ | ||
52 | - VTDecompressionSessionRef session; | ||
53 | - | ||
54 | - /** | ||
55 | - * The output callback that must be passed to the session. | ||
56 | - * Set by av_videottoolbox_default_init() | ||
57 | - */ | ||
58 | - VTDecompressionOutputCallback output_callback; | ||
59 | - | ||
60 | - /** | ||
61 | - * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames. | ||
62 | - * set by the caller. If this is set to 0, then no specific format is | ||
63 | - * requested from the decoder, and its native format is output. | ||
64 | - */ | ||
65 | - OSType cv_pix_fmt_type; | ||
66 | - | ||
67 | - /** | ||
68 | - * CoreMedia Format Description that Videotoolbox will use to create the decompression session. | ||
69 | - * Set by the caller. | ||
70 | - */ | ||
71 | - CMVideoFormatDescriptionRef cm_fmt_desc; | ||
72 | - | ||
73 | - /** | ||
74 | - * CoreMedia codec type that Videotoolbox will use to create the decompression session. | ||
75 | - * Set by the caller. | ||
76 | - */ | ||
77 | - int cm_codec_type; | ||
78 | -} AVVideotoolboxContext; | ||
79 | - | ||
80 | -/** | ||
81 | - * Allocate and initialize a Videotoolbox context. | ||
82 | - * | ||
83 | - * This function should be called from the get_format() callback when the caller | ||
84 | - * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create | ||
85 | - * the decoder object (using the output callback provided by libavcodec) that | ||
86 | - * will be used for Videotoolbox-accelerated decoding. | ||
87 | - * | ||
88 | - * When decoding with Videotoolbox is finished, the caller must destroy the decoder | ||
89 | - * object and free the Videotoolbox context using liteav_av_free(). | ||
90 | - * | ||
91 | - * @return the newly allocated context or NULL on failure | ||
92 | - */ | ||
93 | -AVVideotoolboxContext *liteav_av_videotoolbox_alloc_context(void); | ||
94 | - | ||
95 | -/** | ||
96 | - * This is a convenience function that creates and sets up the Videotoolbox context using | ||
97 | - * an internal implementation. | ||
98 | - * | ||
99 | - * @param avctx the corresponding codec context | ||
100 | - * | ||
101 | - * @return >= 0 on success, a negative AVERROR code on failure | ||
102 | - */ | ||
103 | -int liteav_av_videotoolbox_default_init(AVCodecContext *avctx); | ||
104 | - | ||
105 | -/** | ||
106 | - * This is a convenience function that creates and sets up the Videotoolbox context using | ||
107 | - * an internal implementation. | ||
108 | - * | ||
109 | - * @param avctx the corresponding codec context | ||
110 | - * @param vtctx the Videotoolbox context to use | ||
111 | - * | ||
112 | - * @return >= 0 on success, a negative AVERROR code on failure | ||
113 | - */ | ||
114 | -int liteav_av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); | ||
115 | - | ||
116 | -/** | ||
117 | - * This function must be called to free the Videotoolbox context initialized with | ||
118 | - * liteav_av_videotoolbox_default_init(). | ||
119 | - * | ||
120 | - * @param avctx the corresponding codec context | ||
121 | - */ | ||
122 | -void liteav_av_videotoolbox_default_free(AVCodecContext *avctx); | ||
123 | - | ||
124 | -/** | ||
125 | - * @} | ||
126 | - */ | ||
127 | - | ||
128 | -#endif /* AVCODEC_VIDEOTOOLBOX_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -/** | ||
21 | - * @file | ||
22 | - * A public API for Vorbis parsing | ||
23 | - * | ||
24 | - * Determines the duration for each packet. | ||
25 | - */ | ||
26 | - | ||
27 | -#ifndef AVCODEC_VORBIS_PARSER_H | ||
28 | -#define AVCODEC_VORBIS_PARSER_H | ||
29 | - | ||
30 | -#include <stdint.h> | ||
31 | - | ||
32 | -typedef struct AVVorbisParseContext AVVorbisParseContext; | ||
33 | - | ||
34 | -/** | ||
35 | - * Allocate and initialize the Vorbis parser using headers in the extradata. | ||
36 | - */ | ||
37 | -AVVorbisParseContext *liteav_av_vorbis_parse_init(const uint8_t *extradata, | ||
38 | - int extradata_size); | ||
39 | - | ||
40 | -/** | ||
41 | - * Free the parser and everything associated with it. | ||
42 | - */ | ||
43 | -void liteav_av_vorbis_parse_free(AVVorbisParseContext **s); | ||
44 | - | ||
45 | -#define VORBIS_FLAG_HEADER 0x00000001 | ||
46 | -#define VORBIS_FLAG_COMMENT 0x00000002 | ||
47 | -#define VORBIS_FLAG_SETUP 0x00000004 | ||
48 | - | ||
49 | -/** | ||
50 | - * Get the duration for a Vorbis packet. | ||
51 | - * | ||
52 | - * If @p flags is @c NULL, | ||
53 | - * special frames are considered invalid. | ||
54 | - * | ||
55 | - * @param s Vorbis parser context | ||
56 | - * @param buf buffer containing a Vorbis frame | ||
57 | - * @param buf_size size of the buffer | ||
58 | - * @param flags flags for special frames | ||
59 | - */ | ||
60 | -int liteav_av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf, | ||
61 | - int buf_size, int *flags); | ||
62 | - | ||
63 | -/** | ||
64 | - * Get the duration for a Vorbis packet. | ||
65 | - * | ||
66 | - * @param s Vorbis parser context | ||
67 | - * @param buf buffer containing a Vorbis frame | ||
68 | - * @param buf_size size of the buffer | ||
69 | - */ | ||
70 | -int liteav_av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf, | ||
71 | - int buf_size); | ||
72 | - | ||
73 | -void liteav_av_vorbis_parse_reset(AVVorbisParseContext *s); | ||
74 | - | ||
75 | -#endif /* AVCODEC_VORBIS_PARSER_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * Copyright (C) 2003 Ivan Kalvachev | ||
4 | - * | ||
5 | - * This file is part of FFmpeg. | ||
6 | - * | ||
7 | - * FFmpeg is free software; you can redistribute it and/or | ||
8 | - * modify it under the terms of the GNU Lesser General Public | ||
9 | - * License as published by the Free Software Foundation; either | ||
10 | - * version 2.1 of the License, or (at your option) any later version. | ||
11 | - * | ||
12 | - * FFmpeg is distributed in the hope that it will be useful, | ||
13 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | - * Lesser General Public License for more details. | ||
16 | - * | ||
17 | - * You should have received a copy of the GNU Lesser General Public | ||
18 | - * License along with FFmpeg; if not, write to the Free Software | ||
19 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
20 | - */ | ||
21 | - | ||
22 | -#ifndef AVCODEC_XVMC_H | ||
23 | -#define AVCODEC_XVMC_H | ||
24 | - | ||
25 | -/** | ||
26 | - * @file | ||
27 | - * @ingroup lavc_codec_hwaccel_xvmc | ||
28 | - * Public libavcodec XvMC header. | ||
29 | - */ | ||
30 | - | ||
31 | -#include <X11/extensions/XvMC.h> | ||
32 | - | ||
33 | -#include "libavutil/attributes.h" | ||
34 | -#include "version.h" | ||
35 | -#include "avcodec.h" | ||
36 | - | ||
37 | -/** | ||
38 | - * @defgroup lavc_codec_hwaccel_xvmc XvMC | ||
39 | - * @ingroup lavc_codec_hwaccel | ||
40 | - * | ||
41 | - * @{ | ||
42 | - */ | ||
43 | - | ||
44 | -#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct | ||
45 | - the number is 1337 speak for the letters IDCT MCo (motion compensation) */ | ||
46 | - | ||
47 | -struct attribute_deprecated xvmc_pix_fmt { | ||
48 | - /** The field contains the special constant value AV_XVMC_ID. | ||
49 | - It is used as a test that the application correctly uses the API, | ||
50 | - and that there is no corruption caused by pixel routines. | ||
51 | - - application - set during initialization | ||
52 | - - libavcodec - unchanged | ||
53 | - */ | ||
54 | - int xvmc_id; | ||
55 | - | ||
56 | - /** Pointer to the block array allocated by XvMCCreateBlocks(). | ||
57 | - The array has to be freed by XvMCDestroyBlocks(). | ||
58 | - Each group of 64 values represents one data block of differential | ||
59 | - pixel information (in MoCo mode) or coefficients for IDCT. | ||
60 | - - application - set the pointer during initialization | ||
61 | - - libavcodec - fills coefficients/pixel data into the array | ||
62 | - */ | ||
63 | - short* data_blocks; | ||
64 | - | ||
65 | - /** Pointer to the macroblock description array allocated by | ||
66 | - XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks(). | ||
67 | - - application - set the pointer during initialization | ||
68 | - - libavcodec - fills description data into the array | ||
69 | - */ | ||
70 | - XvMCMacroBlock* mv_blocks; | ||
71 | - | ||
72 | - /** Number of macroblock descriptions that can be stored in the mv_blocks | ||
73 | - array. | ||
74 | - - application - set during initialization | ||
75 | - - libavcodec - unchanged | ||
76 | - */ | ||
77 | - int allocated_mv_blocks; | ||
78 | - | ||
79 | - /** Number of blocks that can be stored at once in the data_blocks array. | ||
80 | - - application - set during initialization | ||
81 | - - libavcodec - unchanged | ||
82 | - */ | ||
83 | - int allocated_data_blocks; | ||
84 | - | ||
85 | - /** Indicate that the hardware would interpret data_blocks as IDCT | ||
86 | - coefficients and perform IDCT on them. | ||
87 | - - application - set during initialization | ||
88 | - - libavcodec - unchanged | ||
89 | - */ | ||
90 | - int idct; | ||
91 | - | ||
92 | - /** In MoCo mode it indicates that intra macroblocks are assumed to be in | ||
93 | - unsigned format; same as the XVMC_INTRA_UNSIGNED flag. | ||
94 | - - application - set during initialization | ||
95 | - - libavcodec - unchanged | ||
96 | - */ | ||
97 | - int unsigned_intra; | ||
98 | - | ||
99 | - /** Pointer to the surface allocated by XvMCCreateSurface(). | ||
100 | - It has to be freed by XvMCDestroySurface() on application exit. | ||
101 | - It identifies the frame and its state on the video hardware. | ||
102 | - - application - set during initialization | ||
103 | - - libavcodec - unchanged | ||
104 | - */ | ||
105 | - XvMCSurface* p_surface; | ||
106 | - | ||
107 | -/** Set by the decoder before calling liteav_ff_draw_horiz_band(), | ||
108 | - needed by the XvMCRenderSurface function. */ | ||
109 | -//@{ | ||
110 | - /** Pointer to the surface used as past reference | ||
111 | - - application - unchanged | ||
112 | - - libavcodec - set | ||
113 | - */ | ||
114 | - XvMCSurface* p_past_surface; | ||
115 | - | ||
116 | - /** Pointer to the surface used as future reference | ||
117 | - - application - unchanged | ||
118 | - - libavcodec - set | ||
119 | - */ | ||
120 | - XvMCSurface* p_future_surface; | ||
121 | - | ||
122 | - /** top/bottom field or frame | ||
123 | - - application - unchanged | ||
124 | - - libavcodec - set | ||
125 | - */ | ||
126 | - unsigned int picture_structure; | ||
127 | - | ||
128 | - /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence | ||
129 | - - application - unchanged | ||
130 | - - libavcodec - set | ||
131 | - */ | ||
132 | - unsigned int flags; | ||
133 | -//}@ | ||
134 | - | ||
135 | - /** Number of macroblock descriptions in the mv_blocks array | ||
136 | - that have already been passed to the hardware. | ||
137 | - - application - zeroes it on get_buffer(). | ||
138 | - A successful liteav_ff_draw_horiz_band() may increment it | ||
139 | - with filled_mb_block_num or zero both. | ||
140 | - - libavcodec - unchanged | ||
141 | - */ | ||
142 | - int start_mv_blocks_num; | ||
143 | - | ||
144 | - /** Number of new macroblock descriptions in the mv_blocks array (after | ||
145 | - start_mv_blocks_num) that are filled by libavcodec and have to be | ||
146 | - passed to the hardware. | ||
147 | - - application - zeroes it on get_buffer() or after successful | ||
148 | - liteav_ff_draw_horiz_band(). | ||
149 | - - libavcodec - increment with one of each stored MB | ||
150 | - */ | ||
151 | - int filled_mv_blocks_num; | ||
152 | - | ||
153 | - /** Number of the next free data block; one data block consists of | ||
154 | - 64 short values in the data_blocks array. | ||
155 | - All blocks before this one have already been claimed by placing their | ||
156 | - position into the corresponding block description structure field, | ||
157 | - that are part of the mv_blocks array. | ||
158 | - - application - zeroes it on get_buffer(). | ||
159 | - A successful liteav_ff_draw_horiz_band() may zero it together | ||
160 | - with start_mb_blocks_num. | ||
161 | - - libavcodec - each decoded macroblock increases it by the number | ||
162 | - of coded blocks it contains. | ||
163 | - */ | ||
164 | - int next_free_data_block_num; | ||
165 | -}; | ||
166 | - | ||
167 | -/** | ||
168 | - * @} | ||
169 | - */ | ||
170 | - | ||
171 | -#endif /* AVCODEC_XVMC_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * filter layer | ||
4 | - * Copyright (c) 2007 Bobby Bingham | ||
5 | - * | ||
6 | - * This file is part of FFmpeg. | ||
7 | - * | ||
8 | - * FFmpeg is free software; you can redistribute it and/or | ||
9 | - * modify it under the terms of the GNU Lesser General Public | ||
10 | - * License as published by the Free Software Foundation; either | ||
11 | - * version 2.1 of the License, or (at your option) any later version. | ||
12 | - * | ||
13 | - * FFmpeg is distributed in the hope that it will be useful, | ||
14 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | - * Lesser General Public License for more details. | ||
17 | - * | ||
18 | - * You should have received a copy of the GNU Lesser General Public | ||
19 | - * License along with FFmpeg; if not, write to the Free Software | ||
20 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | - */ | ||
22 | - | ||
23 | -#ifndef AVFILTER_AVFILTER_H | ||
24 | -#define AVFILTER_AVFILTER_H | ||
25 | - | ||
26 | -/** | ||
27 | - * @file | ||
28 | - * @ingroup lavfi | ||
29 | - * Main libavfilter public API header | ||
30 | - */ | ||
31 | - | ||
32 | -/** | ||
33 | - * @defgroup lavfi libavfilter | ||
34 | - * Graph-based frame editing library. | ||
35 | - * | ||
36 | - * @{ | ||
37 | - */ | ||
38 | - | ||
39 | -#include <stddef.h> | ||
40 | - | ||
41 | -#include "libavutil/attributes.h" | ||
42 | -#include "libavutil/avutil.h" | ||
43 | -#include "libavutil/buffer.h" | ||
44 | -#include "libavutil/dict.h" | ||
45 | -#include "libavutil/frame.h" | ||
46 | -#include "libavutil/log.h" | ||
47 | -#include "libavutil/samplefmt.h" | ||
48 | -#include "libavutil/pixfmt.h" | ||
49 | -#include "libavutil/rational.h" | ||
50 | - | ||
51 | -#include "libavfilter/version.h" | ||
52 | - | ||
53 | -/** | ||
54 | - * Return the LIBAVFILTER_VERSION_INT constant. | ||
55 | - */ | ||
56 | -unsigned liteav_avfilter_version(void); | ||
57 | - | ||
58 | -/** | ||
59 | - * Return the libavfilter build-time configuration. | ||
60 | - */ | ||
61 | -const char *liteav_avfilter_configuration(void); | ||
62 | - | ||
63 | -/** | ||
64 | - * Return the libavfilter license. | ||
65 | - */ | ||
66 | -const char *liteav_avfilter_license(void); | ||
67 | - | ||
68 | -typedef struct AVFilterContext AVFilterContext; | ||
69 | -typedef struct AVFilterLink AVFilterLink; | ||
70 | -typedef struct AVFilterPad AVFilterPad; | ||
71 | -typedef struct AVFilterFormats AVFilterFormats; | ||
72 | - | ||
73 | -/** | ||
74 | - * Get the number of elements in a NULL-terminated array of AVFilterPads (e.g. | ||
75 | - * AVFilter.inputs/outputs). | ||
76 | - */ | ||
77 | -int liteav_avfilter_pad_count(const AVFilterPad *pads); | ||
78 | - | ||
79 | -/** | ||
80 | - * Get the name of an AVFilterPad. | ||
81 | - * | ||
82 | - * @param pads an array of AVFilterPads | ||
83 | - * @param pad_idx index of the pad in the array it; is the caller's | ||
84 | - * responsibility to ensure the index is valid | ||
85 | - * | ||
86 | - * @return name of the pad_idx'th pad in pads | ||
87 | - */ | ||
88 | -const char *liteav_avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx); | ||
89 | - | ||
90 | -/** | ||
91 | - * Get the type of an AVFilterPad. | ||
92 | - * | ||
93 | - * @param pads an array of AVFilterPads | ||
94 | - * @param pad_idx index of the pad in the array; it is the caller's | ||
95 | - * responsibility to ensure the index is valid | ||
96 | - * | ||
97 | - * @return type of the pad_idx'th pad in pads | ||
98 | - */ | ||
99 | -enum AVMediaType liteav_avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); | ||
100 | - | ||
101 | -/** | ||
102 | - * The number of the filter inputs is not determined just by AVFilter.inputs. | ||
103 | - * The filter might add additional inputs during initialization depending on the | ||
104 | - * options supplied to it. | ||
105 | - */ | ||
106 | -#define AVFILTER_FLAG_DYNAMIC_INPUTS (1 << 0) | ||
107 | -/** | ||
108 | - * The number of the filter outputs is not determined just by AVFilter.outputs. | ||
109 | - * The filter might add additional outputs during initialization depending on | ||
110 | - * the options supplied to it. | ||
111 | - */ | ||
112 | -#define AVFILTER_FLAG_DYNAMIC_OUTPUTS (1 << 1) | ||
113 | -/** | ||
114 | - * The filter supports multithreading by splitting frames into multiple parts | ||
115 | - * and processing them concurrently. | ||
116 | - */ | ||
117 | -#define AVFILTER_FLAG_SLICE_THREADS (1 << 2) | ||
118 | -/** | ||
119 | - * Some filters support a generic "enable" expression option that can be used | ||
120 | - * to enable or disable a filter in the timeline. Filters supporting this | ||
121 | - * option have this flag set. When the enable expression is false, the default | ||
122 | - * no-op filter_frame() function is called in place of the filter_frame() | ||
123 | - * callback defined on each input pad, thus the frame is passed unchanged to | ||
124 | - * the next filters. | ||
125 | - */ | ||
126 | -#define AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC (1 << 16) | ||
127 | -/** | ||
128 | - * Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will | ||
129 | - * have its filter_frame() callback(s) called as usual even when the enable | ||
130 | - * expression is false. The filter will disable filtering within the | ||
131 | - * filter_frame() callback(s) itself, for example executing code depending on | ||
132 | - * the AVFilterContext->is_disabled value. | ||
133 | - */ | ||
134 | -#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL (1 << 17) | ||
135 | -/** | ||
136 | - * Handy mask to test whether the filter supports or no the timeline feature | ||
137 | - * (internally or generically). | ||
138 | - */ | ||
139 | -#define AVFILTER_FLAG_SUPPORT_TIMELINE (AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL) | ||
140 | - | ||
141 | -/** | ||
142 | - * Filter definition. This defines the pads a filter contains, and all the | ||
143 | - * callback functions used to interact with the filter. | ||
144 | - */ | ||
145 | -typedef struct AVFilter { | ||
146 | - /** | ||
147 | - * Filter name. Must be non-NULL and unique among filters. | ||
148 | - */ | ||
149 | - const char *name; | ||
150 | - | ||
151 | - /** | ||
152 | - * A description of the filter. May be NULL. | ||
153 | - * | ||
154 | - * You should use the NULL_IF_CONFIG_SMALL() macro to define it. | ||
155 | - */ | ||
156 | - const char *description; | ||
157 | - | ||
158 | - /** | ||
159 | - * List of inputs, terminated by a zeroed element. | ||
160 | - * | ||
161 | - * NULL if there are no (static) inputs. Instances of filters with | ||
162 | - * AVFILTER_FLAG_DYNAMIC_INPUTS set may have more inputs than present in | ||
163 | - * this list. | ||
164 | - */ | ||
165 | - const AVFilterPad *inputs; | ||
166 | - /** | ||
167 | - * List of outputs, terminated by a zeroed element. | ||
168 | - * | ||
169 | - * NULL if there are no (static) outputs. Instances of filters with | ||
170 | - * AVFILTER_FLAG_DYNAMIC_OUTPUTS set may have more outputs than present in | ||
171 | - * this list. | ||
172 | - */ | ||
173 | - const AVFilterPad *outputs; | ||
174 | - | ||
175 | - /** | ||
176 | - * A class for the private data, used to declare filter private AVOptions. | ||
177 | - * This field is NULL for filters that do not declare any options. | ||
178 | - * | ||
179 | - * If this field is non-NULL, the first member of the filter private data | ||
180 | - * must be a pointer to AVClass, which will be set by libavfilter generic | ||
181 | - * code to this class. | ||
182 | - */ | ||
183 | - const AVClass *priv_class; | ||
184 | - | ||
185 | - /** | ||
186 | - * A combination of AVFILTER_FLAG_* | ||
187 | - */ | ||
188 | - int flags; | ||
189 | - | ||
190 | - /***************************************************************** | ||
191 | - * All fields below this line are not part of the public API. They | ||
192 | - * may not be used outside of libavfilter and can be changed and | ||
193 | - * removed at will. | ||
194 | - * New public fields should be added right above. | ||
195 | - ***************************************************************** | ||
196 | - */ | ||
197 | - | ||
198 | - /** | ||
199 | - * Filter pre-initialization function | ||
200 | - * | ||
201 | - * This callback will be called immediately after the filter context is | ||
202 | - * allocated, to allow allocating and initing sub-objects. | ||
203 | - * | ||
204 | - * If this callback is not NULL, the uninit callback will be called on | ||
205 | - * allocation failure. | ||
206 | - * | ||
207 | - * @return 0 on success, | ||
208 | - * AVERROR code on failure (but the code will be | ||
209 | - * dropped and treated as ENOMEM by the calling code) | ||
210 | - */ | ||
211 | - int (*preinit)(AVFilterContext *ctx); | ||
212 | - | ||
213 | - /** | ||
214 | - * Filter initialization function. | ||
215 | - * | ||
216 | - * This callback will be called only once during the filter lifetime, after | ||
217 | - * all the options have been set, but before links between filters are | ||
218 | - * established and format negotiation is done. | ||
219 | - * | ||
220 | - * Basic filter initialization should be done here. Filters with dynamic | ||
221 | - * inputs and/or outputs should create those inputs/outputs here based on | ||
222 | - * provided options. No more changes to this filter's inputs/outputs can be | ||
223 | - * done after this callback. | ||
224 | - * | ||
225 | - * This callback must not assume that the filter links exist or frame | ||
226 | - * parameters are known. | ||
227 | - * | ||
228 | - * @ref AVFilter.uninit "uninit" is guaranteed to be called even if | ||
229 | - * initialization fails, so this callback does not have to clean up on | ||
230 | - * failure. | ||
231 | - * | ||
232 | - * @return 0 on success, a negative AVERROR on failure | ||
233 | - */ | ||
234 | - int (*init)(AVFilterContext *ctx); | ||
235 | - | ||
236 | - /** | ||
237 | - * Should be set instead of @ref AVFilter.init "init" by the filters that | ||
238 | - * want to pass a dictionary of AVOptions to nested contexts that are | ||
239 | - * allocated during init. | ||
240 | - * | ||
241 | - * On return, the options dict should be freed and replaced with one that | ||
242 | - * contains all the options which could not be processed by this filter (or | ||
243 | - * with NULL if all the options were processed). | ||
244 | - * | ||
245 | - * Otherwise the semantics is the same as for @ref AVFilter.init "init". | ||
246 | - */ | ||
247 | - int (*init_dict)(AVFilterContext *ctx, AVDictionary **options); | ||
248 | - | ||
249 | - /** | ||
250 | - * Filter uninitialization function. | ||
251 | - * | ||
252 | - * Called only once right before the filter is freed. Should deallocate any | ||
253 | - * memory held by the filter, release any buffer references, etc. It does | ||
254 | - * not need to deallocate the AVFilterContext.priv memory itself. | ||
255 | - * | ||
256 | - * This callback may be called even if @ref AVFilter.init "init" was not | ||
257 | - * called or failed, so it must be prepared to handle such a situation. | ||
258 | - */ | ||
259 | - void (*uninit)(AVFilterContext *ctx); | ||
260 | - | ||
261 | - /** | ||
262 | - * Query formats supported by the filter on its inputs and outputs. | ||
263 | - * | ||
264 | - * This callback is called after the filter is initialized (so the inputs | ||
265 | - * and outputs are fixed), shortly before the format negotiation. This | ||
266 | - * callback may be called more than once. | ||
267 | - * | ||
268 | - * This callback must set AVFilterLink.out_formats on every input link and | ||
269 | - * AVFilterLink.in_formats on every output link to a list of pixel/sample | ||
270 | - * formats that the filter supports on that link. For audio links, this | ||
271 | - * filter must also set @ref AVFilterLink.in_samplerates "in_samplerates" / | ||
272 | - * @ref AVFilterLink.out_samplerates "out_samplerates" and | ||
273 | - * @ref AVFilterLink.in_channel_layouts "in_channel_layouts" / | ||
274 | - * @ref AVFilterLink.out_channel_layouts "out_channel_layouts" analogously. | ||
275 | - * | ||
276 | - * This callback may be NULL for filters with one input, in which case | ||
277 | - * libavfilter assumes that it supports all input formats and preserves | ||
278 | - * them on output. | ||
279 | - * | ||
280 | - * @return zero on success, a negative value corresponding to an | ||
281 | - * AVERROR code otherwise | ||
282 | - */ | ||
283 | - int (*query_formats)(AVFilterContext *); | ||
284 | - | ||
285 | - int priv_size; ///< size of private data to allocate for the filter | ||
286 | - | ||
287 | - int flags_internal; ///< Additional flags for avfilter internal use only. | ||
288 | - | ||
289 | - /** | ||
290 | - * Used by the filter registration system. Must not be touched by any other | ||
291 | - * code. | ||
292 | - */ | ||
293 | - struct AVFilter *next; | ||
294 | - | ||
295 | - /** | ||
296 | - * Make the filter instance process a command. | ||
297 | - * | ||
298 | - * @param cmd the command to process, for handling simplicity all commands must be alphanumeric only | ||
299 | - * @param arg the argument for the command | ||
300 | - * @param res a buffer with size res_size where the filter(s) can return a response. This must not change when the command is not supported. | ||
301 | - * @param flags if AVFILTER_CMD_FLAG_FAST is set and the command would be | ||
302 | - * time consuming then a filter should treat it like an unsupported command | ||
303 | - * | ||
304 | - * @returns >=0 on success otherwise an error code. | ||
305 | - * AVERROR(ENOSYS) on unsupported commands | ||
306 | - */ | ||
307 | - int (*process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags); | ||
308 | - | ||
309 | - /** | ||
310 | - * Filter initialization function, alternative to the init() | ||
311 | - * callback. Args contains the user-supplied parameters, opaque is | ||
312 | - * used for providing binary data. | ||
313 | - */ | ||
314 | - int (*init_opaque)(AVFilterContext *ctx, void *opaque); | ||
315 | - | ||
316 | - /** | ||
317 | - * Filter activation function. | ||
318 | - * | ||
319 | - * Called when any processing is needed from the filter, instead of any | ||
320 | - * filter_frame and request_frame on pads. | ||
321 | - * | ||
322 | - * The function must examine inlinks and outlinks and perform a single | ||
323 | - * step of processing. If there is nothing to do, the function must do | ||
324 | - * nothing and not return an error. If more steps are or may be | ||
325 | - * possible, it must use liteav_ff_filter_set_ready() to schedule another | ||
326 | - * activation. | ||
327 | - */ | ||
328 | - int (*activate)(AVFilterContext *ctx); | ||
329 | -} AVFilter; | ||
330 | - | ||
331 | -/** | ||
332 | - * Process multiple parts of the frame concurrently. | ||
333 | - */ | ||
334 | -#define AVFILTER_THREAD_SLICE (1 << 0) | ||
335 | - | ||
336 | -typedef struct AVFilterInternal AVFilterInternal; | ||
337 | - | ||
338 | -/** An instance of a filter */ | ||
339 | -struct AVFilterContext { | ||
340 | - const AVClass *av_class; ///< needed for liteav_av_log() and filters common options | ||
341 | - | ||
342 | - const AVFilter *filter; ///< the AVFilter of which this is an instance | ||
343 | - | ||
344 | - char *name; ///< name of this filter instance | ||
345 | - | ||
346 | - AVFilterPad *input_pads; ///< array of input pads | ||
347 | - AVFilterLink **inputs; ///< array of pointers to input links | ||
348 | - unsigned nb_inputs; ///< number of input pads | ||
349 | - | ||
350 | - AVFilterPad *output_pads; ///< array of output pads | ||
351 | - AVFilterLink **outputs; ///< array of pointers to output links | ||
352 | - unsigned nb_outputs; ///< number of output pads | ||
353 | - | ||
354 | - void *priv; ///< private data for use by the filter | ||
355 | - | ||
356 | - struct AVFilterGraph *graph; ///< filtergraph this filter belongs to | ||
357 | - | ||
358 | - /** | ||
359 | - * Type of multithreading being allowed/used. A combination of | ||
360 | - * AVFILTER_THREAD_* flags. | ||
361 | - * | ||
362 | - * May be set by the caller before initializing the filter to forbid some | ||
363 | - * or all kinds of multithreading for this filter. The default is allowing | ||
364 | - * everything. | ||
365 | - * | ||
366 | - * When the filter is initialized, this field is combined using bit AND with | ||
367 | - * AVFilterGraph.thread_type to get the final mask used for determining | ||
368 | - * allowed threading types. I.e. a threading type needs to be set in both | ||
369 | - * to be allowed. | ||
370 | - * | ||
371 | - * After the filter is initialized, libavfilter sets this field to the | ||
372 | - * threading type that is actually used (0 for no multithreading). | ||
373 | - */ | ||
374 | - int thread_type; | ||
375 | - | ||
376 | - /** | ||
377 | - * An opaque struct for libavfilter internal use. | ||
378 | - */ | ||
379 | - AVFilterInternal *internal; | ||
380 | - | ||
381 | - struct AVFilterCommand *command_queue; | ||
382 | - | ||
383 | - char *enable_str; ///< enable expression string | ||
384 | - void *enable; ///< parsed expression (AVExpr*) | ||
385 | - double *var_values; ///< variable values for the enable expression | ||
386 | - int is_disabled; ///< the enabled state from the last expression evaluation | ||
387 | - | ||
388 | - /** | ||
389 | - * For filters which will create hardware frames, sets the device the | ||
390 | - * filter should create them in. All other filters will ignore this field: | ||
391 | - * in particular, a filter which consumes or processes hardware frames will | ||
392 | - * instead use the hw_frames_ctx field in AVFilterLink to carry the | ||
393 | - * hardware context information. | ||
394 | - */ | ||
395 | - AVBufferRef *hw_device_ctx; | ||
396 | - | ||
397 | - /** | ||
398 | - * Max number of threads allowed in this filter instance. | ||
399 | - * If <= 0, its value is ignored. | ||
400 | - * Overrides global number of threads set per filter graph. | ||
401 | - */ | ||
402 | - int nb_threads; | ||
403 | - | ||
404 | - /** | ||
405 | - * Ready status of the filter. | ||
406 | - * A non-0 value means that the filter needs activating; | ||
407 | - * a higher value suggests a more urgent activation. | ||
408 | - */ | ||
409 | - unsigned ready; | ||
410 | - | ||
411 | - /** | ||
412 | - * Sets the number of extra hardware frames which the filter will | ||
413 | - * allocate on its output links for use in following filters or by | ||
414 | - * the caller. | ||
415 | - * | ||
416 | - * Some hardware filters require all frames that they will use for | ||
417 | - * output to be defined in advance before filtering starts. For such | ||
418 | - * filters, any hardware frame pools used for output must therefore be | ||
419 | - * of fixed size. The extra frames set here are on top of any number | ||
420 | - * that the filter needs internally in order to operate normally. | ||
421 | - * | ||
422 | - * This field must be set before the graph containing this filter is | ||
423 | - * configured. | ||
424 | - */ | ||
425 | - int extra_hw_frames; | ||
426 | -}; | ||
427 | - | ||
428 | -/** | ||
429 | - * A link between two filters. This contains pointers to the source and | ||
430 | - * destination filters between which this link exists, and the indexes of | ||
431 | - * the pads involved. In addition, this link also contains the parameters | ||
432 | - * which have been negotiated and agreed upon between the filter, such as | ||
433 | - * image dimensions, format, etc. | ||
434 | - * | ||
435 | - * Applications must not normally access the link structure directly. | ||
436 | - * Use the buffersrc and buffersink API instead. | ||
437 | - * In the future, access to the header may be reserved for filters | ||
438 | - * implementation. | ||
439 | - */ | ||
440 | -struct AVFilterLink { | ||
441 | - AVFilterContext *src; ///< source filter | ||
442 | - AVFilterPad *srcpad; ///< output pad on the source filter | ||
443 | - | ||
444 | - AVFilterContext *dst; ///< dest filter | ||
445 | - AVFilterPad *dstpad; ///< input pad on the dest filter | ||
446 | - | ||
447 | - enum AVMediaType type; ///< filter media type | ||
448 | - | ||
449 | - /* These parameters apply only to video */ | ||
450 | - int w; ///< agreed upon image width | ||
451 | - int h; ///< agreed upon image height | ||
452 | - AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio | ||
453 | - /* These parameters apply only to audio */ | ||
454 | - uint64_t channel_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h) | ||
455 | - int sample_rate; ///< samples per second | ||
456 | - | ||
457 | - int format; ///< agreed upon media format | ||
458 | - | ||
459 | - /** | ||
460 | - * Define the time base used by the PTS of the frames/samples | ||
461 | - * which will pass through this link. | ||
462 | - * During the configuration stage, each filter is supposed to | ||
463 | - * change only the output timebase, while the timebase of the | ||
464 | - * input link is assumed to be an unchangeable property. | ||
465 | - */ | ||
466 | - AVRational time_base; | ||
467 | - | ||
468 | - /***************************************************************** | ||
469 | - * All fields below this line are not part of the public API. They | ||
470 | - * may not be used outside of libavfilter and can be changed and | ||
471 | - * removed at will. | ||
472 | - * New public fields should be added right above. | ||
473 | - ***************************************************************** | ||
474 | - */ | ||
475 | - /** | ||
476 | - * Lists of formats and channel layouts supported by the input and output | ||
477 | - * filters respectively. These lists are used for negotiating the format | ||
478 | - * to actually be used, which will be loaded into the format and | ||
479 | - * channel_layout members, above, when chosen. | ||
480 | - * | ||
481 | - */ | ||
482 | - AVFilterFormats *in_formats; | ||
483 | - AVFilterFormats *out_formats; | ||
484 | - | ||
485 | - /** | ||
486 | - * Lists of channel layouts and sample rates used for automatic | ||
487 | - * negotiation. | ||
488 | - */ | ||
489 | - AVFilterFormats *in_samplerates; | ||
490 | - AVFilterFormats *out_samplerates; | ||
491 | - struct AVFilterChannelLayouts *in_channel_layouts; | ||
492 | - struct AVFilterChannelLayouts *out_channel_layouts; | ||
493 | - | ||
494 | - /** | ||
495 | - * Audio only, the destination filter sets this to a non-zero value to | ||
496 | - * request that buffers with the given number of samples should be sent to | ||
497 | - * it. AVFilterPad.needs_fifo must also be set on the corresponding input | ||
498 | - * pad. | ||
499 | - * Last buffer before EOF will be padded with silence. | ||
500 | - */ | ||
501 | - int request_samples; | ||
502 | - | ||
503 | - /** stage of the initialization of the link properties (dimensions, etc) */ | ||
504 | - enum { | ||
505 | - AVLINK_UNINIT = 0, ///< not started | ||
506 | - AVLINK_STARTINIT, ///< started, but incomplete | ||
507 | - AVLINK_INIT ///< complete | ||
508 | - } init_state; | ||
509 | - | ||
510 | - /** | ||
511 | - * Graph the filter belongs to. | ||
512 | - */ | ||
513 | - struct AVFilterGraph *graph; | ||
514 | - | ||
515 | - /** | ||
516 | - * Current timestamp of the link, as defined by the most recent | ||
517 | - * frame(s), in link time_base units. | ||
518 | - */ | ||
519 | - int64_t current_pts; | ||
520 | - | ||
521 | - /** | ||
522 | - * Current timestamp of the link, as defined by the most recent | ||
523 | - * frame(s), in AV_TIME_BASE units. | ||
524 | - */ | ||
525 | - int64_t current_pts_us; | ||
526 | - | ||
527 | - /** | ||
528 | - * Index in the age array. | ||
529 | - */ | ||
530 | - int age_index; | ||
531 | - | ||
532 | - /** | ||
533 | - * Frame rate of the stream on the link, or 1/0 if unknown or variable; | ||
534 | - * if left to 0/0, will be automatically copied from the first input | ||
535 | - * of the source filter if it exists. | ||
536 | - * | ||
537 | - * Sources should set it to the best estimation of the real frame rate. | ||
538 | - * If the source frame rate is unknown or variable, set this to 1/0. | ||
539 | - * Filters should update it if necessary depending on their function. | ||
540 | - * Sinks can use it to set a default output frame rate. | ||
541 | - * It is similar to the r_frame_rate field in AVStream. | ||
542 | - */ | ||
543 | - AVRational frame_rate; | ||
544 | - | ||
545 | - /** | ||
546 | - * Buffer partially filled with samples to achieve a fixed/minimum size. | ||
547 | - */ | ||
548 | - AVFrame *partial_buf; | ||
549 | - | ||
550 | - /** | ||
551 | - * Size of the partial buffer to allocate. | ||
552 | - * Must be between min_samples and max_samples. | ||
553 | - */ | ||
554 | - int partial_buf_size; | ||
555 | - | ||
556 | - /** | ||
557 | - * Minimum number of samples to filter at once. If filter_frame() is | ||
558 | - * called with fewer samples, it will accumulate them in partial_buf. | ||
559 | - * This field and the related ones must not be changed after filtering | ||
560 | - * has started. | ||
561 | - * If 0, all related fields are ignored. | ||
562 | - */ | ||
563 | - int min_samples; | ||
564 | - | ||
565 | - /** | ||
566 | - * Maximum number of samples to filter at once. If filter_frame() is | ||
567 | - * called with more samples, it will split them. | ||
568 | - */ | ||
569 | - int max_samples; | ||
570 | - | ||
571 | - /** | ||
572 | - * Number of channels. | ||
573 | - */ | ||
574 | - int channels; | ||
575 | - | ||
576 | - /** | ||
577 | - * Link processing flags. | ||
578 | - */ | ||
579 | - unsigned flags; | ||
580 | - | ||
581 | - /** | ||
582 | - * Number of past frames sent through the link. | ||
583 | - */ | ||
584 | - int64_t frame_count_in, frame_count_out; | ||
585 | - | ||
586 | - /** | ||
587 | - * A pointer to a FFFramePool struct. | ||
588 | - */ | ||
589 | - void *frame_pool; | ||
590 | - | ||
591 | - /** | ||
592 | - * True if a frame is currently wanted on the output of this filter. | ||
593 | - * Set when liteav_ff_request_frame() is called by the output, | ||
594 | - * cleared when a frame is filtered. | ||
595 | - */ | ||
596 | - int frame_wanted_out; | ||
597 | - | ||
598 | - /** | ||
599 | - * For hwaccel pixel formats, this should be a reference to the | ||
600 | - * AVHWFramesContext describing the frames. | ||
601 | - */ | ||
602 | - AVBufferRef *hw_frames_ctx; | ||
603 | - | ||
604 | -#ifndef FF_INTERNAL_FIELDS | ||
605 | - | ||
606 | - /** | ||
607 | - * Internal structure members. | ||
608 | - * The fields below this limit are internal for libavfilter's use | ||
609 | - * and must in no way be accessed by applications. | ||
610 | - */ | ||
611 | - char reserved[0xF000]; | ||
612 | - | ||
613 | -#else /* FF_INTERNAL_FIELDS */ | ||
614 | - | ||
615 | - /** | ||
616 | - * Queue of frames waiting to be filtered. | ||
617 | - */ | ||
618 | - FFFrameQueue fifo; | ||
619 | - | ||
620 | - /** | ||
621 | - * If set, the source filter can not generate a frame as is. | ||
622 | - * The goal is to avoid repeatedly calling the request_frame() method on | ||
623 | - * the same link. | ||
624 | - */ | ||
625 | - int frame_blocked_in; | ||
626 | - | ||
627 | - /** | ||
628 | - * Link input status. | ||
629 | - * If not zero, all attempts of filter_frame will fail with the | ||
630 | - * corresponding code. | ||
631 | - */ | ||
632 | - int status_in; | ||
633 | - | ||
634 | - /** | ||
635 | - * Timestamp of the input status change. | ||
636 | - */ | ||
637 | - int64_t status_in_pts; | ||
638 | - | ||
639 | - /** | ||
640 | - * Link output status. | ||
641 | - * If not zero, all attempts of request_frame will fail with the | ||
642 | - * corresponding code. | ||
643 | - */ | ||
644 | - int status_out; | ||
645 | - | ||
646 | -#endif /* FF_INTERNAL_FIELDS */ | ||
647 | - | ||
648 | -}; | ||
649 | - | ||
650 | -/** | ||
651 | - * Link two filters together. | ||
652 | - * | ||
653 | - * @param src the source filter | ||
654 | - * @param srcpad index of the output pad on the source filter | ||
655 | - * @param dst the destination filter | ||
656 | - * @param dstpad index of the input pad on the destination filter | ||
657 | - * @return zero on success | ||
658 | - */ | ||
659 | -int liteav_avfilter_link(AVFilterContext *src, unsigned srcpad, | ||
660 | - AVFilterContext *dst, unsigned dstpad); | ||
661 | - | ||
662 | -/** | ||
663 | - * Free the link in *link, and set its pointer to NULL. | ||
664 | - */ | ||
665 | -void liteav_avfilter_link_free(AVFilterLink **link); | ||
666 | - | ||
667 | -#if FF_API_FILTER_GET_SET | ||
668 | -/** | ||
669 | - * Get the number of channels of a link. | ||
670 | - * @deprecated Use liteav_av_buffersink_get_channels() | ||
671 | - */ | ||
672 | -attribute_deprecated | ||
673 | -int liteav_avfilter_link_get_channels(AVFilterLink *link); | ||
674 | -#endif | ||
675 | - | ||
676 | -/** | ||
677 | - * Set the closed field of a link. | ||
678 | - * @deprecated applications are not supposed to mess with links, they should | ||
679 | - * close the sinks. | ||
680 | - */ | ||
681 | -attribute_deprecated | ||
682 | -void liteav_avfilter_link_set_closed(AVFilterLink *link, int closed); | ||
683 | - | ||
684 | -/** | ||
685 | - * Negotiate the media format, dimensions, etc of all inputs to a filter. | ||
686 | - * | ||
687 | - * @param filter the filter to negotiate the properties for its inputs | ||
688 | - * @return zero on successful negotiation | ||
689 | - */ | ||
690 | -int liteav_avfilter_config_links(AVFilterContext *filter); | ||
691 | - | ||
692 | -#define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically | ||
693 | -#define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw) | ||
694 | - | ||
695 | -/** | ||
696 | - * Make the filter instance process a command. | ||
697 | - * It is recommended to use liteav_avfilter_graph_send_command(). | ||
698 | - */ | ||
699 | -int liteav_avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags); | ||
700 | - | ||
701 | -/** | ||
702 | - * Iterate over all registered filters. | ||
703 | - * | ||
704 | - * @param opaque a pointer where libavfilter will store the iteration state. Must | ||
705 | - * point to NULL to start the iteration. | ||
706 | - * | ||
707 | - * @return the next registered filter or NULL when the iteration is | ||
708 | - * finished | ||
709 | - */ | ||
710 | -const AVFilter *liteav_av_filter_iterate(void **opaque); | ||
711 | - | ||
712 | -#if FF_API_NEXT | ||
713 | -/** Initialize the filter system. Register all builtin filters. */ | ||
714 | -attribute_deprecated | ||
715 | -void liteav_avfilter_register_all(void); | ||
716 | - | ||
717 | -/** | ||
718 | - * Register a filter. This is only needed if you plan to use | ||
719 | - * liteav_avfilter_get_by_name later to lookup the AVFilter structure by name. A | ||
720 | - * filter can still by instantiated with liteav_avfilter_graph_alloc_filter even if it | ||
721 | - * is not registered. | ||
722 | - * | ||
723 | - * @param filter the filter to register | ||
724 | - * @return 0 if the registration was successful, a negative value | ||
725 | - * otherwise | ||
726 | - */ | ||
727 | -attribute_deprecated | ||
728 | -int liteav_avfilter_register(AVFilter *filter); | ||
729 | - | ||
730 | -/** | ||
731 | - * Iterate over all registered filters. | ||
732 | - * @return If prev is non-NULL, next registered filter after prev or NULL if | ||
733 | - * prev is the last filter. If prev is NULL, return the first registered filter. | ||
734 | - */ | ||
735 | -attribute_deprecated | ||
736 | -const AVFilter *liteav_avfilter_next(const AVFilter *prev); | ||
737 | -#endif | ||
738 | - | ||
739 | -/** | ||
740 | - * Get a filter definition matching the given name. | ||
741 | - * | ||
742 | - * @param name the filter name to find | ||
743 | - * @return the filter definition, if any matching one is registered. | ||
744 | - * NULL if none found. | ||
745 | - */ | ||
746 | -const AVFilter *liteav_avfilter_get_by_name(const char *name); | ||
747 | - | ||
748 | - | ||
749 | -/** | ||
750 | - * Initialize a filter with the supplied parameters. | ||
751 | - * | ||
752 | - * @param ctx uninitialized filter context to initialize | ||
753 | - * @param args Options to initialize the filter with. This must be a | ||
754 | - * ':'-separated list of options in the 'key=value' form. | ||
755 | - * May be NULL if the options have been set directly using the | ||
756 | - * AVOptions API or there are no options that need to be set. | ||
757 | - * @return 0 on success, a negative AVERROR on failure | ||
758 | - */ | ||
759 | -int liteav_avfilter_init_str(AVFilterContext *ctx, const char *args); | ||
760 | - | ||
761 | -/** | ||
762 | - * Initialize a filter with the supplied dictionary of options. | ||
763 | - * | ||
764 | - * @param ctx uninitialized filter context to initialize | ||
765 | - * @param options An AVDictionary filled with options for this filter. On | ||
766 | - * return this parameter will be destroyed and replaced with | ||
767 | - * a dict containing options that were not found. This dictionary | ||
768 | - * must be freed by the caller. | ||
769 | - * May be NULL, then this function is equivalent to | ||
770 | - * liteav_avfilter_init_str() with the second parameter set to NULL. | ||
771 | - * @return 0 on success, a negative AVERROR on failure | ||
772 | - * | ||
773 | - * @note This function and liteav_avfilter_init_str() do essentially the same thing, | ||
774 | - * the difference is in manner in which the options are passed. It is up to the | ||
775 | - * calling code to choose whichever is more preferable. The two functions also | ||
776 | - * behave differently when some of the provided options are not declared as | ||
777 | - * supported by the filter. In such a case, liteav_avfilter_init_str() will fail, but | ||
778 | - * this function will leave those extra options in the options AVDictionary and | ||
779 | - * continue as usual. | ||
780 | - */ | ||
781 | -int liteav_avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options); | ||
782 | - | ||
783 | -/** | ||
784 | - * Free a filter context. This will also remove the filter from its | ||
785 | - * filtergraph's list of filters. | ||
786 | - * | ||
787 | - * @param filter the filter to free | ||
788 | - */ | ||
789 | -void liteav_avfilter_free(AVFilterContext *filter); | ||
790 | - | ||
791 | -/** | ||
792 | - * Insert a filter in the middle of an existing link. | ||
793 | - * | ||
794 | - * @param link the link into which the filter should be inserted | ||
795 | - * @param filt the filter to be inserted | ||
796 | - * @param filt_srcpad_idx the input pad on the filter to connect | ||
797 | - * @param filt_dstpad_idx the output pad on the filter to connect | ||
798 | - * @return zero on success | ||
799 | - */ | ||
800 | -int liteav_avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, | ||
801 | - unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); | ||
802 | - | ||
803 | -/** | ||
804 | - * @return AVClass for AVFilterContext. | ||
805 | - * | ||
806 | - * @see liteav_av_opt_find(). | ||
807 | - */ | ||
808 | -const AVClass *liteav_avfilter_get_class(void); | ||
809 | - | ||
810 | -typedef struct AVFilterGraphInternal AVFilterGraphInternal; | ||
811 | - | ||
812 | -/** | ||
813 | - * A function pointer passed to the @ref AVFilterGraph.execute callback to be | ||
814 | - * executed multiple times, possibly in parallel. | ||
815 | - * | ||
816 | - * @param ctx the filter context the job belongs to | ||
817 | - * @param arg an opaque parameter passed through from @ref | ||
818 | - * AVFilterGraph.execute | ||
819 | - * @param jobnr the index of the job being executed | ||
820 | - * @param nb_jobs the total number of jobs | ||
821 | - * | ||
822 | - * @return 0 on success, a negative AVERROR on error | ||
823 | - */ | ||
824 | -typedef int (avfilter_action_func)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); | ||
825 | - | ||
826 | -/** | ||
827 | - * A function executing multiple jobs, possibly in parallel. | ||
828 | - * | ||
829 | - * @param ctx the filter context to which the jobs belong | ||
830 | - * @param func the function to be called multiple times | ||
831 | - * @param arg the argument to be passed to func | ||
832 | - * @param ret a nb_jobs-sized array to be filled with return values from each | ||
833 | - * invocation of func | ||
834 | - * @param nb_jobs the number of jobs to execute | ||
835 | - * | ||
836 | - * @return 0 on success, a negative AVERROR on error | ||
837 | - */ | ||
838 | -typedef int (avfilter_execute_func)(AVFilterContext *ctx, avfilter_action_func *func, | ||
839 | - void *arg, int *ret, int nb_jobs); | ||
840 | - | ||
841 | -typedef struct AVFilterGraph { | ||
842 | - const AVClass *av_class; | ||
843 | - AVFilterContext **filters; | ||
844 | - unsigned nb_filters; | ||
845 | - | ||
846 | - char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters | ||
847 | -#if FF_API_LAVR_OPTS | ||
848 | - attribute_deprecated char *resample_lavr_opts; ///< libavresample options to use for the auto-inserted resample filters | ||
849 | -#endif | ||
850 | - | ||
851 | - /** | ||
852 | - * Type of multithreading allowed for filters in this graph. A combination | ||
853 | - * of AVFILTER_THREAD_* flags. | ||
854 | - * | ||
855 | - * May be set by the caller at any point, the setting will apply to all | ||
856 | - * filters initialized after that. The default is allowing everything. | ||
857 | - * | ||
858 | - * When a filter in this graph is initialized, this field is combined using | ||
859 | - * bit AND with AVFilterContext.thread_type to get the final mask used for | ||
860 | - * determining allowed threading types. I.e. a threading type needs to be | ||
861 | - * set in both to be allowed. | ||
862 | - */ | ||
863 | - int thread_type; | ||
864 | - | ||
865 | - /** | ||
866 | - * Maximum number of threads used by filters in this graph. May be set by | ||
867 | - * the caller before adding any filters to the filtergraph. Zero (the | ||
868 | - * default) means that the number of threads is determined automatically. | ||
869 | - */ | ||
870 | - int nb_threads; | ||
871 | - | ||
872 | - /** | ||
873 | - * Opaque object for libavfilter internal use. | ||
874 | - */ | ||
875 | - AVFilterGraphInternal *internal; | ||
876 | - | ||
877 | - /** | ||
878 | - * Opaque user data. May be set by the caller to an arbitrary value, e.g. to | ||
879 | - * be used from callbacks like @ref AVFilterGraph.execute. | ||
880 | - * Libavfilter will not touch this field in any way. | ||
881 | - */ | ||
882 | - void *opaque; | ||
883 | - | ||
884 | - /** | ||
885 | - * This callback may be set by the caller immediately after allocating the | ||
886 | - * graph and before adding any filters to it, to provide a custom | ||
887 | - * multithreading implementation. | ||
888 | - * | ||
889 | - * If set, filters with slice threading capability will call this callback | ||
890 | - * to execute multiple jobs in parallel. | ||
891 | - * | ||
892 | - * If this field is left unset, libavfilter will use its internal | ||
893 | - * implementation, which may or may not be multithreaded depending on the | ||
894 | - * platform and build options. | ||
895 | - */ | ||
896 | - avfilter_execute_func *execute; | ||
897 | - | ||
898 | - char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions | ||
899 | - | ||
900 | - /** | ||
901 | - * Private fields | ||
902 | - * | ||
903 | - * The following fields are for internal use only. | ||
904 | - * Their type, offset, number and semantic can change without notice. | ||
905 | - */ | ||
906 | - | ||
907 | - AVFilterLink **sink_links; | ||
908 | - int sink_links_count; | ||
909 | - | ||
910 | - unsigned disable_auto_convert; | ||
911 | -} AVFilterGraph; | ||
912 | - | ||
913 | -/** | ||
914 | - * Allocate a filter graph. | ||
915 | - * | ||
916 | - * @return the allocated filter graph on success or NULL. | ||
917 | - */ | ||
918 | -AVFilterGraph *liteav_avfilter_graph_alloc(void); | ||
919 | - | ||
920 | -/** | ||
921 | - * Create a new filter instance in a filter graph. | ||
922 | - * | ||
923 | - * @param graph graph in which the new filter will be used | ||
924 | - * @param filter the filter to create an instance of | ||
925 | - * @param name Name to give to the new instance (will be copied to | ||
926 | - * AVFilterContext.name). This may be used by the caller to identify | ||
927 | - * different filters, libavfilter itself assigns no semantics to | ||
928 | - * this parameter. May be NULL. | ||
929 | - * | ||
930 | - * @return the context of the newly created filter instance (note that it is | ||
931 | - * also retrievable directly through AVFilterGraph.filters or with | ||
932 | - * liteav_avfilter_graph_get_filter()) on success or NULL on failure. | ||
933 | - */ | ||
934 | -AVFilterContext *liteav_avfilter_graph_alloc_filter(AVFilterGraph *graph, | ||
935 | - const AVFilter *filter, | ||
936 | - const char *name); | ||
937 | - | ||
938 | -/** | ||
939 | - * Get a filter instance identified by instance name from graph. | ||
940 | - * | ||
941 | - * @param graph filter graph to search through. | ||
942 | - * @param name filter instance name (should be unique in the graph). | ||
943 | - * @return the pointer to the found filter instance or NULL if it | ||
944 | - * cannot be found. | ||
945 | - */ | ||
946 | -AVFilterContext *liteav_avfilter_graph_get_filter(AVFilterGraph *graph, const char *name); | ||
947 | - | ||
948 | -/** | ||
949 | - * Create and add a filter instance into an existing graph. | ||
950 | - * The filter instance is created from the filter filt and inited | ||
951 | - * with the parameters args and opaque. | ||
952 | - * | ||
953 | - * In case of success put in *filt_ctx the pointer to the created | ||
954 | - * filter instance, otherwise set *filt_ctx to NULL. | ||
955 | - * | ||
956 | - * @param name the instance name to give to the created filter instance | ||
957 | - * @param graph_ctx the filter graph | ||
958 | - * @return a negative AVERROR error code in case of failure, a non | ||
959 | - * negative value otherwise | ||
960 | - */ | ||
961 | -int liteav_avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt, | ||
962 | - const char *name, const char *args, void *opaque, | ||
963 | - AVFilterGraph *graph_ctx); | ||
964 | - | ||
965 | -/** | ||
966 | - * Enable or disable automatic format conversion inside the graph. | ||
967 | - * | ||
968 | - * Note that format conversion can still happen inside explicitly inserted | ||
969 | - * scale and aresample filters. | ||
970 | - * | ||
971 | - * @param flags any of the AVFILTER_AUTO_CONVERT_* constants | ||
972 | - */ | ||
973 | -void liteav_avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags); | ||
974 | - | ||
975 | -enum { | ||
976 | - AVFILTER_AUTO_CONVERT_ALL = 0, /**< all automatic conversions enabled */ | ||
977 | - AVFILTER_AUTO_CONVERT_NONE = -1, /**< all automatic conversions disabled */ | ||
978 | -}; | ||
979 | - | ||
980 | -/** | ||
981 | - * Check validity and configure all the links and formats in the graph. | ||
982 | - * | ||
983 | - * @param graphctx the filter graph | ||
984 | - * @param log_ctx context used for logging | ||
985 | - * @return >= 0 in case of success, a negative AVERROR code otherwise | ||
986 | - */ | ||
987 | -int liteav_avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx); | ||
988 | - | ||
989 | -/** | ||
990 | - * Free a graph, destroy its links, and set *graph to NULL. | ||
991 | - * If *graph is NULL, do nothing. | ||
992 | - */ | ||
993 | -void liteav_avfilter_graph_free(AVFilterGraph **graph); | ||
994 | - | ||
995 | -/** | ||
996 | - * A linked-list of the inputs/outputs of the filter chain. | ||
997 | - * | ||
998 | - * This is mainly useful for liteav_avfilter_graph_parse() / liteav_avfilter_graph_parse2(), | ||
999 | - * where it is used to communicate open (unlinked) inputs and outputs from and | ||
1000 | - * to the caller. | ||
1001 | - * This struct specifies, per each not connected pad contained in the graph, the | ||
1002 | - * filter context and the pad index required for establishing a link. | ||
1003 | - */ | ||
1004 | -typedef struct AVFilterInOut { | ||
1005 | - /** unique name for this input/output in the list */ | ||
1006 | - char *name; | ||
1007 | - | ||
1008 | - /** filter context associated to this input/output */ | ||
1009 | - AVFilterContext *filter_ctx; | ||
1010 | - | ||
1011 | - /** index of the filt_ctx pad to use for linking */ | ||
1012 | - int pad_idx; | ||
1013 | - | ||
1014 | - /** next input/input in the list, NULL if this is the last */ | ||
1015 | - struct AVFilterInOut *next; | ||
1016 | -} AVFilterInOut; | ||
1017 | - | ||
1018 | -/** | ||
1019 | - * Allocate a single AVFilterInOut entry. | ||
1020 | - * Must be freed with liteav_avfilter_inout_free(). | ||
1021 | - * @return allocated AVFilterInOut on success, NULL on failure. | ||
1022 | - */ | ||
1023 | -AVFilterInOut *liteav_avfilter_inout_alloc(void); | ||
1024 | - | ||
1025 | -/** | ||
1026 | - * Free the supplied list of AVFilterInOut and set *inout to NULL. | ||
1027 | - * If *inout is NULL, do nothing. | ||
1028 | - */ | ||
1029 | -void liteav_avfilter_inout_free(AVFilterInOut **inout); | ||
1030 | - | ||
1031 | -/** | ||
1032 | - * Add a graph described by a string to a graph. | ||
1033 | - * | ||
1034 | - * @note The caller must provide the lists of inputs and outputs, | ||
1035 | - * which therefore must be known before calling the function. | ||
1036 | - * | ||
1037 | - * @note The inputs parameter describes inputs of the already existing | ||
1038 | - * part of the graph; i.e. from the point of view of the newly created | ||
1039 | - * part, they are outputs. Similarly the outputs parameter describes | ||
1040 | - * outputs of the already existing filters, which are provided as | ||
1041 | - * inputs to the parsed filters. | ||
1042 | - * | ||
1043 | - * @param graph the filter graph where to link the parsed graph context | ||
1044 | - * @param filters string to be parsed | ||
1045 | - * @param inputs linked list to the inputs of the graph | ||
1046 | - * @param outputs linked list to the outputs of the graph | ||
1047 | - * @return zero on success, a negative AVERROR code on error | ||
1048 | - */ | ||
1049 | -int liteav_avfilter_graph_parse(AVFilterGraph *graph, const char *filters, | ||
1050 | - AVFilterInOut *inputs, AVFilterInOut *outputs, | ||
1051 | - void *log_ctx); | ||
1052 | - | ||
1053 | -/** | ||
1054 | - * Add a graph described by a string to a graph. | ||
1055 | - * | ||
1056 | - * In the graph filters description, if the input label of the first | ||
1057 | - * filter is not specified, "in" is assumed; if the output label of | ||
1058 | - * the last filter is not specified, "out" is assumed. | ||
1059 | - * | ||
1060 | - * @param graph the filter graph where to link the parsed graph context | ||
1061 | - * @param filters string to be parsed | ||
1062 | - * @param inputs pointer to a linked list to the inputs of the graph, may be NULL. | ||
1063 | - * If non-NULL, *inputs is updated to contain the list of open inputs | ||
1064 | - * after the parsing, should be freed with liteav_avfilter_inout_free(). | ||
1065 | - * @param outputs pointer to a linked list to the outputs of the graph, may be NULL. | ||
1066 | - * If non-NULL, *outputs is updated to contain the list of open outputs | ||
1067 | - * after the parsing, should be freed with liteav_avfilter_inout_free(). | ||
1068 | - * @return non negative on success, a negative AVERROR code on error | ||
1069 | - */ | ||
1070 | -int liteav_avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters, | ||
1071 | - AVFilterInOut **inputs, AVFilterInOut **outputs, | ||
1072 | - void *log_ctx); | ||
1073 | - | ||
1074 | -/** | ||
1075 | - * Add a graph described by a string to a graph. | ||
1076 | - * | ||
1077 | - * @param[in] graph the filter graph where to link the parsed graph context | ||
1078 | - * @param[in] filters string to be parsed | ||
1079 | - * @param[out] inputs a linked list of all free (unlinked) inputs of the | ||
1080 | - * parsed graph will be returned here. It is to be freed | ||
1081 | - * by the caller using liteav_avfilter_inout_free(). | ||
1082 | - * @param[out] outputs a linked list of all free (unlinked) outputs of the | ||
1083 | - * parsed graph will be returned here. It is to be freed by the | ||
1084 | - * caller using liteav_avfilter_inout_free(). | ||
1085 | - * @return zero on success, a negative AVERROR code on error | ||
1086 | - * | ||
1087 | - * @note This function returns the inputs and outputs that are left | ||
1088 | - * unlinked after parsing the graph and the caller then deals with | ||
1089 | - * them. | ||
1090 | - * @note This function makes no reference whatsoever to already | ||
1091 | - * existing parts of the graph and the inputs parameter will on return | ||
1092 | - * contain inputs of the newly parsed part of the graph. Analogously | ||
1093 | - * the outputs parameter will contain outputs of the newly created | ||
1094 | - * filters. | ||
1095 | - */ | ||
1096 | -int liteav_avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, | ||
1097 | - AVFilterInOut **inputs, | ||
1098 | - AVFilterInOut **outputs); | ||
1099 | - | ||
1100 | -/** | ||
1101 | - * Send a command to one or more filter instances. | ||
1102 | - * | ||
1103 | - * @param graph the filter graph | ||
1104 | - * @param target the filter(s) to which the command should be sent | ||
1105 | - * "all" sends to all filters | ||
1106 | - * otherwise it can be a filter or filter instance name | ||
1107 | - * which will send the command to all matching filters. | ||
1108 | - * @param cmd the command to send, for handling simplicity all commands must be alphanumeric only | ||
1109 | - * @param arg the argument for the command | ||
1110 | - * @param res a buffer with size res_size where the filter(s) can return a response. | ||
1111 | - * | ||
1112 | - * @returns >=0 on success otherwise an error code. | ||
1113 | - * AVERROR(ENOSYS) on unsupported commands | ||
1114 | - */ | ||
1115 | -int liteav_avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags); | ||
1116 | - | ||
1117 | -/** | ||
1118 | - * Queue a command for one or more filter instances. | ||
1119 | - * | ||
1120 | - * @param graph the filter graph | ||
1121 | - * @param target the filter(s) to which the command should be sent | ||
1122 | - * "all" sends to all filters | ||
1123 | - * otherwise it can be a filter or filter instance name | ||
1124 | - * which will send the command to all matching filters. | ||
1125 | - * @param cmd the command to sent, for handling simplicity all commands must be alphanumeric only | ||
1126 | - * @param arg the argument for the command | ||
1127 | - * @param ts time at which the command should be sent to the filter | ||
1128 | - * | ||
1129 | - * @note As this executes commands after this function returns, no return code | ||
1130 | - * from the filter is provided, also AVFILTER_CMD_FLAG_ONE is not supported. | ||
1131 | - */ | ||
1132 | -int liteav_avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, int flags, double ts); | ||
1133 | - | ||
1134 | - | ||
1135 | -/** | ||
1136 | - * Dump a graph into a human-readable string representation. | ||
1137 | - * | ||
1138 | - * @param graph the graph to dump | ||
1139 | - * @param options formatting options; currently ignored | ||
1140 | - * @return a string, or NULL in case of memory allocation failure; | ||
1141 | - * the string must be freed using liteav_av_free | ||
1142 | - */ | ||
1143 | -char *liteav_avfilter_graph_dump(AVFilterGraph *graph, const char *options); | ||
1144 | - | ||
1145 | -/** | ||
1146 | - * Request a frame on the oldest sink link. | ||
1147 | - * | ||
1148 | - * If the request returns AVERROR_EOF, try the next. | ||
1149 | - * | ||
1150 | - * Note that this function is not meant to be the sole scheduling mechanism | ||
1151 | - * of a filtergraph, only a convenience function to help drain a filtergraph | ||
1152 | - * in a balanced way under normal circumstances. | ||
1153 | - * | ||
1154 | - * Also note that AVERROR_EOF does not mean that frames did not arrive on | ||
1155 | - * some of the sinks during the process. | ||
1156 | - * When there are multiple sink links, in case the requested link | ||
1157 | - * returns an EOF, this may cause a filter to flush pending frames | ||
1158 | - * which are sent to another sink link, although unrequested. | ||
1159 | - * | ||
1160 | - * @return the return value of liteav_ff_request_frame(), | ||
1161 | - * or AVERROR_EOF if all links returned AVERROR_EOF | ||
1162 | - */ | ||
1163 | -int liteav_avfilter_graph_request_oldest(AVFilterGraph *graph); | ||
1164 | - | ||
1165 | -/** | ||
1166 | - * @} | ||
1167 | - */ | ||
1168 | - | ||
1169 | -#endif /* AVFILTER_AVFILTER_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -#ifndef AVFILTER_BUFFERSINK_H | ||
21 | -#define AVFILTER_BUFFERSINK_H | ||
22 | - | ||
23 | -/** | ||
24 | - * @file | ||
25 | - * @ingroup lavfi_buffersink | ||
26 | - * memory buffer sink API for audio and video | ||
27 | - */ | ||
28 | - | ||
29 | -#include "avfilter.h" | ||
30 | - | ||
31 | -/** | ||
32 | - * @defgroup lavfi_buffersink Buffer sink API | ||
33 | - * @ingroup lavfi | ||
34 | - * @{ | ||
35 | - */ | ||
36 | - | ||
37 | -/** | ||
38 | - * Get a frame with filtered data from sink and put it in frame. | ||
39 | - * | ||
40 | - * @param ctx pointer to a buffersink or abuffersink filter context. | ||
41 | - * @param frame pointer to an allocated frame that will be filled with data. | ||
42 | - * The data must be freed using liteav_av_frame_unref() / liteav_av_frame_free() | ||
43 | - * @param flags a combination of AV_BUFFERSINK_FLAG_* flags | ||
44 | - * | ||
45 | - * @return >= 0 in for success, a negative AVERROR code for failure. | ||
46 | - */ | ||
47 | -int liteav_av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags); | ||
48 | - | ||
49 | -/** | ||
50 | - * Tell av_buffersink_get_buffer_ref() to read video/samples buffer | ||
51 | - * reference, but not remove it from the buffer. This is useful if you | ||
52 | - * need only to read a video/samples buffer, without to fetch it. | ||
53 | - */ | ||
54 | -#define AV_BUFFERSINK_FLAG_PEEK 1 | ||
55 | - | ||
56 | -/** | ||
57 | - * Tell av_buffersink_get_buffer_ref() not to request a frame from its input. | ||
58 | - * If a frame is already buffered, it is read (and removed from the buffer), | ||
59 | - * but if no frame is present, return AVERROR(EAGAIN). | ||
60 | - */ | ||
61 | -#define AV_BUFFERSINK_FLAG_NO_REQUEST 2 | ||
62 | - | ||
63 | -/** | ||
64 | - * Struct to use for initializing a buffersink context. | ||
65 | - */ | ||
66 | -typedef struct AVBufferSinkParams { | ||
67 | - const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE | ||
68 | -} AVBufferSinkParams; | ||
69 | - | ||
70 | -/** | ||
71 | - * Create an AVBufferSinkParams structure. | ||
72 | - * | ||
73 | - * Must be freed with liteav_av_free(). | ||
74 | - */ | ||
75 | -AVBufferSinkParams *liteav_av_buffersink_params_alloc(void); | ||
76 | - | ||
77 | -/** | ||
78 | - * Struct to use for initializing an abuffersink context. | ||
79 | - */ | ||
80 | -typedef struct AVABufferSinkParams { | ||
81 | - const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE | ||
82 | - const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1 | ||
83 | - const int *channel_counts; ///< list of allowed channel counts, terminated by -1 | ||
84 | - int all_channel_counts; ///< if not 0, accept any channel count or layout | ||
85 | - int *sample_rates; ///< list of allowed sample rates, terminated by -1 | ||
86 | -} AVABufferSinkParams; | ||
87 | - | ||
88 | -/** | ||
89 | - * Create an AVABufferSinkParams structure. | ||
90 | - * | ||
91 | - * Must be freed with liteav_av_free(). | ||
92 | - */ | ||
93 | -AVABufferSinkParams *liteav_av_abuffersink_params_alloc(void); | ||
94 | - | ||
95 | -/** | ||
96 | - * Set the frame size for an audio buffer sink. | ||
97 | - * | ||
98 | - * All calls to av_buffersink_get_buffer_ref will return a buffer with | ||
99 | - * exactly the specified number of samples, or AVERROR(EAGAIN) if there is | ||
100 | - * not enough. The last buffer at EOF will be padded with 0. | ||
101 | - */ | ||
102 | -void liteav_av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size); | ||
103 | - | ||
104 | -/** | ||
105 | - * @defgroup lavfi_buffersink_accessors Buffer sink accessors | ||
106 | - * Get the properties of the stream | ||
107 | - * @{ | ||
108 | - */ | ||
109 | - | ||
110 | -enum AVMediaType liteav_av_buffersink_get_type (const AVFilterContext *ctx); | ||
111 | -AVRational liteav_av_buffersink_get_time_base (const AVFilterContext *ctx); | ||
112 | -int liteav_av_buffersink_get_format (const AVFilterContext *ctx); | ||
113 | - | ||
114 | -AVRational liteav_av_buffersink_get_frame_rate (const AVFilterContext *ctx); | ||
115 | -int liteav_av_buffersink_get_w (const AVFilterContext *ctx); | ||
116 | -int liteav_av_buffersink_get_h (const AVFilterContext *ctx); | ||
117 | -AVRational liteav_av_buffersink_get_sample_aspect_ratio (const AVFilterContext *ctx); | ||
118 | - | ||
119 | -int liteav_av_buffersink_get_channels (const AVFilterContext *ctx); | ||
120 | -uint64_t liteav_av_buffersink_get_channel_layout (const AVFilterContext *ctx); | ||
121 | -int liteav_av_buffersink_get_sample_rate (const AVFilterContext *ctx); | ||
122 | - | ||
123 | -AVBufferRef * liteav_av_buffersink_get_hw_frames_ctx (const AVFilterContext *ctx); | ||
124 | - | ||
125 | -/** @} */ | ||
126 | - | ||
127 | -/** | ||
128 | - * Get a frame with filtered data from sink and put it in frame. | ||
129 | - * | ||
130 | - * @param ctx pointer to a context of a buffersink or abuffersink AVFilter. | ||
131 | - * @param frame pointer to an allocated frame that will be filled with data. | ||
132 | - * The data must be freed using liteav_av_frame_unref() / liteav_av_frame_free() | ||
133 | - * | ||
134 | - * @return | ||
135 | - * - >= 0 if a frame was successfully returned. | ||
136 | - * - AVERROR(EAGAIN) if no frames are available at this point; more | ||
137 | - * input frames must be added to the filtergraph to get more output. | ||
138 | - * - AVERROR_EOF if there will be no more output frames on this sink. | ||
139 | - * - A different negative AVERROR code in other failure cases. | ||
140 | - */ | ||
141 | -int liteav_av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame); | ||
142 | - | ||
143 | -/** | ||
144 | - * Same as liteav_av_buffersink_get_frame(), but with the ability to specify the number | ||
145 | - * of samples read. This function is less efficient than | ||
146 | - * liteav_av_buffersink_get_frame(), because it copies the data around. | ||
147 | - * | ||
148 | - * @param ctx pointer to a context of the abuffersink AVFilter. | ||
149 | - * @param frame pointer to an allocated frame that will be filled with data. | ||
150 | - * The data must be freed using liteav_av_frame_unref() / liteav_av_frame_free() | ||
151 | - * frame will contain exactly nb_samples audio samples, except at | ||
152 | - * the end of stream, when it can contain less than nb_samples. | ||
153 | - * | ||
154 | - * @return The return codes have the same meaning as for | ||
155 | - * liteav_av_buffersink_get_frame(). | ||
156 | - * | ||
157 | - * @warning do not mix this function with liteav_av_buffersink_get_frame(). Use only one or | ||
158 | - * the other with a single sink, not both. | ||
159 | - */ | ||
160 | -int liteav_av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples); | ||
161 | - | ||
162 | -/** | ||
163 | - * @} | ||
164 | - */ | ||
165 | - | ||
166 | -#endif /* AVFILTER_BUFFERSINK_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * This file is part of FFmpeg. | ||
4 | - * | ||
5 | - * FFmpeg is free software; you can redistribute it and/or | ||
6 | - * modify it under the terms of the GNU Lesser General Public | ||
7 | - * License as published by the Free Software Foundation; either | ||
8 | - * version 2.1 of the License, or (at your option) any later version. | ||
9 | - * | ||
10 | - * FFmpeg is distributed in the hope that it will be useful, | ||
11 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | - * Lesser General Public License for more details. | ||
14 | - * | ||
15 | - * You should have received a copy of the GNU Lesser General Public | ||
16 | - * License along with FFmpeg; if not, write to the Free Software | ||
17 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | - */ | ||
19 | - | ||
20 | -#ifndef AVFILTER_BUFFERSRC_H | ||
21 | -#define AVFILTER_BUFFERSRC_H | ||
22 | - | ||
23 | -/** | ||
24 | - * @file | ||
25 | - * @ingroup lavfi_buffersrc | ||
26 | - * Memory buffer source API. | ||
27 | - */ | ||
28 | - | ||
29 | -#include "avfilter.h" | ||
30 | - | ||
31 | -/** | ||
32 | - * @defgroup lavfi_buffersrc Buffer source API | ||
33 | - * @ingroup lavfi | ||
34 | - * @{ | ||
35 | - */ | ||
36 | - | ||
37 | -enum { | ||
38 | - | ||
39 | - /** | ||
40 | - * Do not check for format changes. | ||
41 | - */ | ||
42 | - AV_BUFFERSRC_FLAG_NO_CHECK_FORMAT = 1, | ||
43 | - | ||
44 | - /** | ||
45 | - * Immediately push the frame to the output. | ||
46 | - */ | ||
47 | - AV_BUFFERSRC_FLAG_PUSH = 4, | ||
48 | - | ||
49 | - /** | ||
50 | - * Keep a reference to the frame. | ||
51 | - * If the frame if reference-counted, create a new reference; otherwise | ||
52 | - * copy the frame data. | ||
53 | - */ | ||
54 | - AV_BUFFERSRC_FLAG_KEEP_REF = 8, | ||
55 | - | ||
56 | -}; | ||
57 | - | ||
58 | -/** | ||
59 | - * Get the number of failed requests. | ||
60 | - * | ||
61 | - * A failed request is when the request_frame method is called while no | ||
62 | - * frame is present in the buffer. | ||
63 | - * The number is reset when a frame is added. | ||
64 | - */ | ||
65 | -unsigned liteav_av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src); | ||
66 | - | ||
67 | -/** | ||
68 | - * This structure contains the parameters describing the frames that will be | ||
69 | - * passed to this filter. | ||
70 | - * | ||
71 | - * It should be allocated with liteav_av_buffersrc_parameters_alloc() and freed with | ||
72 | - * liteav_av_free(). All the allocated fields in it remain owned by the caller. | ||
73 | - */ | ||
74 | -typedef struct AVBufferSrcParameters { | ||
75 | - /** | ||
76 | - * video: the pixel format, value corresponds to enum AVPixelFormat | ||
77 | - * audio: the sample format, value corresponds to enum AVSampleFormat | ||
78 | - */ | ||
79 | - int format; | ||
80 | - /** | ||
81 | - * The timebase to be used for the timestamps on the input frames. | ||
82 | - */ | ||
83 | - AVRational time_base; | ||
84 | - | ||
85 | - /** | ||
86 | - * Video only, the display dimensions of the input frames. | ||
87 | - */ | ||
88 | - int width, height; | ||
89 | - | ||
90 | - /** | ||
91 | - * Video only, the sample (pixel) aspect ratio. | ||
92 | - */ | ||
93 | - AVRational sample_aspect_ratio; | ||
94 | - | ||
95 | - /** | ||
96 | - * Video only, the frame rate of the input video. This field must only be | ||
97 | - * set to a non-zero value if input stream has a known constant framerate | ||
98 | - * and should be left at its initial value if the framerate is variable or | ||
99 | - * unknown. | ||
100 | - */ | ||
101 | - AVRational frame_rate; | ||
102 | - | ||
103 | - /** | ||
104 | - * Video with a hwaccel pixel format only. This should be a reference to an | ||
105 | - * AVHWFramesContext instance describing the input frames. | ||
106 | - */ | ||
107 | - AVBufferRef *hw_frames_ctx; | ||
108 | - | ||
109 | - /** | ||
110 | - * Audio only, the audio sampling rate in samples per second. | ||
111 | - */ | ||
112 | - int sample_rate; | ||
113 | - | ||
114 | - /** | ||
115 | - * Audio only, the audio channel layout | ||
116 | - */ | ||
117 | - uint64_t channel_layout; | ||
118 | -} AVBufferSrcParameters; | ||
119 | - | ||
120 | -/** | ||
121 | - * Allocate a new AVBufferSrcParameters instance. It should be freed by the | ||
122 | - * caller with liteav_av_free(). | ||
123 | - */ | ||
124 | -AVBufferSrcParameters *liteav_av_buffersrc_parameters_alloc(void); | ||
125 | - | ||
126 | -/** | ||
127 | - * Initialize the buffersrc or abuffersrc filter with the provided parameters. | ||
128 | - * This function may be called multiple times, the later calls override the | ||
129 | - * previous ones. Some of the parameters may also be set through AVOptions, then | ||
130 | - * whatever method is used last takes precedence. | ||
131 | - * | ||
132 | - * @param ctx an instance of the buffersrc or abuffersrc filter | ||
133 | - * @param param the stream parameters. The frames later passed to this filter | ||
134 | - * must conform to those parameters. All the allocated fields in | ||
135 | - * param remain owned by the caller, libavfilter will make internal | ||
136 | - * copies or references when necessary. | ||
137 | - * @return 0 on success, a negative AVERROR code on failure. | ||
138 | - */ | ||
139 | -int liteav_av_buffersrc_parameters_set(AVFilterContext *ctx, AVBufferSrcParameters *param); | ||
140 | - | ||
141 | -/** | ||
142 | - * Add a frame to the buffer source. | ||
143 | - * | ||
144 | - * @param ctx an instance of the buffersrc filter | ||
145 | - * @param frame frame to be added. If the frame is reference counted, this | ||
146 | - * function will make a new reference to it. Otherwise the frame data will be | ||
147 | - * copied. | ||
148 | - * | ||
149 | - * @return 0 on success, a negative AVERROR on error | ||
150 | - * | ||
151 | - * This function is equivalent to liteav_av_buffersrc_add_frame_flags() with the | ||
152 | - * AV_BUFFERSRC_FLAG_KEEP_REF flag. | ||
153 | - */ | ||
154 | -av_warn_unused_result | ||
155 | -int liteav_av_buffersrc_write_frame(AVFilterContext *ctx, const AVFrame *frame); | ||
156 | - | ||
157 | -/** | ||
158 | - * Add a frame to the buffer source. | ||
159 | - * | ||
160 | - * @param ctx an instance of the buffersrc filter | ||
161 | - * @param frame frame to be added. If the frame is reference counted, this | ||
162 | - * function will take ownership of the reference(s) and reset the frame. | ||
163 | - * Otherwise the frame data will be copied. If this function returns an error, | ||
164 | - * the input frame is not touched. | ||
165 | - * | ||
166 | - * @return 0 on success, a negative AVERROR on error. | ||
167 | - * | ||
168 | - * @note the difference between this function and liteav_av_buffersrc_write_frame() is | ||
169 | - * that liteav_av_buffersrc_write_frame() creates a new reference to the input frame, | ||
170 | - * while this function takes ownership of the reference passed to it. | ||
171 | - * | ||
172 | - * This function is equivalent to liteav_av_buffersrc_add_frame_flags() without the | ||
173 | - * AV_BUFFERSRC_FLAG_KEEP_REF flag. | ||
174 | - */ | ||
175 | -av_warn_unused_result | ||
176 | -int liteav_av_buffersrc_add_frame(AVFilterContext *ctx, AVFrame *frame); | ||
177 | - | ||
178 | -/** | ||
179 | - * Add a frame to the buffer source. | ||
180 | - * | ||
181 | - * By default, if the frame is reference-counted, this function will take | ||
182 | - * ownership of the reference(s) and reset the frame. This can be controlled | ||
183 | - * using the flags. | ||
184 | - * | ||
185 | - * If this function returns an error, the input frame is not touched. | ||
186 | - * | ||
187 | - * @param buffer_src pointer to a buffer source context | ||
188 | - * @param frame a frame, or NULL to mark EOF | ||
189 | - * @param flags a combination of AV_BUFFERSRC_FLAG_* | ||
190 | - * @return >= 0 in case of success, a negative AVERROR code | ||
191 | - * in case of failure | ||
192 | - */ | ||
193 | -av_warn_unused_result | ||
194 | -int liteav_av_buffersrc_add_frame_flags(AVFilterContext *buffer_src, | ||
195 | - AVFrame *frame, int flags); | ||
196 | - | ||
197 | -/** | ||
198 | - * Close the buffer source after EOF. | ||
199 | - * | ||
200 | - * This is similar to passing NULL to liteav_av_buffersrc_add_frame_flags() | ||
201 | - * except it takes the timestamp of the EOF, i.e. the timestamp of the end | ||
202 | - * of the last frame. | ||
203 | - */ | ||
204 | -int liteav_av_buffersrc_close(AVFilterContext *ctx, int64_t pts, unsigned flags); | ||
205 | - | ||
206 | -/** | ||
207 | - * @} | ||
208 | - */ | ||
209 | - | ||
210 | -#endif /* AVFILTER_BUFFERSRC_H */ |
1 | -/* | ||
2 | - * Version macros. | ||
3 | - * | ||
4 | - * This file is part of FFmpeg. | ||
5 | - * | ||
6 | - * FFmpeg is free software; you can redistribute it and/or | ||
7 | - * modify it under the terms of the GNU Lesser General Public | ||
8 | - * License as published by the Free Software Foundation; either | ||
9 | - * version 2.1 of the License, or (at your option) any later version. | ||
10 | - * | ||
11 | - * FFmpeg is distributed in the hope that it will be useful, | ||
12 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | - * Lesser General Public License for more details. | ||
15 | - * | ||
16 | - * You should have received a copy of the GNU Lesser General Public | ||
17 | - * License along with FFmpeg; if not, write to the Free Software | ||
18 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | - */ | ||
20 | - | ||
21 | -#ifndef AVFILTER_VERSION_H | ||
22 | -#define AVFILTER_VERSION_H | ||
23 | - | ||
24 | -/** | ||
25 | - * @file | ||
26 | - * @ingroup lavfi | ||
27 | - * Libavfilter version macros | ||
28 | - */ | ||
29 | - | ||
30 | -#include "libavutil/version.h" | ||
31 | - | ||
32 | -#define LIBAVFILTER_VERSION_MAJOR 7 | ||
33 | -#define LIBAVFILTER_VERSION_MINOR 40 | ||
34 | -#define LIBAVFILTER_VERSION_MICRO 101 | ||
35 | - | ||
36 | -#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | ||
37 | - LIBAVFILTER_VERSION_MINOR, \ | ||
38 | - LIBAVFILTER_VERSION_MICRO) | ||
39 | -#define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ | ||
40 | - LIBAVFILTER_VERSION_MINOR, \ | ||
41 | - LIBAVFILTER_VERSION_MICRO) | ||
42 | -#define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT | ||
43 | - | ||
44 | -#define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION) | ||
45 | - | ||
46 | -/** | ||
47 | - * FF_API_* defines may be placed below to indicate public API that will be | ||
48 | - * dropped at a future version bump. The defines themselves are not part of | ||
49 | - * the public API and may change, break or disappear at any time. | ||
50 | - */ | ||
51 | - | ||
52 | -#ifndef FF_API_OLD_FILTER_OPTS_ERROR | ||
53 | -#define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 8) | ||
54 | -#endif | ||
55 | -#ifndef FF_API_LAVR_OPTS | ||
56 | -#define FF_API_LAVR_OPTS (LIBAVFILTER_VERSION_MAJOR < 8) | ||
57 | -#endif | ||
58 | -#ifndef FF_API_FILTER_GET_SET | ||
59 | -#define FF_API_FILTER_GET_SET (LIBAVFILTER_VERSION_MAJOR < 8) | ||
60 | -#endif | ||
61 | -#ifndef FF_API_NEXT | ||
62 | -#define FF_API_NEXT (LIBAVFILTER_VERSION_MAJOR < 8) | ||
63 | -#endif | ||
64 | - | ||
65 | -#endif /* AVFILTER_VERSION_H */ |
1 | -#include "third_party/ffmpeg/ffmpeg_rename_defines.h" // add by source_replacer.py | ||
2 | -/* | ||
3 | - * AVC helper functions for muxers | ||
4 | - * Copyright (c) 2008 Aurelien Jacobs <aurel@gnuage.org> | ||
5 | - * | ||
6 | - * This file is part of FFmpeg. | ||
7 | - * | ||
8 | - * FFmpeg is free software; you can redistribute it and/or | ||
9 | - * modify it under the terms of the GNU Lesser General Public | ||
10 | - * License as published by the Free Software Foundation; either | ||
11 | - * version 2.1 of the License, or (at your option) any later version. | ||
12 | - * | ||
13 | - * FFmpeg is distributed in the hope that it will be useful, | ||
14 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | - * Lesser General Public License for more details. | ||
17 | - * | ||
18 | - * You should have received a copy of the GNU Lesser General Public | ||
19 | - * License along with FFmpeg; if not, write to the Free Software | ||
20 | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | - */ | ||
22 | - | ||
23 | -#ifndef AVFORMAT_AVC_H | ||
24 | -#define AVFORMAT_AVC_H | ||
25 | - | ||
26 | -#include <stdint.h> | ||
27 | -#include "avio.h" | ||
28 | - | ||
29 | -int liteav_ff_avc_parse_nal_units(AVIOContext *s, const uint8_t *buf, int size); | ||
30 | -int liteav_ff_avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size); | ||
31 | -int liteav_ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len); | ||
32 | -const uint8_t *liteav_ff_avc_find_startcode(const uint8_t *p, const uint8_t *end); | ||
33 | -int liteav_ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size); | ||
34 | -const uint8_t *liteav_ff_avc_mp4_find_startcode(const uint8_t *start, | ||
35 | - const uint8_t *end, | ||
36 | - int nal_length_size); | ||
37 | - | ||
38 | -#endif /* AVFORMAT_AVC_H */ |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment