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 "libavutil/avstring.h"
25 #include "avformat.h"
26 #include "internal.h"
27 #include "libavutil/opt.h"
28 #include "libavutil/intreadwrite.h"
29 
30 /*
31  * .CVG files are essentially PSX ADPCM wrapped with a size and checksum.
32  * Found in the PSX versions of the game.
33  */
34 
35 #define ARGO_CVG_HEADER_SIZE 12
36 #define ARGO_CVG_BLOCK_ALIGN 0x10
37 #define ARGO_CVG_NB_BLOCKS 32
38 #define ARGO_CVG_SAMPLES_PER_BLOCK 28
39 
40 typedef struct ArgoCVGHeader {
41  uint32_t size; /*< File size -8 (this + trailing checksum) */
42  uint32_t unk1; /*< Unknown. Always seems to be 0 or 1. */
43  uint32_t unk2; /*< Unknown. Always seems to be 0 or 1. */
45 
46 typedef struct ArgoCVGOverride {
47  const char *name;
49  uint32_t checksum;
52 
53 typedef struct ArgoCVGDemuxContext {
55  uint32_t checksum;
56  uint32_t num_blocks;
57  uint32_t blocks_read;
59 
60 typedef struct ArgoCVGMuxContext {
61  const AVClass *class;
63  uint32_t checksum;
64  size_t size;
66 
67 #if CONFIG_ARGO_CVG_DEMUXER
68 /* "Special" files that are played at a different rate. */
69 static ArgoCVGOverride overrides[] = {
70  { "CRYS.CVG", { 23592, 0, 1 }, 2495499, 88200 }, /* Beta */
71  { "REDCRY88.CVG", { 38280, 0, 1 }, 4134848, 88200 }, /* Beta */
72  { "DANLOOP1.CVG", { 54744, 1, 0 }, 5684641, 37800 }, /* Beta */
73  { "PICKUP88.CVG", { 12904, 0, 1 }, 1348091, 48000 }, /* Beta */
74  { "SELECT1.CVG", { 5080, 0, 1 }, 549987, 44100 }, /* Beta */
75 };
76 
77 static int argo_cvg_probe(const AVProbeData *p)
78 {
79  ArgoCVGHeader cvg;
80 
81  /*
82  * It's almost impossible to detect these files based
83  * on the header alone. File extension is (unfortunately)
84  * the best way forward.
85  */
86  if (!av_match_ext(p->filename, "cvg"))
87  return 0;
88 
90  return 0;
91 
92  cvg.size = AV_RL32(p->buf + 0);
93  cvg.unk1 = AV_RL32(p->buf + 4);
94  cvg.unk2 = AV_RL32(p->buf + 8);
95 
96  if (cvg.size < 8)
97  return 0;
98 
99  if (cvg.unk1 != 0 && cvg.unk1 != 1)
100  return 0;
101 
102  if (cvg.unk2 != 0 && cvg.unk2 != 1)
103  return 0;
104 
105  return AVPROBE_SCORE_MAX / 4 + 1;
106 }
107 
108 static int argo_cvg_read_checksum(AVIOContext *pb, const ArgoCVGHeader *cvg, uint32_t *checksum)
109 {
110  int ret;
111  uint8_t buf[4];
112 
113  if (!(pb->seekable & AVIO_SEEKABLE_NORMAL)) {
114  *checksum = 0;
115  return 0;
116  }
117 
118  if ((ret = avio_seek(pb, cvg->size + 4, SEEK_SET)) < 0)
119  return ret;
120 
121  /* NB: Not using avio_rl32() because no error checking. */
122  if ((ret = avio_read(pb, buf, sizeof(buf))) < 0)
123  return ret;
124  else if (ret != sizeof(buf))
125  return AVERROR(EIO);
126 
127  if ((ret = avio_seek(pb, ARGO_CVG_HEADER_SIZE, SEEK_SET)) < 0)
128  return ret;
129 
130  *checksum = AV_RL32(buf);
131  return 0;
132 }
133 
134 static int argo_cvg_read_header(AVFormatContext *s)
135 {
136  int ret;
137  AVStream *st;
138  AVCodecParameters *par;
139  uint8_t buf[ARGO_CVG_HEADER_SIZE];
140  const char *filename = av_basename(s->url);
141  ArgoCVGDemuxContext *ctx = s->priv_data;
142 
143  if (!(st = avformat_new_stream(s, NULL)))
144  return AVERROR(ENOMEM);
145 
146  if ((ret = avio_read(s->pb, buf, ARGO_CVG_HEADER_SIZE)) < 0)
147  return ret;
148  else if (ret != ARGO_CVG_HEADER_SIZE)
149  return AVERROR(EIO);
150 
151  ctx->header.size = AV_RL32(buf + 0);
152  ctx->header.unk1 = AV_RL32(buf + 4);
153  ctx->header.unk2 = AV_RL32(buf + 8);
154 
155  if (ctx->header.size < 8)
156  return AVERROR_INVALIDDATA;
157 
158  av_log(s, AV_LOG_TRACE, "size = %u\n", ctx->header.size);
159  av_log(s, AV_LOG_TRACE, "unk = %u, %u\n", ctx->header.unk1, ctx->header.unk2);
160 
161  if ((ret = argo_cvg_read_checksum(s->pb, &ctx->header, &ctx->checksum)) < 0)
162  return ret;
163 
164  av_log(s, AV_LOG_TRACE, "checksum = %u\n", ctx->checksum);
165 
166  par = st->codecpar;
169  par->sample_rate = 22050;
170 
171  for (size_t i = 0; i < FF_ARRAY_ELEMS(overrides); i++) {
172  const ArgoCVGOverride *ovr = overrides + i;
173  if (ovr->header.size != ctx->header.size ||
174  ovr->header.unk1 != ctx->header.unk1 ||
175  ovr->header.unk2 != ctx->header.unk2 ||
176  ovr->checksum != ctx->checksum ||
177  av_strcasecmp(filename, ovr->name) != 0)
178  continue;
179 
180  av_log(s, AV_LOG_TRACE, "found override, name = %s\n", ovr->name);
181  par->sample_rate = ovr->sample_rate;
182  break;
183  }
184 
185  par->channels = 1;
187 
188  par->bits_per_coded_sample = 4;
190  par->bit_rate = par->sample_rate * par->bits_per_coded_sample;
191 
192  ctx->num_blocks = (ctx->header.size - 8) / ARGO_CVG_BLOCK_ALIGN;
193 
194  av_log(s, AV_LOG_TRACE, "num blocks = %u\n", ctx->num_blocks);
195 
196  avpriv_set_pts_info(st, 64, 1, par->sample_rate);
197 
198  st->start_time = 0;
199  st->duration = ctx->num_blocks * ARGO_CVG_SAMPLES_PER_BLOCK;
200  st->nb_frames = ctx->num_blocks;
201  return 0;
202 }
203 
204 static int argo_cvg_read_packet(AVFormatContext *s, AVPacket *pkt)
205 {
206  int ret;
207  AVStream *st = s->streams[0];
208  ArgoCVGDemuxContext *ctx = s->priv_data;
209 
210  if (ctx->blocks_read >= ctx->num_blocks)
211  return AVERROR_EOF;
212 
213  ret = av_get_packet(s->pb, pkt, st->codecpar->block_align *
214  FFMIN(ARGO_CVG_NB_BLOCKS, ctx->num_blocks - ctx->blocks_read));
215 
216  if (ret < 0)
217  return ret;
218 
219  if (ret % st->codecpar->block_align != 0)
220  return AVERROR_INVALIDDATA;
221 
222  pkt->stream_index = 0;
224  pkt->pts = ctx->blocks_read * ARGO_CVG_SAMPLES_PER_BLOCK;
226 
227  ctx->blocks_read += ret / st->codecpar->block_align;
228 
229  return 0;
230 }
231 
232 static int argo_cvg_seek(AVFormatContext *s, int stream_index,
233  int64_t pts, int flags)
234 {
235  int64_t ret;
236  ArgoCVGDemuxContext *ctx = s->priv_data;
237 
238  if (pts != 0 || stream_index != 0)
239  return AVERROR(EINVAL);
240 
241  if ((ret = avio_seek(s->pb, ARGO_CVG_HEADER_SIZE, SEEK_SET)) < 0)
242  return ret;
243 
244  ctx->blocks_read = 0;
245  return 0;
246 }
247 
249  .name = "argo_cvg",
250  .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
251  .priv_data_size = sizeof(ArgoCVGDemuxContext),
252  .read_probe = argo_cvg_probe,
253  .read_header = argo_cvg_read_header,
254  .read_packet = argo_cvg_read_packet,
255  .read_seek = argo_cvg_seek,
256 };
257 #endif
258 
259 #if CONFIG_ARGO_CVG_MUXER
260 static int argo_cvg_write_init(AVFormatContext *s)
261 {
262  ArgoCVGMuxContext *ctx = s->priv_data;
263  const AVCodecParameters *par;
264 
265  if (s->nb_streams != 1) {
266  av_log(s, AV_LOG_ERROR, "CVG files have exactly one stream\n");
267  return AVERROR(EINVAL);
268  }
269 
270  par = s->streams[0]->codecpar;
271 
272  if (par->codec_id != AV_CODEC_ID_ADPCM_PSX) {
273  av_log(s, AV_LOG_ERROR, "%s codec not supported\n",
274  avcodec_get_name(par->codec_id));
275  return AVERROR(EINVAL);
276  }
277 
278  if (par->channels != 1) {
279  av_log(s, AV_LOG_ERROR, "CVG files only support 1 channel\n");
280  return AVERROR(EINVAL);
281  }
282 
283  if (par->block_align != ARGO_CVG_BLOCK_ALIGN)
284  return AVERROR(EINVAL);
285 
286  if (!ctx->skip_rate_check && par->sample_rate != 22050) {
287  av_log(s, AV_LOG_ERROR, "Sample rate must be 22050\n");
288  return AVERROR(EINVAL);
289  }
290 
291  if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL)) {
292  av_log(s, AV_LOG_ERROR, "Stream not seekable, unable to write output file\n");
293  return AVERROR(EINVAL);
294  }
295 
296  return 0;
297 }
298 
299 static int argo_cvg_write_header(AVFormatContext *s)
300 {
301  ArgoCVGMuxContext *ctx = s->priv_data;
302 
303  avio_wl32(s->pb, 0); /* Size, fixed later. */
304  avio_wl32(s->pb, 0);
305  avio_wl32(s->pb, 1);
306 
307  ctx->checksum = 1;
308  ctx->size = 8;
309  return 0;
310 }
311 
312 static int argo_cvg_write_packet(AVFormatContext *s, AVPacket *pkt)
313 {
314  ArgoCVGMuxContext *ctx = s->priv_data;
315  AVCodecParameters *par = s->streams[0]->codecpar;
316 
317  if (pkt->size % par->block_align != 0)
318  return AVERROR_INVALIDDATA;
319 
320  avio_write(s->pb, pkt->data, pkt->size);
321 
322  ctx->size += pkt->size;
323 
324  if (ctx->size > UINT32_MAX)
325  return AVERROR_INVALIDDATA;
326 
327  for (int i = 0; i < pkt->size; i++)
328  ctx->checksum += pkt->data[i];
329 
330  return 0;
331 }
332 
333 static int argo_cvg_write_trailer(AVFormatContext *s)
334 {
335  ArgoCVGMuxContext *ctx = s->priv_data;
336  int64_t ret;
337 
338  av_log(s, AV_LOG_TRACE, "size = %zu\n", ctx->size);
339  av_log(s, AV_LOG_TRACE, "checksum = %u\n", ctx->checksum);
340 
341  /*
342  * NB: This is wrong. We're always slightly under the original.
343  * Verified by remuxing. For reference (orig - remuxed):
344  * - TCLD.CVG: 4706074 - 4705696 = 378
345  * - DANLOOP1.CVG: 5684641 - 5684212 = 429
346  * - CRYS.CVG: 2495499 - 2495367 = 132
347  * - PICKUP88.CVG: 1348091 - 1347937 = 154
348  * - SELECT1.CVG: 549987 - 549752 = 235
349  * Also NB: it doesn't matter, the game doesn't check them.
350  */
351  avio_wl32(s->pb, ctx->checksum);
352 
353  if ((ret = avio_seek(s->pb, 0, SEEK_SET) < 0))
354  return ret;
355 
356  avio_wl32(s->pb, (uint32_t)ctx->size);
357  return 0;
358 }
359 
360 static const AVOption argo_cvg_options[] = {
361  {
362  .name = "skip_rate_check",
363  .help = "skip sample rate check",
364  .offset = offsetof(ArgoCVGMuxContext, skip_rate_check),
365  .type = AV_OPT_TYPE_BOOL,
366  .default_val = {.i64 = 0},
367  .min = 0,
368  .max = 1,
370  },
371  { NULL }
372 };
373 
374 static const AVClass argo_cvg_muxer_class = {
375  .class_name = "argo_cvg_muxer",
376  .item_name = av_default_item_name,
377  .option = argo_cvg_options,
378  .version = LIBAVUTIL_VERSION_INT
379 };
380 
382  .name = "argo_cvg",
383  .long_name = NULL_IF_CONFIG_SMALL("Argonaut Games CVG"),
384  .extensions = "cvg",
385  .audio_codec = AV_CODEC_ID_ADPCM_PSX,
386  .video_codec = AV_CODEC_ID_NONE,
387  .init = argo_cvg_write_init,
388  .write_header = argo_cvg_write_header,
389  .write_packet = argo_cvg_write_packet,
390  .write_trailer = argo_cvg_write_trailer,
391  .priv_class = &argo_cvg_muxer_class,
392  .priv_data_size = sizeof(ArgoCVGMuxContext),
393 };
394 #endif
ArgoCVGDemuxContext::num_blocks
uint32_t num_blocks
Definition: argo_cvg.c:56
ArgoCVGHeader
Definition: argo_cvg.c:40
AVOutputFormat::name
const char * name
Definition: avformat.h:496
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
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:724
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:56
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:52
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_MONO
Definition: channel_layout.h:90
ArgoCVGDemuxContext::blocks_read
uint32_t blocks_read
Definition: argo_cvg.c:57
av_strcasecmp
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Definition: avstring.c:215
AVPacket::data
uint8_t * data
Definition: packet.h:373
AVOption
AVOption.
Definition: opt.h:247
ArgoCVGOverride::name
const char * name
Definition: argo_cvg.c:47
ArgoCVGOverride::checksum
uint32_t checksum
Definition: argo_cvg.c:49
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:391
AVProbeData::buf_size
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:449
ArgoCVGMuxContext::size
size_t size
Definition: argo_cvg.c:64
av_basename
const char * av_basename(const char *path)
Thread safe basename.
Definition: avstring.c:260
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:458
AVCodecParameters::channels
int channels
Audio only.
Definition: codec_par.h:166
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:149
ARGO_CVG_SAMPLES_PER_BLOCK
#define ARGO_CVG_SAMPLES_PER_BLOCK
Definition: argo_cvg.c:38
pts
static int64_t pts
Definition: transcode_aac.c:653
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:888
ArgoCVGMuxContext::skip_rate_check
int skip_rate_check
Definition: argo_cvg.c:62
ARGO_CVG_BLOCK_ALIGN
#define ARGO_CVG_BLOCK_ALIGN
Definition: argo_cvg.c:36
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:626
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:426
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:257
ArgoCVGOverride::header
ArgoCVGHeader header
Definition: argo_cvg.c:48
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:277
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:631
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:448
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AVProbeData::filename
const char * filename
Definition: avformat.h:447
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:38
ctx
AVFormatContext * ctx
Definition: movenc.c:48
ArgoCVGOverride::sample_rate
int sample_rate
Definition: argo_cvg.c:50
ArgoCVGMuxContext::checksum
uint32_t checksum
Definition: argo_cvg.c:63
AVFormatContext
Format I/O context.
Definition: avformat.h:1097
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:992
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:527
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:54
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
ArgoCVGMuxContext
Definition: argo_cvg.c:60
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:446
ARGO_CVG_NB_BLOCKS
#define ARGO_CVG_NB_BLOCKS
Definition: argo_cvg.c:37
AVCodecParameters::sample_rate
int sample_rate
Audio only.
Definition: codec_par.h:170
AVStream::nb_frames
int64_t nb_frames
number of frames in this stream if known or 0
Definition: avformat.h:890
AVIOContext
Bytestream IO Context.
Definition: avio.h:161
AVPacket::size
int size
Definition: packet.h:374
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:117
AVIOContext::seekable
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition: avio.h:262
ArgoCVGDemuxContext::checksum
uint32_t checksum
Definition: argo_cvg.c:55
AVOption::name
const char * name
Definition: opt.h:248
avio_write
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
Definition: aviobuf.c:218
avio_wl32
void avio_wl32(AVIOContext *s, unsigned int val)
Definition: aviobuf.c:371
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:379
ArgoCVGHeader::unk2
uint32_t unk2
Definition: argo_cvg.c:43
avcodec_get_name
const char * avcodec_get_name(enum AVCodecID id)
Get the name of a codec.
Definition: utils.c:447
i
int i
Definition: input.c:406
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:48
AVOutputFormat
Definition: avformat.h:495
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:366
AVCodecParameters::block_align
int block_align
Audio only.
Definition: codec_par.h:177
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:196
ff_argo_cvg_demuxer
const AVInputFormat ff_argo_cvg_demuxer
ret
ret
Definition: filter_design.txt:187
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
AVStream
Stream structure.
Definition: avformat.h:845
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:246
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:53
avformat.h
checksum
static volatile int checksum
Definition: adler32.c:30
ARGO_CVG_HEADER_SIZE
#define ARGO_CVG_HEADER_SIZE
Definition: argo_cvg.c:35
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:41
channel_layout.h
AVIO_SEEKABLE_NORMAL
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:40
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:625
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: utils.c:1146
AVPacket::stream_index
int stream_index
Definition: packet.h:375
ff_argo_cvg_muxer
const AVOutputFormat ff_argo_cvg_muxer
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:102
AVCodecParameters::codec_id
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
Definition: codec_par.h:60
AVPacket
This structure stores compressed data.
Definition: packet.h:350
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:241
AVCodecParameters::channel_layout
uint64_t channel_layout
Audio only.
Definition: codec_par.h:162
ArgoCVGHeader::unk1
uint32_t unk1
Definition: argo_cvg.c:42
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
AVCodecParameters::bit_rate
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: codec_par.h:89
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
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:878
avstring.h
AV_CODEC_ID_ADPCM_PSX
@ AV_CODEC_ID_ADPCM_PSX
Definition: codec_id.h:389
ArgoCVGOverride
Definition: argo_cvg.c:46