FFmpeg
Loading...
Searching...
No Matches
libmodplug.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19/**
20* @file
21* ModPlug demuxer
22* @todo better probing than extensions matching
23*/
24
25#define MODPLUG_STATIC
26#include <libmodplug/modplug.h>
27#include "libavutil/avstring.h"
28#include "libavutil/eval.h"
29#include "libavutil/mem.h"
30#include "libavutil/opt.h"
31#include "avformat.h"
32#include "demux.h"
33#include "internal.h"
34
35typedef struct ModPlugContext {
36 const AVClass *class;
37 ModPlugFile *f;
38 uint8_t *buf; ///< input file content
39
40 /* options */
48
49 int max_size; ///< max file size to allocate
50
51 /* optional video stream */
52 double ts_per_packet; ///< used to define the pts/dts using packet_count;
53 int packet_count; ///< total number of audio packets
54 int print_textinfo; ///< bool flag for printing speed, tempo, order, ...
55 int video_stream; ///< 1 if the user want a video stream, otherwise 0
56 int w; ///< video stream width in char (one char = 8x8px)
57 int h; ///< video stream height in char (one char = 8x8px)
58 int video_switch; ///< 1 if current packet is video, otherwise 0
59 int fsize; ///< constant frame size
60 int linesize; ///< line size in bytes
61 char *color_eval; ///< color eval user input expression
62 AVExpr *expr; ///< parsed color eval expression
64
65static const char * const var_names[] = {
66 "x", "y",
67 "w", "h",
68 "t",
69 "speed", "tempo", "order", "pattern", "row",
70 NULL
71};
72
80
81#define FF_MODPLUG_MAX_FILE_SIZE (100 * 1<<20) // 100M
82#define FF_MODPLUG_DEF_FILE_SIZE ( 5 * 1<<20) // 5M
83
84#define OFFSET(x) offsetof(ModPlugContext, x)
85#define D AV_OPT_FLAG_DECODING_PARAM
86static const AVOption options[] = {
87 {"noise_reduction", "Enable noise reduction 0(off)-1(on)", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D},
88 {"reverb_depth", "Reverb level 0(quiet)-100(loud)", OFFSET(reverb_depth), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 100, D},
89 {"reverb_delay", "Reverb delay in ms, usually 40-200ms", OFFSET(reverb_delay), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D},
90 {"bass_amount", "XBass level 0(quiet)-100(loud)", OFFSET(bass_amount), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 100, D},
91 {"bass_range", "XBass cutoff in Hz 10-100", OFFSET(bass_range), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 100, D},
92 {"surround_depth", "Surround level 0(quiet)-100(heavy)", OFFSET(surround_depth), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 100, D},
93 {"surround_delay", "Surround delay in ms, usually 5-40ms", OFFSET(surround_delay), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D},
94 {"max_size", "Max file size supported (in bytes). Default is 5MB. Set to 0 for no limit (not recommended)",
96 {"video_stream_expr", "Color formula", OFFSET(color_eval), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, D},
97 {"video_stream", "Make demuxer output a video stream", OFFSET(video_stream), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D},
98 {"video_stream_w", "Video stream width in char (one char = 8x8px)", OFFSET(w), AV_OPT_TYPE_INT, {.i64 = 30}, 20, 512, D},
99 {"video_stream_h", "Video stream height in char (one char = 8x8px)", OFFSET(h), AV_OPT_TYPE_INT, {.i64 = 30}, 20, 512, D},
100 {"video_stream_ptxt", "Print speed, tempo, order, ... in video stream", OFFSET(print_textinfo), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, D},
101 {NULL},
102};
103
105{
106 ModPlugContext *modplug = s->priv_data;
107 ModPlug_Unload(modplug->f);
108 av_freep(&modplug->buf);
109 return 0;
110}
111
112#define SET_OPT_IF_REQUESTED(libopt, opt, flag) do { \
113 if (modplug->opt) { \
114 settings.libopt = modplug->opt; \
115 settings.mFlags |= flag; \
116 } \
117} while (0)
118
119#define ADD_META_MULTIPLE_ENTRIES(entry_name, fname) do { \
120 if (n_## entry_name ##s) { \
121 unsigned i, n = 0; \
122 \
123 for (i = 0; i < n_## entry_name ##s; i++) { \
124 char item_name[64] = {0}; \
125 fname(f, i, item_name); \
126 if (!*item_name) \
127 continue; \
128 if (n) \
129 av_dict_set(&s->metadata, #entry_name, "\n", AV_DICT_APPEND); \
130 av_dict_set(&s->metadata, #entry_name, item_name, AV_DICT_APPEND); \
131 n++; \
132 } \
133 \
134 extra = av_asprintf(", %u/%u " #entry_name "%s", \
135 n, n_## entry_name ##s, n > 1 ? "s" : ""); \
136 if (!extra) \
137 return AVERROR(ENOMEM); \
138 av_dict_set(&s->metadata, "extra info", extra, AV_DICT_APPEND); \
139 av_free(extra); \
140 } \
141} while (0)
142
144{
145 ModPlugContext *modplug = s->priv_data;
146 ModPlugFile *f = modplug->f;
147 char *extra;
148 const char *name = ModPlug_GetName(f);
149 const char *msg = ModPlug_GetMessage(f);
150
151 unsigned n_instruments = ModPlug_NumInstruments(f);
152 unsigned n_samples = ModPlug_NumSamples(f);
153 unsigned n_patterns = ModPlug_NumPatterns(f);
154 unsigned n_channels = ModPlug_NumChannels(f);
155
156 if (name && *name) av_dict_set(&s->metadata, "name", name, 0);
157 if (msg && *msg) av_dict_set(&s->metadata, "message", msg, 0);
158
159 extra = av_asprintf("%u pattern%s, %u channel%s",
160 n_patterns, n_patterns > 1 ? "s" : "",
161 n_channels, n_channels > 1 ? "s" : "");
162 if (!extra)
163 return AVERROR(ENOMEM);
164 av_dict_set(&s->metadata, "extra info", extra, AV_DICT_DONT_STRDUP_VAL);
165
166 ADD_META_MULTIPLE_ENTRIES(instrument, ModPlug_InstrumentName);
167 ADD_META_MULTIPLE_ENTRIES(sample, ModPlug_SampleName);
168
169 return 0;
170}
171
172#define AUDIO_PKT_SIZE 512
173
175{
176 AVStream *st;
177 AVIOContext *pb = s->pb;
178 ModPlug_Settings settings;
179 ModPlugContext *modplug = s->priv_data;
180 int64_t sz = avio_size(pb);
181 int ret;
182
183 if (sz < 0) {
184 av_log(s, AV_LOG_WARNING, "Could not determine file size\n");
185 sz = modplug->max_size;
186 } else if (modplug->max_size && sz > modplug->max_size) {
187 sz = modplug->max_size;
188 av_log(s, AV_LOG_WARNING, "Max file size reach%s, allocating %"PRIi64"B "
189 "but demuxing is likely to fail due to incomplete buffer\n",
190 sz == FF_MODPLUG_DEF_FILE_SIZE ? " (see -max_size)" : "", sz);
191 }
192
193 if (modplug->color_eval) {
194 int r = av_expr_parse(&modplug->expr, modplug->color_eval, var_names,
195 NULL, NULL, NULL, NULL, 0, s);
196 if (r < 0)
197 return r;
198 }
199
200 modplug->buf = av_malloc(modplug->max_size);
201 if (!modplug->buf)
202 return AVERROR(ENOMEM);
203 sz = avio_read(pb, modplug->buf, sz);
204
205 ModPlug_GetSettings(&settings);
206 settings.mChannels = 2;
207 settings.mBits = 16;
208 settings.mFrequency = 44100;
209 settings.mResamplingMode = MODPLUG_RESAMPLE_FIR; // best quality
210 settings.mLoopCount = 0; // prevents looping forever
211
212 if (modplug->noise_reduction) settings.mFlags |= MODPLUG_ENABLE_NOISE_REDUCTION;
213 SET_OPT_IF_REQUESTED(mReverbDepth, reverb_depth, MODPLUG_ENABLE_REVERB);
214 SET_OPT_IF_REQUESTED(mReverbDelay, reverb_delay, MODPLUG_ENABLE_REVERB);
215 SET_OPT_IF_REQUESTED(mBassAmount, bass_amount, MODPLUG_ENABLE_MEGABASS);
216 SET_OPT_IF_REQUESTED(mBassRange, bass_range, MODPLUG_ENABLE_MEGABASS);
217 SET_OPT_IF_REQUESTED(mSurroundDepth, surround_depth, MODPLUG_ENABLE_SURROUND);
218 SET_OPT_IF_REQUESTED(mSurroundDelay, surround_delay, MODPLUG_ENABLE_SURROUND);
219
220 if (modplug->reverb_depth) settings.mReverbDepth = modplug->reverb_depth;
221 if (modplug->reverb_delay) settings.mReverbDelay = modplug->reverb_delay;
222 if (modplug->bass_amount) settings.mBassAmount = modplug->bass_amount;
223 if (modplug->bass_range) settings.mBassRange = modplug->bass_range;
224 if (modplug->surround_depth) settings.mSurroundDepth = modplug->surround_depth;
225 if (modplug->surround_delay) settings.mSurroundDelay = modplug->surround_delay;
226
227 ModPlug_SetSettings(&settings);
228
229 modplug->f = ModPlug_Load(modplug->buf, sz);
230 if (!modplug->f) {
231 av_freep(&modplug->buf);
232 return AVERROR_INVALIDDATA;
233 }
235 if (!st) {
236 ret = AVERROR(ENOMEM);
237 goto fail;
238 }
239 avpriv_set_pts_info(st, 64, 1, 1000);
240 st->duration = ModPlug_GetLength(modplug->f);
243 st->codecpar->ch_layout.nb_channels = settings.mChannels;
244 st->codecpar->sample_rate = settings.mFrequency;
245
246 // timebase = 1/1000, 2ch 16bits 44.1kHz-> 2*2*44100
247 modplug->ts_per_packet = 1000*AUDIO_PKT_SIZE / (4*44100.);
248
249 if (modplug->video_stream) {
251 if (!vst) {
252 ret = AVERROR(ENOMEM);
253 goto fail;
254 }
255 avpriv_set_pts_info(vst, 64, 1, 1000);
256 vst->duration = st->duration;
259 vst->codecpar->width = modplug->w << 3;
260 vst->codecpar->height = modplug->h << 3;
261 modplug->linesize = modplug->w * 3;
262 modplug->fsize = modplug->linesize * modplug->h;
263 }
264
266 if (ret < 0)
267 goto fail;
268 return 0;
269fail:
271 return ret;
272}
273
274static void write_text(uint8_t *dst, const char *s, int linesize, int x, int y)
275{
276 int i;
277 dst += y*linesize + x*3;
278 for (i = 0; s[i]; i++, dst += 3) {
279 dst[0] = 0x0; // count - 1
280 dst[1] = s[i]; // char
281 dst[2] = 0x0f; // background / foreground
282 }
283}
284
285#define PRINT_INFO(line, name, idvalue) do { \
286 snprintf(intbuf, sizeof(intbuf), "%.0f", var_values[idvalue]); \
287 write_text(pkt->data, name ":", modplug->linesize, 0+1, line+1); \
288 write_text(pkt->data, intbuf, modplug->linesize, 10+1, line+1); \
289} while (0)
290
292{
293 ModPlugContext *modplug = s->priv_data;
294 int ret;
295
296 if (modplug->video_stream) {
297 modplug->video_switch ^= 1; // one video packet for one audio packet
298 if (modplug->video_switch) {
299 double var_values[VAR_VARS_NB];
300
301 var_values[VAR_W ] = modplug->w;
302 var_values[VAR_H ] = modplug->h;
303 var_values[VAR_TIME ] = modplug->packet_count * modplug->ts_per_packet;
304 var_values[VAR_SPEED ] = ModPlug_GetCurrentSpeed (modplug->f);
305 var_values[VAR_TEMPO ] = ModPlug_GetCurrentTempo (modplug->f);
306 var_values[VAR_ORDER ] = ModPlug_GetCurrentOrder (modplug->f);
307 var_values[VAR_PATTERN] = ModPlug_GetCurrentPattern(modplug->f);
308 var_values[VAR_ROW ] = ModPlug_GetCurrentRow (modplug->f);
309
310 if ((ret = av_new_packet(pkt, modplug->fsize)) < 0)
311 return ret;
312 pkt->stream_index = 1;
313 memset(pkt->data, 0, modplug->fsize);
314
315 if (modplug->print_textinfo) {
316 char intbuf[32];
317 PRINT_INFO(0, "speed", VAR_SPEED);
318 PRINT_INFO(1, "tempo", VAR_TEMPO);
319 PRINT_INFO(2, "order", VAR_ORDER);
320 PRINT_INFO(3, "pattern", VAR_PATTERN);
321 PRINT_INFO(4, "row", VAR_ROW);
322 PRINT_INFO(5, "ts", VAR_TIME);
323 }
324
325 if (modplug->expr) {
326 int x, y;
327 for (y = 0; y < modplug->h; y++) {
328 for (x = 0; x < modplug->w; x++) {
329 double color;
330 var_values[VAR_X] = x;
331 var_values[VAR_Y] = y;
332 color = av_expr_eval(modplug->expr, var_values, NULL);
333 pkt->data[y*modplug->linesize + x*3 + 2] |= av_clip((int)color, 0, 0xf)<<4;
334 }
335 }
336 }
337 pkt->pts = pkt->dts = var_values[VAR_TIME];
338 pkt->flags |= AV_PKT_FLAG_KEY;
339 return 0;
340 }
341 }
342
343 if ((ret = av_new_packet(pkt, AUDIO_PKT_SIZE)) < 0)
344 return ret;
345
346 if (modplug->video_stream)
347 pkt->pts = pkt->dts = modplug->packet_count++ * modplug->ts_per_packet;
348
349 pkt->size = ModPlug_Read(modplug->f, pkt->data, AUDIO_PKT_SIZE);
350 if (pkt->size <= 0) {
351 return pkt->size == 0 ? AVERROR_EOF : AVERROR_EXTERNAL;
352 }
353 return 0;
354}
355
356static int modplug_read_seek(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
357{
358 ModPlugContext *modplug = s->priv_data;
359 ModPlug_Seek(modplug->f, (int)ts);
360 if (modplug->video_stream)
361 modplug->packet_count = ts / modplug->ts_per_packet;
362 return 0;
363}
364
365static const char modplug_extensions[] = "669,abc,amf,ams,dbm,dmf,dsm,far,it,mdl,med,mid,mod,mt2,mtm,okt,psm,ptm,s3m,stm,ult,umx,xm,itgz,itr,itz,mdgz,mdr,mdz,s3gz,s3r,s3z,xmgz,xmr,xmz";
366
367static int modplug_probe(const AVProbeData *p)
368{
369 if (av_match_ext(p->filename, modplug_extensions)) {
370 if (p->buf_size < 16384)
371 return AVPROBE_SCORE_EXTENSION/2-1;
372 else
374 }
375 return 0;
376}
377
378static const AVClass modplug_class = {
379 .class_name = "ModPlug demuxer",
380 .item_name = av_default_item_name,
381 .option = options,
382 .version = LIBAVUTIL_VERSION_INT,
383};
384
386 .p.name = "libmodplug",
387 .p.long_name = NULL_IF_CONFIG_SMALL("ModPlug demuxer"),
388 .p.extensions = modplug_extensions,
389 .p.priv_class = &modplug_class,
390 .priv_data_size = sizeof(ModPlugContext),
396};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const FFInputFormat ff_libmodplug_demuxer
Definition libmodplug.c:385
#define D
Definition avdct.c:35
@ VAR_H
Definition avfilter.c:565
@ VAR_W
Definition avfilter.c:564
void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den)
Set the time base and wrapping info for a given stream.
Definition avformat.c:834
Main libavformat public API header.
#define AVPROBE_SCORE_EXTENSION
score for file extension
Definition avformat.h:481
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition aviobuf.c:326
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition aviobuf.c:615
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
char * av_asprintf(const char *fmt,...)
Definition avstring.c:115
#define flags(name, subs,...)
Definition cbs_h264.c:74
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define f(width, name)
Definition cbs_vp8.c:236
#define s(width, name)
Definition cbs_vp9.c:198
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#define av_clip
Definition common.h:100
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static AVPacket * pkt
static AVStream * video_stream
double av_expr_eval(AVExpr *e, const double *const_values, void *opaque)
Evaluate a previously parsed expression.
Definition eval.c:824
int av_expr_parse(AVExpr **expr, const char *s, const char *const *const_names, const char *const *func1_names, double(*const *funcs1)(void *, double), const char *const *func2_names, double(*const *funcs2)(void *, double, double), int log_offset, void *log_ctx)
Parse an expression.
Definition eval.c:735
simple arithmetic expression evaluator
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
#define sample
#define fail
Definition test.h:479
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
@ AV_CODEC_ID_PCM_S16LE
Definition codec_id.h:330
@ AV_CODEC_ID_XBIN
Definition codec_id.h:601
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition packet.h:650
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition packet.c:98
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_match_ext(const char *filename, const char *extensions)
Return a positive value if the given filename has one of the given extensions, 0 otherwise.
Definition format.c:41
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() or another memory allocation functio...
Definition dict.h:79
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
Definition dict.c:86
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition error.h:59
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AVERROR_EOF
End of file.
Definition error.h:57
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
#define r
Definition input.c:42
@ VAR_X
Definition vf_blend.c:55
@ VAR_Y
Definition vf_blend.c:55
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static av_cold int read_close(AVFormatContext *ctx)
Definition libcdio.c:143
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition libcdio.c:151
#define AUDIO_PKT_SIZE
Definition libgme.c:82
@ VAR_SPEED
Definition libmodplug.c:77
@ VAR_TEMPO
Definition libmodplug.c:77
@ VAR_PATTERN
Definition libmodplug.c:77
@ VAR_ORDER
Definition libmodplug.c:77
@ VAR_ROW
Definition libmodplug.c:77
static int modplug_read_header(AVFormatContext *s)
Definition libmodplug.c:174
static const char modplug_extensions[]
Definition libmodplug.c:365
static int modplug_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition libmodplug.c:291
static int modplug_read_close(AVFormatContext *s)
Definition libmodplug.c:104
#define PRINT_INFO(line, name, idvalue)
Definition libmodplug.c:285
static int modplug_read_seek(AVFormatContext *s, int stream_idx, int64_t ts, int flags)
Definition libmodplug.c:356
#define SET_OPT_IF_REQUESTED(libopt, opt, flag)
Definition libmodplug.c:112
static void write_text(uint8_t *dst, const char *s, int linesize, int x, int y)
Definition libmodplug.c:274
static const AVClass modplug_class
Definition libmodplug.c:378
#define FF_MODPLUG_MAX_FILE_SIZE
Definition libmodplug.c:81
static int modplug_load_metadata(AVFormatContext *s)
Definition libmodplug.c:143
static int modplug_probe(const AVProbeData *p)
Definition libmodplug.c:367
#define OFFSET(x)
Definition libmodplug.c:84
#define ADD_META_MULTIPLE_ENTRIES(entry_name, fname)
Definition libmodplug.c:119
#define FF_MODPLUG_DEF_FILE_SIZE
Definition libmodplug.c:82
uint8_t w
Definition llvidencdsp.c:39
Memory handling functions.
var_name
Definition noise.c:46
@ VAR_VARS_NB
Definition noise.c:59
static const char *const var_names[]
Definition noise.c:30
#define av_malloc(s)
Definition ops_static.c:52
AVOptions.
const char * name
Definition qsvenc.c:142
int nb_channels
Number of channels in this layout.
Describe the class of an AVClass context structure.
Definition log.h:76
int height
The height of the video frame in pixels.
Definition codec_par.h:150
AVChannelLayout ch_layout
The channel layout and number of channels.
Definition codec_par.h:207
int width
The width of the video frame in pixels.
Definition codec_par.h:143
enum AVMediaType codec_type
General type of the encoded data.
Definition codec_par.h:53
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition codec_par.h:57
int sample_rate
The number of audio samples per second.
Definition codec_par.h:213
Definition eval.c:171
Format I/O context.
Definition avformat.h:1333
Bytestream IO Context.
Definition avio.h:160
AVOption.
Definition opt.h:428
This structure stores compressed data.
Definition packet.h:580
This structure contains the data a format has to probe a file.
Definition avformat.h:471
Stream structure.
Definition avformat.h:766
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition avformat.h:789
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition avformat.h:825
int print_textinfo
bool flag for printing speed, tempo, order, ...
Definition libmodplug.c:54
ModPlugFile * f
Definition libmodplug.c:37
double ts_per_packet
used to define the pts/dts using packet_count;
Definition libmodplug.c:52
AVExpr * expr
parsed color eval expression
Definition libmodplug.c:62
int h
video stream height in char (one char = 8x8px)
Definition libmodplug.c:57
int linesize
line size in bytes
Definition libmodplug.c:60
char * color_eval
color eval user input expression
Definition libmodplug.c:61
int w
video stream width in char (one char = 8x8px)
Definition libmodplug.c:56
int max_size
max file size to allocate
Definition libmodplug.c:49
int fsize
constant frame size
Definition libmodplug.c:59
int video_switch
1 if current packet is video, otherwise 0
Definition libmodplug.c:58
int packet_count
total number of audio packets
Definition libmodplug.c:53
uint8_t * buf
input file content
Definition libmodplug.c:38
int video_stream
1 if the user want a video stream, otherwise 0
Definition libmodplug.c:55
#define av_freep(p)
#define av_log(a,...)
@ VAR_TIME
Definition vf_zoompan.c:63