FFmpeg
argo_cvg.c
Go to the documentation of this file.
1 /*
2  * Argonaut Games CVG (de)muxer
3  *
4  * Copyright (C) 2021 Zane van Iperen (zane@zanevaniperen.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 #include "config_components.h"
24 
25 #include "libavutil/avstring.h"
27 #include "avformat.h"
28 #include "internal.h"
29 #include "mux.h"
30 #include "libavutil/opt.h"
31 #include "libavutil/intreadwrite.h"
32 
33 /*
34  * .CVG files are essentially PSX ADPCM wrapped with a size and checksum.
35  * Found in the PSX versions of the game.
36  */
37 
38 #define ARGO_CVG_HEADER_SIZE 12
39 #define ARGO_CVG_BLOCK_ALIGN 0x10
40 #define ARGO_CVG_NB_BLOCKS 32
41 #define ARGO_CVG_SAMPLES_PER_BLOCK 28
42 
43 typedef struct ArgoCVGHeader {
44  uint32_t size; /*< File size -8 (this + trailing checksum) */
45  uint32_t loop; /*< Loop flag. */
46  uint32_t reverb; /*< Reverb flag. */
48 
49 typedef struct ArgoCVGOverride {
50  const char *name;
52  uint32_t checksum;
55 
56 typedef struct ArgoCVGDemuxContext {
58  uint32_t checksum;
59  uint32_t num_blocks;
60  uint32_t blocks_read;
62 
63 typedef struct ArgoCVGMuxContext {
64  const AVClass *class;
66  int loop;
67  int reverb;
68  uint32_t checksum;
69  size_t size;
71 
72 #if CONFIG_ARGO_CVG_DEMUXER
73 /* "Special" files that are played at a different rate. */
74 static const ArgoCVGOverride overrides[] = {
75  { "CRYS.CVG", { 23592, 0, 1 }, 2495499, 88200 }, /* Beta */
76  { "REDCRY88.CVG", { 38280, 0, 1 }, 4134848, 88200 }, /* Beta */
77  { "DANLOOP1.CVG", { 54744, 1, 0 }, 5684641, 37800 }, /* Beta */
78  { "PICKUP88.CVG", { 12904, 0, 1 }, 1348091, 48000 }, /* Beta */
79  { "SELECT1.CVG", { 5080, 0, 1 }, 549987, 44100 }, /* Beta */
80 };
81 
82 static int argo_cvg_probe(const AVProbeData *p)
83 {
84  ArgoCVGHeader cvg;
85 
86  /*
87  * It's almost impossible to detect these files based
88  * on the header alone. File extension is (unfortunately)
89  * the best way forward.
90  */
91  if (!av_match_ext(p->filename, "cvg"))
92  return 0;
93 
95  return 0;
96 
97  cvg.size = AV_RL32(p->buf + 0);
98  cvg.loop = AV_RL32(p->buf + 4);
99  cvg.reverb = AV_RL32(p->buf + 8);
100 
101  if (cvg.size < 8)
102  return 0;
103 
104  if (cvg.loop != 0 && cvg.loop != 1)
105  return 0;
106 
107  if (cvg.reverb != 0 && cvg.reverb != 1)
108  return 0;
109 
110  return AVPROBE_SCORE_MAX / 4 + 1;
111 }
112 
113 static int argo_cvg_read_checksum(AVIOContext *pb, const ArgoCVGHeader *cvg, uint32_t *checksum)
114 {
115  int ret;
116  uint8_t buf[4];
117 
118  if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) {
119  *checksum = 0;
120  return 0;
121  }
122 
123  if ((ret = avio_seek(pb, cvg->size + 4, SEEK_SET)) < 0)
124  return ret;
125 
126  /* NB: Not using avio_rl32() because no error checking. */
127  if ((ret = avio_read(pb, buf, sizeof(buf))) < 0)
128  return ret;
129  else if (ret != sizeof(buf))
130  return AVERROR(EIO);
131 
132  if ((ret = avio_seek(pb, ARGO_CVG_HEADER_SIZE, SEEK_SET)) < 0)
133  return ret;
134 
135  *checksum = AV_RL32(buf);
136  return 0;
137 }
138 
139 static int argo_cvg_read_header(AVFormatContext *s)
140 {
141  int ret;
142  AVStream *st;
143  AVCodecParameters *par;
144  uint8_t buf[ARGO_CVG_HEADER_SIZE];
145  const char *filename = av_basename(s->url);
146  ArgoCVGDemuxContext *ctx = s->priv_data;
147 
148  if (!(st = avformat_new_stream(s, NULL)))
149  return AVERROR(ENOMEM);
150 
151  if ((ret = avio_read(s->pb, buf, ARGO_CVG_HEADER_SIZE)) < 0)
152  return ret;
153  else if (ret != ARGO_CVG_HEADER_SIZE)
154  return AVERROR(EIO);
155 
156  ctx->header.size = AV_RL32(buf + 0);
157  ctx->header.loop = AV_RL32(buf + 4);
158  ctx->header.reverb = AV_RL32(buf + 8);
159 
160  if (ctx->header.size < 8)
161  return AVERROR_INVALIDDATA;
162 
163  if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0)
164  return ret;
165 
166  if ((ret = av_dict_set_int(&st->metadata, "loop", ctx->header.loop, 0)) < 0)
167  return ret;
168 
169  if ((ret = av_dict_set_int(&st->metadata, "reverb", ctx->header.reverb, 0)) < 0)
170  return ret;
171 
172  if ((ret = av_dict_set_int(&st->metadata, "checksum", ctx->checksum, 0)) < 0)
173  return ret;
174 
175  par = st->codecpar;
178  par->sample_rate = 22050;
179 
180  for (size_t i = 0; i < FF_ARRAY_ELEMS(overrides); i++) {
181  const ArgoCVGOverride *ovr = overrides + i;
182  if (ovr->header.size != ctx->header.size ||
183  ovr->header.loop != ctx->header.loop ||
184  ovr->header.reverb != ctx->header.reverb ||
185  ovr->checksum != ctx->checksum ||
186  av_strcasecmp(filename, ovr->name) != 0)
187  continue;
188 
189  av_log(s, AV_LOG_TRACE, "found override, name = %s\n", ovr->name);
190  par->sample_rate = ovr->sample_rate;
191  break;
192  }
193 
195 
196  par->bits_per_coded_sample = 4;
198  par->bit_rate = par->sample_rate * par->bits_per_coded_sample;
199 
200  ctx->num_blocks = (ctx->header.size - 8) / ARGO_CVG_BLOCK_ALIGN;
201 
202  av_log(s, AV_LOG_TRACE, "num blocks = %u\n", ctx->num_blocks);
203 
204  avpriv_set_pts_info(st, 64, 1, par->sample_rate);
205 
206  st->start_time = 0;
207  st->duration = ctx->num_blocks * ARGO_CVG_SAMPLES_PER_BLOCK;
208  st->nb_frames = ctx->num_blocks;
209  return 0;
210 }
211 
212 static int argo_cvg_read_packet(AVFormatContext *s, AVPacket *pkt)
213 {
214  int ret;
215  AVStream *st = s->streams[0];
216  ArgoCVGDemuxContext *ctx = s->priv_data;
217 
218  if (ctx->blocks_read >= ctx->num_blocks)
219  return AVERROR_EOF;
220 
221  ret = av_get_packet(s->pb, pkt, st->codecpar->block_align *
222  FFMIN(ARGO_CVG_NB_BLOCKS, ctx->num_blocks - ctx->blocks_read));
223 
224  if (ret < 0)
225  return ret;
226 
227  if (ret % st->codecpar->block_align != 0)
228  return AVERROR_INVALIDDATA;
229 
230  pkt->stream_index = 0;
232  pkt->pts = ctx->blocks_read * ARGO_CVG_SAMPLES_PER_BLOCK;
234 
235  ctx->blocks_read += ret / st->codecpar->block_align;
236 
237  return 0;
238 }
239 
240 static int argo_cvg_seek(AVFormatContext *s, int stream_index,
241  int64_t pts, int flags)
242 {
243  int64_t ret;
244  ArgoCVGDemuxContext *ctx = s->priv_data;
245 
246  if (pts != 0 || stream_index != 0)
247  return AVERROR(EINVAL);
248 
249  if ((ret = avio_seek(s->pb, ARGO_CVG_HEADER_SIZE, SEEK_SET)) < 0)
250  return ret;
251 
252  ctx->blocks_read = 0;
253  return 0;
254 }
255 
257  .name = "argo_cvg",
258  .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
259  .priv_data_size = sizeof(ArgoCVGDemuxContext),
260  .read_probe = argo_cvg_probe,
261  .read_header = argo_cvg_read_header,
262  .read_packet = argo_cvg_read_packet,
263  .read_seek = argo_cvg_seek,
264 };
265 #endif
266 
267 #if CONFIG_ARGO_CVG_MUXER
268 static int argo_cvg_write_init(AVFormatContext *s)
269 {
270  ArgoCVGMuxContext *ctx = s->priv_data;
271  const AVCodecParameters *par;
272 
273  if (s->nb_streams != 1) {
274  av_log(s, AV_LOG_ERROR, "CVG files have exactly one stream\n");
275  return AVERROR(EINVAL);
276  }
277 
278  par = s->streams[0]->codecpar;
279 
280  if (par->codec_id != AV_CODEC_ID_ADPCM_PSX) {
281  av_log(s, AV_LOG_ERROR, "%s codec not supported\n",
282  avcodec_get_name(par->codec_id));
283  return AVERROR(EINVAL);
284  }
285 
286  if (par->ch_layout.nb_channels != 1) {
287  av_log(s, AV_LOG_ERROR, "CVG files only support 1 channel\n");
288  return AVERROR(EINVAL);
289  }
290 
291  if (par->block_align != ARGO_CVG_BLOCK_ALIGN)
292  return AVERROR(EINVAL);
293 
294  if (!ctx->skip_rate_check && par->sample_rate != 22050) {
295  av_log(s, AV_LOG_ERROR, "Sample rate must be 22050\n");
296  return AVERROR(EINVAL);
297  }
298 
299  if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL)) {
300  av_log(s, AV_LOG_ERROR, "Stream not seekable, unable to write output file\n");
301  return AVERROR(EINVAL);
302  }
303 
304  return 0;
305 }
306 
307 static int argo_cvg_write_header(AVFormatContext *s)
308 {
309  ArgoCVGMuxContext *ctx = s->priv_data;
310 
311  avio_wl32(s->pb, 0); /* Size, fixed later. */
312  avio_wl32(s->pb, !!ctx->loop);
313  avio_wl32(s->pb, !!ctx->reverb);
314 
315  ctx->checksum = !!ctx->loop + !!ctx->reverb;
316  ctx->size = 8;
317  return 0;
318 }
319 
320 static int argo_cvg_write_packet(AVFormatContext *s, AVPacket *pkt)
321 {
322  ArgoCVGMuxContext *ctx = s->priv_data;
323  AVCodecParameters *par = s->streams[0]->codecpar;
324 
325  if (pkt->size % par->block_align != 0)
326  return AVERROR_INVALIDDATA;
327 
328  avio_write(s->pb, pkt->data, pkt->size);
329 
330  ctx->size += pkt->size;
331 
332  if (ctx->size > UINT32_MAX)
333  return AVERROR_INVALIDDATA;
334 
335  for (int i = 0; i < pkt->size; i++)
336  ctx->checksum += pkt->data[i];
337 
338  return 0;
339 }
340 
341 static int argo_cvg_write_trailer(AVFormatContext *s)
342 {
343  ArgoCVGMuxContext *ctx = s->priv_data;
344  int64_t ret;
345 
346  ctx->checksum += (ctx->size & 255)
347  + ((ctx->size>> 8) & 255)
348  + ((ctx->size>>16) & 255)
349  + (ctx->size>>24);
350 
351  av_log(s, AV_LOG_TRACE, "size = %zu\n", ctx->size);
352  av_log(s, AV_LOG_TRACE, "checksum = %u\n", ctx->checksum);
353 
354  avio_wl32(s->pb, ctx->checksum);
355 
356  if ((ret = avio_seek(s->pb, 0, SEEK_SET)) < 0)
357  return ret;
358 
359  avio_wl32(s->pb, (uint32_t)ctx->size);
360  return 0;
361 }
362 
363 static const AVOption argo_cvg_options[] = {
364  {
365  .name = "skip_rate_check",
366  .help = "skip sample rate check",
367  .offset = offsetof(ArgoCVGMuxContext, skip_rate_check),
368  .type = AV_OPT_TYPE_BOOL,
369  .default_val = {.i64 = 0},
370  .min = 0,
371  .max = 1,
373  },
374  {
375  .name = "loop",
376  .help = "set loop flag",
377  .offset = offsetof(ArgoCVGMuxContext, loop),
378  .type = AV_OPT_TYPE_BOOL,
379  .default_val = {.i64 = 0},
380  .min = 0,
381  .max = 1,
383  },
384  {
385  .name = "reverb",
386  .help = "set reverb flag",
387  .offset = offsetof(ArgoCVGMuxContext, reverb),
388  .type = AV_OPT_TYPE_BOOL,
389  .default_val = {.i64 = 1},
390  .min = 0,
391  .max = 1,
393  },
394  { NULL }
395 };
396 
397 static const AVClass argo_cvg_muxer_class = {
398  .class_name = "argo_cvg_muxer",
399  .item_name = av_default_item_name,
400  .option = argo_cvg_options,
401  .version = LIBAVUTIL_VERSION_INT
402 };
403 
405  .p.name = "argo_cvg",
406  .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
407  .p.extensions = "cvg",
408  .p.audio_codec = AV_CODEC_ID_ADPCM_PSX,
409  .p.video_codec = AV_CODEC_ID_NONE,
410  .p.priv_class = &argo_cvg_muxer_class,
411  .init = argo_cvg_write_init,
412  .write_header = argo_cvg_write_header,
413  .write_packet = argo_cvg_write_packet,
414  .write_trailer = argo_cvg_write_trailer,
415  .priv_data_size = sizeof(ArgoCVGMuxContext),
416 };
417 #endif
ArgoCVGDemuxContext::num_blocks
uint32_t num_blocks
Definition: argo_cvg.c:59
ArgoCVGHeader
Definition: argo_cvg.c:43
AVOutputFormat::name
const char * name
Definition: avformat.h:511
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
opt.h
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
ArgoCVGDemuxContext::blocks_read
uint32_t blocks_read
Definition: argo_cvg.c:60
av_strcasecmp
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Definition: avstring.c:207
AVPacket::data
uint8_t * data
Definition: packet.h:491
AVOption
AVOption.
Definition: opt.h:251
ArgoCVGOverride::name
const char * name
Definition: argo_cvg.c:50
ArgoCVGOverride::checksum
uint32_t checksum
Definition: argo_cvg.c:52
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:509
AVProbeData::buf_size
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:455
AVChannelLayout::nb_channels
int nb_channels
Number of channels in this layout.
Definition: channel_layout.h:317
ArgoCVGMuxContext::size
size_t size
Definition: argo_cvg.c:69
av_basename
const char * av_basename(const char *path)
Thread safe basename.
Definition: avstring.c:252
FFOutputFormat::p
AVOutputFormat p
The public AVOutputFormat.
Definition: mux.h:36
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:464
avpriv_set_pts_info
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:761
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
ARGO_CVG_SAMPLES_PER_BLOCK
#define ARGO_CVG_SAMPLES_PER_BLOCK
Definition: argo_cvg.c:41
pts
static int64_t pts
Definition: transcode_aac.c:643
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:900
ArgoCVGMuxContext::skip_rate_check
int skip_rate_check
Definition: argo_cvg.c:65
loop
static int loop
Definition: ffplay.c:337
ARGO_CVG_BLOCK_ALIGN
#define ARGO_CVG_BLOCK_ALIGN
Definition: argo_cvg.c:39
AV_LOG_TRACE
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition: log.h:206
pkt
AVPacket * pkt
Definition: movenc.c:59
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
AVInputFormat
Definition: avformat.h:549
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
AV_PKT_FLAG_CORRUPT
#define AV_PKT_FLAG_CORRUPT
The packet content is corrupted.
Definition: packet.h:547
ArgoCVGHeader::loop
uint32_t loop
Definition: argo_cvg.c:45
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:41
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
ArgoCVGOverride::header
ArgoCVGHeader header
Definition: argo_cvg.c:51
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:281
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:554
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:454
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AVProbeData::filename
const char * filename
Definition: avformat.h:453
av_match_ext
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
ctx
AVFormatContext * ctx
Definition: movenc.c:48
ArgoCVGOverride::sample_rate
int sample_rate
Definition: argo_cvg.c:53
ArgoCVGMuxContext::checksum
uint32_t checksum
Definition: argo_cvg.c:68
AVFormatContext
Format I/O context.
Definition: avformat.h:1115
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:864
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:550
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
ArgoCVGDemuxContext::header
ArgoCVGHeader header
Definition: argo_cvg.c:57
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
ArgoCVGMuxContext
Definition: argo_cvg.c:63
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:452
AVStream::metadata
AVDictionary * metadata
Definition: avformat.h:921
FFOutputFormat
Definition: mux.h:32
ARGO_CVG_NB_BLOCKS
#define ARGO_CVG_NB_BLOCKS
Definition: argo_cvg.c:40
AVCodecParameters::ch_layout
AVChannelLayout ch_layout
Audio only.
Definition: codec_par.h:206
ff_argo_cvg_muxer
const FFOutputFormat ff_argo_cvg_muxer
AVCodecParameters::sample_rate
int sample_rate
Audio only.
Definition: codec_par.h:171
AVStream::nb_frames
int64_t nb_frames
number of frames in this stream if known or 0
Definition: avformat.h:902
AVIOContext
Bytestream IO Context.
Definition: avio.h:166
AVPacket::size
int size
Definition: packet.h:492
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
AVIOContext::seekable
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition: avio.h:271
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:307
ArgoCVGDemuxContext::checksum
uint32_t checksum
Definition: argo_cvg.c:58
AVOption::name
const char * name
Definition: opt.h:252
ArgoCVGMuxContext::loop
int loop
Definition: argo_cvg.c:66
avio_write
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:248
avio_wl32
void avio_wl32(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:404
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:497
avcodec_get_name
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
Definition: utils.c:417
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:484
ArgoCVGHeader::reverb
uint32_t reverb
Definition: argo_cvg.c:46
AVCodecParameters::block_align
int block_align
Audio only.
Definition: codec_par.h:178
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
av_get_packet
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
Allocate and read the payload of a packet and initialize its fields with default values.
Definition: utils.c:103
ff_argo_cvg_demuxer
const AVInputFormat ff_argo_cvg_demuxer
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:841
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:278
AVClass::class_name
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:71
ArgoCVGDemuxContext
Definition: argo_cvg.c:56
avformat.h
ARGO_CVG_HEADER_SIZE
#define ARGO_CVG_HEADER_SIZE
Definition: argo_cvg.c:38
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
ArgoCVGHeader::size
uint32_t size
Definition: argo_cvg.c:44
ArgoCVGMuxContext::reverb
int reverb
Definition: argo_cvg.c:67
channel_layout.h
AVIO_SEEKABLE_NORMAL
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:41
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:659
AVPacket::stream_index
int stream_index
Definition: packet.h:493
av_dict_set_int
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set() that converts the value to a string and stores it.
Definition: dict.c:169
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:29
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:97
AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_MONO
Definition: channel_layout.h:382
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:55
AVPacket
This structure stores compressed data.
Definition: packet.h:468
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
AVCodecParameters::bit_rate
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: codec_par.h:84
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
AVStream::start_time
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
Definition: avformat.h:890
avstring.h
AV_CODEC_ID_ADPCM_PSX
@ AV_CODEC_ID_ADPCM_PSX
Definition: codec_id.h:406
ArgoCVGOverride
Definition: argo_cvg.c:49
mux.h