FFmpeg
argo_brp.c
Go to the documentation of this file.
1 /*
2  * Argonaut Games BRP Demuxer
3  *
4  * Copyright (C) 2020 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 "avformat.h"
24 #include "avio_internal.h"
25 #include "demux.h"
26 #include "internal.h"
27 #include "libavutil/intreadwrite.h"
28 #include "libavutil/avassert.h"
29 #include "libavutil/internal.h"
30 #include "argo_asf.h"
31 
32 #define BRP_TAG MKTAG('B', 'R', 'P', 'P')
33 #define BRP_FILE_HEADER_SIZE 12
34 #define BRP_BLOCK_HEADER_SIZE 12
35 #define BRP_STREAM_HEADER_SIZE 20
36 #define BRP_MAX_STREAMS 32 /* Soft cap, but even this is overkill. */
37 #define BRP_BASF_LOOKAHEAD 10 /* How many blocks to search for the first BASF one. */
38 #define BVID_HEADER_SIZE 16
39 #define MASK_HEADER_SIZE 12
40 #define BRP_MIN_BUFFER_SIZE FFMAX3(FFMAX3(BRP_FILE_HEADER_SIZE, \
41  BRP_BLOCK_HEADER_SIZE, \
42  BRP_STREAM_HEADER_SIZE), \
43  BVID_HEADER_SIZE, \
44  MASK_HEADER_SIZE)
45 
46 #define BRP_CODEC_ID_BVID MKTAG('B', 'V', 'I', 'D')
47 #define BRP_CODEC_ID_BASF MKTAG('B', 'A', 'S', 'F')
48 #define BRP_CODEC_ID_MASK MKTAG('M', 'A', 'S', 'K')
49 
50 typedef struct ArgoBRPFileHeader {
51  uint32_t magic;
52  uint32_t num_streams;
53  uint32_t byte_rate;
55 
56 typedef struct ArgoBRPBlockHeader {
58  uint32_t start_ms;
59  uint32_t size;
61 
62 typedef struct ArgoBVIDHeader {
63  uint32_t num_frames;
64  uint32_t width;
65  uint32_t height;
66  uint32_t depth;
68 
69 typedef struct ArgoMASKHeader {
70  uint32_t num_frames;
71  uint32_t width;
72  uint32_t height;
74 
75 typedef struct ArgoBRPStreamHeader {
76  uint32_t codec_id;
77  uint32_t id;
78  uint32_t duration_ms;
79  uint32_t byte_rate;
80  uint32_t extradata_size;
81  union
82  {
83  /* If codec_id == BRP_CODEC_ID_BVID */
85  /* If codec_id == BRP_CODEC_ID_BASF */
87  /* If codec_id == BRP_CODEC_ID_MASK */
89  } extradata;
91 
92 typedef struct ArgoBRPDemuxContext {
95 
96  struct {
97  int index;
99  } basf;
101 
102 static int argo_brp_probe(const AVProbeData *p)
103 {
104  if (AV_RL32(p->buf) != BRP_TAG)
105  return 0;
106 
107  return AVPROBE_SCORE_EXTENSION + 1;
108 }
109 
111  void *buf, size_t bufsz)
112 {
113  const char *name;
114  uint32_t size;
115  int64_t ret;
116 
117  if (hdr->codec_id == BRP_CODEC_ID_BVID) {
118  name = "BVID";
120  } else if (hdr->codec_id == BRP_CODEC_ID_BASF) {
121  name = "BASF";
123  } else if (hdr->codec_id == BRP_CODEC_ID_MASK) {
124  name = "MASK";
126  } else {
127  avpriv_request_sample(s, "BRP codec id 0x%x", hdr->codec_id);
128 
129  if ((ret = avio_skip(s->pb, hdr->extradata_size)) < 0)
130  return ret;
131 
132  return 1;
133  }
134 
135  if (hdr->extradata_size != size) {
136  av_log(s, AV_LOG_ERROR, "Invalid %s extradata size %u, expected %u\n",
137  name, hdr->extradata_size, size);
138  return AVERROR_INVALIDDATA;
139  }
140 
141  av_assert0(bufsz >= size);
142 
143  ret = ffio_read_size(s->pb, buf, size);
144  if (ret < 0)
145  return ret;
146 
147  return 0;
148 }
149 
151 {
152  int64_t ret;
153  AVIOContext *pb = s->pb;
154  ArgoBRPDemuxContext *brp = s->priv_data;
156 
158  if (ret < 0)
159  return ret;
160 
161  brp->fhdr.magic = AV_RL32(buf + 0);
162  brp->fhdr.num_streams = AV_RL32(buf + 4);
163  brp->fhdr.byte_rate = AV_RL32(buf + 8);
164 
165  if (brp->fhdr.magic != BRP_TAG)
166  return AVERROR_INVALIDDATA;
167 
168  if (brp->fhdr.num_streams > BRP_MAX_STREAMS) {
169  avpriv_request_sample(s, ">%d streams", BRP_MAX_STREAMS);
170  return AVERROR_PATCHWELCOME;
171  }
172 
173  /* Build the stream info. */
174  brp->basf.index = -1;
175  for (uint32_t i = 0; i < brp->fhdr.num_streams; i++) {
176  ArgoBRPStreamHeader *hdr = brp->streams + i;
177  AVStream *st;
178 
179  if (!(st = avformat_new_stream(s, NULL)))
180  return AVERROR(ENOMEM);
181 
183  if (ret < 0)
184  return ret;
185 
186  hdr->codec_id = AV_RL32(buf + 0);
187  hdr->id = AV_RL32(buf + 4);
188  hdr->duration_ms = AV_RL32(buf + 8);
189  hdr->byte_rate = AV_RL32(buf + 12);
190  hdr->extradata_size = AV_RL32(buf + 16);
191 
192  /* This should always be the case. */
193  if (hdr->id != i)
194  return AVERROR_INVALIDDATA;
195 
196  /* Timestamps are in milliseconds. */
197  avpriv_set_pts_info(st, 64, 1, 1000);
198  st->duration = hdr->duration_ms;
199  st->codecpar->bit_rate = hdr->byte_rate * 8;
200 
201  if ((ret = read_extradata(s, hdr, buf, sizeof(buf))) < 0) {
202  return ret;
203  } else if (ret > 0) {
205  continue;
206  }
207 
208  if (hdr->codec_id == BRP_CODEC_ID_BVID) {
209  ArgoBVIDHeader *bvid = &hdr->extradata.bvid;
210 
213 
214  bvid->num_frames = AV_RL32(buf + 0);
215  bvid->width = AV_RL32(buf + 4);
216  bvid->height = AV_RL32(buf + 8);
217  bvid->depth = AV_RL32(buf + 12);
218 
219  if (bvid->num_frames == 0)
220  return AVERROR_INVALIDDATA;
221 
222  /* These are from 1990's games, sanity check this. */
223  if (bvid->width >= 65536 || bvid->height >= 65536 ||
224  bvid->depth > 24 || bvid->depth % 8 != 0) {
225  return AVERROR_INVALIDDATA;
226  }
227 
228  st->codecpar->width = bvid->width;
229  st->codecpar->height = bvid->height;
230  st->nb_frames = bvid->num_frames;
231  st->codecpar->bits_per_coded_sample = bvid->depth;
232  } else if (hdr->codec_id == BRP_CODEC_ID_BASF) {
233  /*
234  * It would make the demuxer significantly more complicated
235  * to support multiple BASF streams. I've never seen a file
236  * with more than one.
237  */
238  if (brp->basf.index >= 0) {
239  avpriv_request_sample(s, "Multiple BASF streams");
240  return AVERROR_PATCHWELCOME;
241  }
242 
245  brp->basf.index = i;
247 
249  return ret;
250 
251  st->nb_frames = hdr->extradata.basf.num_chunks;
252  } else if (hdr->codec_id == BRP_CODEC_ID_MASK) {
254 
256 
257  mask->num_frames = AV_RL32(buf + 0);
258  mask->width = AV_RL32(buf + 4);
259  mask->height = AV_RL32(buf + 8);
260 
261  st->nb_frames = mask->num_frames;
262  } else {
263  av_assert0(0); /* Caught above, should never happen. */
264  }
265  }
266 
267  /* Try to find the first BASF chunk. */
268  if (brp->basf.index >= 0) {
269  AVStream *st = s->streams[brp->basf.index];
270  ArgoBRPStreamHeader *hdr = brp->streams + brp->basf.index;
272  int64_t offset;
273  int i;
274 
277 
278  if ((ret = avio_tell(s->pb)) < 0)
279  return ret;
280 
281  offset = ret;
282 
283  av_log(s, AV_LOG_TRACE, "Searching %d blocks for BASF...", BRP_BASF_LOOKAHEAD);
284 
285  for (i = 0; i < BRP_BASF_LOOKAHEAD; i++) {
287  if (ret < 0)
288  return ret;
289 
290  blk.stream_id = AV_RL32(buf + 0);
291  blk.start_ms = AV_RL32(buf + 4);
292  blk.size = AV_RL32(buf + 8);
293 
294  if (blk.stream_id == brp->basf.index || blk.stream_id == -1)
295  break;
296 
297  if ((ret = avio_skip(pb, blk.size)) < 0)
298  return ret;
299  }
300 
301  if (i == BRP_BASF_LOOKAHEAD || blk.stream_id == -1) {
302  /* Don't error here, as there may still be a valid video stream. */
303  av_log(s, AV_LOG_TRACE, "not found\n");
304  goto done;
305  }
306 
307  av_log(s, AV_LOG_TRACE, "found at index %d\n", i);
308 
309  if (blk.size < ASF_CHUNK_HEADER_SIZE)
310  return AVERROR_INVALIDDATA;
311 
313  if (ret < 0)
314  return ret;
315 
317 
318  /*
319  * Special Case Hack. It seems that in files where the BASF block isn't first,
320  * v1.1 streams are allowed to be non-22050...
321  * Bump the version to 1.2 so ff_argo_asf_fill_stream() doesn't "correct" it.
322  *
323  * Found in Alien Odyssey games files in:
324  * ./GRAPHICS/COMMBUNK/{{COMADD1,COMM2_{1,2,3E},COMM3_{2,3,4,5,6}},FADE{1,2}}.BRP
325  *
326  * Either this format really inconsistent, or FX Fighter and Croc just ignored the
327  * sample rate field...
328  */
329  if (i != 0 && hdr->extradata.basf.version_major == 1 && hdr->extradata.basf.version_minor == 1)
330  hdr->extradata.basf.version_minor = 2;
331 
332  if ((ret = ff_argo_asf_fill_stream(s, st, &hdr->extradata.basf, &brp->basf.ckhdr)) < 0)
333  return ret;
334 
335  /* Convert ms to samples. */
336  st->start_time = av_rescale_rnd(blk.start_ms, st->codecpar->sample_rate, 1000, AV_ROUND_UP);
338 
339 done:
340  if ((ret = avio_seek(s->pb, offset, SEEK_SET)) < 0)
341  return ret;
342  }
343  return 0;
344 }
345 
347 {
348  ArgoBRPDemuxContext *brp = s->priv_data;
350  const ArgoBRPStreamHeader *shdr;
351  AVStream *st;
352  uint8_t buf[BRP_MIN_BUFFER_SIZE];
353  ArgoASFChunkHeader ckhdr;
354  int ret;
355 
357  if (ret < 0)
358  return ret;
359 
360  blk.stream_id = AV_RL32(buf + 0);
361  blk.start_ms = AV_RL32(buf + 4);
362  blk.size = AV_RL32(buf + 8);
363 
364  if (blk.stream_id == -1)
365  return AVERROR_EOF;
366 
367  if (blk.stream_id < -1 || blk.stream_id >= s->nb_streams)
368  return AVERROR_INVALIDDATA;
369 
370  st = s->streams[blk.stream_id];
371  shdr = brp->streams + blk.stream_id;
372 
373  if (blk.stream_id == brp->basf.index) {
374  if (blk.size < ASF_CHUNK_HEADER_SIZE)
375  return AVERROR_INVALIDDATA;
376 
378  if (ret < 0)
379  return ret;
380 
381  ff_argo_asf_parse_chunk_header(&ckhdr, buf);
382 
383  /* Ensure the chunk attributes are the same. */
384  if (ckhdr.sample_rate != brp->basf.ckhdr.sample_rate ||
385  ckhdr.flags != brp->basf.ckhdr.flags ||
386  ckhdr.unk1 != brp->basf.ckhdr.unk1 ||
387  ckhdr.unk2 != brp->basf.ckhdr.unk2)
388  return AVERROR_INVALIDDATA;
389 
390  blk.size -= ASF_CHUNK_HEADER_SIZE;
391  }
392 
393  if ((ret = av_get_packet(s->pb, pkt, blk.size)) < 0)
394  return ret;
395  else if (ret != blk.size)
396  return AVERROR_INVALIDDATA;
397 
398  if (blk.stream_id == brp->basf.index) {
399  pkt->duration = ckhdr.num_samples * ckhdr.num_blocks;
400  pkt->pts = av_rescale_rnd(blk.start_ms, ckhdr.sample_rate, 1000, AV_ROUND_UP);
401  } else if (shdr->codec_id == BRP_CODEC_ID_BVID) {
403  pkt->pts = blk.start_ms;
404  } else {
405  pkt->pts = blk.start_ms;
406  }
407 
408  pkt->stream_index = blk.stream_id;
409  return 0;
410 }
411 
413  .p.name = "argo_brp",
414  .p.long_name = NULL_IF_CONFIG_SMALL("Argonaut Games BRP"),
415  .priv_data_size = sizeof(ArgoBRPDemuxContext),
419 };
ArgoASFChunkHeader::sample_rate
uint16_t sample_rate
Definition: argo_asf.h:51
AV_ROUND_UP
@ AV_ROUND_UP
Round toward +infinity.
Definition: mathematics.h:134
ArgoASFChunkHeader::num_samples
uint32_t num_samples
Definition: argo_asf.h:49
ArgoASFChunkHeader::flags
uint32_t flags
Definition: argo_asf.h:53
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
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
ff_argo_brp_demuxer
const FFInputFormat ff_argo_brp_demuxer
Definition: argo_brp.c:412
ArgoASFChunkHeader::unk2
uint16_t unk2
Definition: argo_asf.h:52
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
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
ArgoBRPStreamHeader::extradata_size
uint32_t extradata_size
Definition: argo_brp.c:80
int64_t
long long int64_t
Definition: coverity.c:34
ArgoBRPStreamHeader::mask
ArgoMASKHeader mask
Definition: argo_brp.c:88
mask
int mask
Definition: mediacodecdec_common.c:154
ArgoBRPFileHeader::num_streams
uint32_t num_streams
Definition: argo_brp.c:52
read_extradata
static int read_extradata(AVFormatContext *s, const ArgoBRPStreamHeader *hdr, void *buf, size_t bufsz)
Definition: argo_brp.c:110
BRP_MIN_BUFFER_SIZE
#define BRP_MIN_BUFFER_SIZE
Definition: argo_brp.c:40
BRP_MAX_STREAMS
#define BRP_MAX_STREAMS
Definition: argo_brp.c:36
BRP_CODEC_ID_MASK
#define BRP_CODEC_ID_MASK
Definition: argo_brp.c:48
AVPacket::duration
int64_t duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
Definition: packet.h:553
ArgoBRPStreamHeader::bvid
ArgoBVIDHeader bvid
Definition: argo_brp.c:84
FFMAX
#define FFMAX(a, b)
Definition: macros.h:47
argo_brp_read_header
static int argo_brp_read_header(AVFormatContext *s)
Definition: argo_brp.c:150
ff_argo_asf_fill_stream
int ff_argo_asf_fill_stream(AVFormatContext *s, AVStream *st, const ArgoASFFileHeader *fhdr, const ArgoASFChunkHeader *ckhdr)
Definition: argo_asf.c:85
ArgoBVIDHeader::width
uint32_t width
Definition: argo_brp.c:64
BRP_CODEC_ID_BASF
#define BRP_CODEC_ID_BASF
Definition: argo_brp.c:47
ArgoMASKHeader::width
uint32_t width
Definition: argo_brp.c:71
ASF_FILE_HEADER_SIZE
#define ASF_FILE_HEADER_SIZE
Definition: argo_asf.h:32
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:777
ArgoASFFileHeader::version_minor
uint16_t version_minor
Definition: argo_asf.h:41
ArgoBRPDemuxContext::streams
ArgoBRPStreamHeader streams[BRP_MAX_STREAMS]
Definition: argo_brp.c:94
argo_brp_read_packet
static int argo_brp_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: argo_brp.c:346
ArgoASFChunkHeader
Definition: argo_asf.h:47
ArgoBRPStreamHeader
Definition: argo_brp.c:75
ArgoMASKHeader::num_frames
uint32_t num_frames
Definition: argo_brp.c:70
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:494
BRP_BLOCK_HEADER_SIZE
#define BRP_BLOCK_HEADER_SIZE
Definition: argo_brp.c:34
ArgoBRPBlockHeader::size
uint32_t size
Definition: argo_brp.c:59
ArgoBRPDemuxContext
Definition: argo_brp.c:92
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:804
ArgoMASKHeader::height
uint32_t height
Definition: argo_brp.c:72
ArgoBVIDHeader::height
uint32_t height
Definition: argo_brp.c:65
ArgoBRPBlockHeader::stream_id
int32_t stream_id
Definition: argo_brp.c:57
avassert.h
AV_LOG_TRACE
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition: log.h:236
pkt
AVPacket * pkt
Definition: movenc.c:60
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
MASK_HEADER_SIZE
#define MASK_HEADER_SIZE
Definition: argo_brp.c:39
ArgoASFFileHeader::num_chunks
uint32_t num_chunks
Definition: argo_asf.h:42
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:550
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:453
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:134
AV_CODEC_ID_ARGO
@ AV_CODEC_ID_ARGO
Definition: codec_id.h:311
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:40
BRP_FILE_HEADER_SIZE
#define BRP_FILE_HEADER_SIZE
Definition: argo_brp.c:33
ArgoBRPStreamHeader::byte_rate
uint32_t byte_rate
Definition: argo_brp.c:79
ArgoMASKHeader
Definition: argo_brp.c:69
blk
#define blk(i)
Definition: sha.c:186
AVMEDIA_TYPE_DATA
@ AVMEDIA_TYPE_DATA
Opaque data information usually continuous.
Definition: avutil.h:203
ArgoBVIDHeader::depth
uint32_t depth
Definition: argo_brp.c:66
ArgoBRPStreamHeader::duration_ms
uint32_t duration_ms
Definition: argo_brp.c:78
AVFormatContext
Format I/O context.
Definition: avformat.h:1265
internal.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:768
NULL
#define NULL
Definition: coverity.c:32
ArgoBRPFileHeader::magic
uint32_t magic
Definition: argo_brp.c:51
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
AV_CODEC_ID_ADPCM_ARGO
@ AV_CODEC_ID_ADPCM_ARGO
Definition: codec_id.h:416
ff_argo_asf_validate_file_header
int ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeader *hdr)
Definition: argo_asf.c:64
ArgoBRPFileHeader
Definition: argo_brp.c:50
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:451
argo_asf.h
ArgoBRPStreamHeader::codec_id
uint32_t codec_id
Definition: argo_brp.c:76
AVPROBE_SCORE_EXTENSION
#define AVPROBE_SCORE_EXTENSION
score for file extension
Definition: avformat.h:461
AVCodecParameters::sample_rate
int sample_rate
Audio only.
Definition: codec_par.h:184
AVStream::nb_frames
int64_t nb_frames
number of frames in this stream if known or 0
Definition: avformat.h:806
av_rescale_rnd
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
Definition: mathematics.c:58
BRP_TAG
#define BRP_TAG
Definition: argo_brp.c:32
ArgoASFFileHeader::version_major
uint16_t version_major
Definition: argo_asf.h:40
AVIOContext
Bytestream IO Context.
Definition: avio.h:160
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:94
BRP_BASF_LOOKAHEAD
#define BRP_BASF_LOOKAHEAD
Definition: argo_brp.c:37
size
int size
Definition: twinvq_data.h:10344
AVMEDIA_TYPE_UNKNOWN
@ AVMEDIA_TYPE_UNKNOWN
Usually treated as AVMEDIA_TYPE_DATA.
Definition: avutil.h:200
FFInputFormat::p
AVInputFormat p
The public AVInputFormat.
Definition: demux.h:46
ArgoBVIDHeader
Definition: argo_brp.c:62
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
ArgoBRPDemuxContext::basf
struct ArgoBRPDemuxContext::@383 basf
read_header
static int read_header(FFV1Context *f, RangeCoder *c)
Definition: ffv1dec.c:489
BRP_STREAM_HEADER_SIZE
#define BRP_STREAM_HEADER_SIZE
Definition: argo_brp.c:35
ArgoBRPDemuxContext::fhdr
ArgoBRPFileHeader fhdr
Definition: argo_brp.c:93
ArgoBVIDHeader::num_frames
uint32_t num_frames
Definition: argo_brp.c:63
ArgoBRPDemuxContext::ckhdr
ArgoASFChunkHeader ckhdr
Definition: argo_brp.c:98
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVPacket::pts
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
Definition: packet.h:528
avio_internal.h
internal.h
AVCodecParameters::height
int height
Definition: codec_par.h:135
ff_argo_asf_parse_chunk_header
void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t *buf)
Definition: argo_asf.c:75
argo_brp_probe
static int argo_brp_probe(const AVProbeData *p)
Definition: argo_brp.c:102
demux.h
ArgoBRPFileHeader::byte_rate
uint32_t byte_rate
Definition: argo_brp.c:53
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:94
ArgoBRPBlockHeader::start_ms
uint32_t start_ms
Definition: argo_brp.c:58
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:745
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:231
ArgoBRPStreamHeader::id
uint32_t id
Definition: argo_brp.c:77
ArgoASFChunkHeader::num_blocks
uint32_t num_blocks
Definition: argo_asf.h:48
avformat.h
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
ArgoASFFileHeader
Definition: argo_asf.h:38
ArgoBRPBlockHeader
Definition: argo_brp.c:56
ArgoASFChunkHeader::unk1
uint32_t unk1
Definition: argo_asf.h:50
ASF_CHUNK_HEADER_SIZE
#define ASF_CHUNK_HEADER_SIZE
Definition: argo_asf.h:33
BRP_CODEC_ID_BVID
#define BRP_CODEC_ID_BVID
Definition: argo_brp.c:46
AVPacket::stream_index
int stream_index
Definition: packet.h:537
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:318
ASF_MIN_BUFFER_SIZE
#define ASF_MIN_BUFFER_SIZE
Definition: argo_asf.h:35
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:110
ff_argo_asf_parse_file_header
void ff_argo_asf_parse_file_header(ArgoASFFileHeader *hdr, const uint8_t *buf)
Definition: argo_asf.c:53
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:37
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:512
FFInputFormat
Definition: demux.h:42
ArgoBRPStreamHeader::basf
ArgoASFFileHeader basf
Definition: argo_brp.c:86
BVID_HEADER_SIZE
#define BVID_HEADER_SIZE
Definition: argo_brp.c:38
int32_t
int32_t
Definition: audioconvert.c:56
AVCodecParameters::bit_rate
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
Definition: codec_par.h:97
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
ArgoBRPDemuxContext::index
int index
Definition: argo_brp.c:97
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
ffio_read_size
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:662
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:794
ArgoBRPStreamHeader::extradata
union ArgoBRPStreamHeader::@382 extradata