FFmpeg
cinedec.c
Go to the documentation of this file.
1 /*
2  * Phantom Cine demuxer
3  * Copyright (c) 2010-2011 Peter Ross <pross@xvid.org>
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 /**
23  * @file
24  * Phantom Cine demuxer
25  * @author Peter Ross <pross@xvid.org>
26  */
27 
28 #include "libavutil/intreadwrite.h"
29 #include "libavutil/mem.h"
30 #include "libavcodec/bmp.h"
31 #include "libavutil/intfloat.h"
32 #include "avformat.h"
33 #include "demux.h"
34 #include "internal.h"
35 
36 typedef struct {
37  uint64_t pts;
38  uint64_t maxsize;
40 
41 /** Compression */
42 enum {
43  CC_RGB = 0, /**< Gray */
44  CC_LEAD = 1, /**< LEAD (M)JPEG */
45  CC_UNINT = 2 /**< Uninterpolated color image (CFA field indicates color ordering) */
46 };
47 
48 /** Color Filter Array */
49 enum {
50  CFA_NONE = 0, /**< GRAY */
51  CFA_VRI = 1, /**< GBRG/RGGB */
52  CFA_VRIV6 = 2, /**< BGGR/GRBG */
53  CFA_BAYER = 3, /**< GB/RG */
54  CFA_BAYERFLIP = 4, /**< RG/GB */
55 };
56 
57 #define CFA_TLGRAY 0x80000000U
58 #define CFA_TRGRAY 0x40000000U
59 #define CFA_BLGRAY 0x20000000U
60 #define CFA_BRGRAY 0x10000000U
61 
62 static int cine_read_probe(const AVProbeData *p)
63 {
64  int HeaderSize;
65  if (p->buf[0] == 'C' && p->buf[1] == 'I' && // Type
66  (HeaderSize = AV_RL16(p->buf + 2)) >= 0x2C && // HeaderSize
67  AV_RL16(p->buf + 4) <= CC_UNINT && // Compression
68  AV_RL16(p->buf + 6) <= 1 && // Version
69  AV_RL32(p->buf + 20) && // ImageCount
70  AV_RL32(p->buf + 24) >= HeaderSize && // OffImageHeader
71  AV_RL32(p->buf + 28) >= HeaderSize && // OffSetup
72  AV_RL32(p->buf + 32) >= HeaderSize) // OffImageOffsets
73  return AVPROBE_SCORE_MAX;
74  return 0;
75 }
76 
77 static int set_metadata_int(AVDictionary **dict, const char *key, int value, int allow_zero)
78 {
79  if (value || allow_zero) {
80  return av_dict_set_int(dict, key, value, 0);
81  }
82  return 0;
83 }
84 
85 static int set_metadata_float(AVDictionary **dict, const char *key, float value, int allow_zero)
86 {
87  if (value != 0 || allow_zero) {
88  char tmp[64];
89  snprintf(tmp, sizeof(tmp), "%f", value);
90  return av_dict_set(dict, key, tmp, 0);
91  }
92  return 0;
93 }
94 
96 {
97  AVIOContext *pb = avctx->pb;
98  AVStream *st;
99  unsigned int version, compression, offImageHeader, offSetup, offImageOffsets, biBitCount, length, CFA;
100  int vflip;
101  char *description;
102  uint64_t i;
103 
104  st = avformat_new_stream(avctx, NULL);
105  if (!st)
106  return AVERROR(ENOMEM);
109  st->codecpar->codec_tag = 0;
110 
111  /* CINEFILEHEADER structure */
112  avio_skip(pb, 4); // Type, Headersize
113 
114  compression = avio_rl16(pb);
115  version = avio_rl16(pb);
116  if (version != 1) {
117  avpriv_request_sample(avctx, "unknown version %i", version);
118  return AVERROR_INVALIDDATA;
119  }
120 
121  avio_skip(pb, 12); // FirstMovieImage, TotalImageCount, FirstImageNumber
122 
123  st->duration = avio_rl32(pb);
124  offImageHeader = avio_rl32(pb);
125  offSetup = avio_rl32(pb);
126  offImageOffsets = avio_rl32(pb);
127 
128  avio_skip(pb, 8); // TriggerTime
129 
130  /* BITMAPINFOHEADER structure */
131  avio_seek(pb, offImageHeader, SEEK_SET);
132  avio_skip(pb, 4); //biSize
133  st->codecpar->width = avio_rl32(pb);
134  st->codecpar->height = avio_rl32(pb);
135 
136  if (avio_rl16(pb) != 1) // biPlanes
137  return AVERROR_INVALIDDATA;
138 
139  biBitCount = avio_rl16(pb);
140  if (biBitCount != 8 && biBitCount != 16 && biBitCount != 24 && biBitCount != 48) {
141  avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
142  return AVERROR_INVALIDDATA;
143  }
144 
145  switch (avio_rl32(pb)) {
146  case BMP_RGB:
147  vflip = 0;
148  break;
149  case 0x100: /* BI_PACKED */
150  st->codecpar->codec_tag = MKTAG('B', 'I', 'T', 0);
151  vflip = 1;
152  break;
153  default:
154  avpriv_request_sample(avctx, "unknown bitmap compression");
155  return AVERROR_INVALIDDATA;
156  }
157 
158  avio_skip(pb, 4); // biSizeImage
159 
160  /* parse SETUP structure */
161  avio_seek(pb, offSetup, SEEK_SET);
162  avio_skip(pb, 140); // FrameRatae16 .. descriptionOld
163  if (avio_rl16(pb) != 0x5453)
164  return AVERROR_INVALIDDATA;
165  length = avio_rl16(pb);
166  if (length < 0x163C) {
167  avpriv_request_sample(avctx, "short SETUP header");
168  return AVERROR_INVALIDDATA;
169  }
170 
171  avio_skip(pb, 616); // Binning .. bFlipH
172  if (!avio_rl32(pb) ^ vflip) {
173  st->codecpar->extradata = av_strdup("BottomUp");
174  if (!st->codecpar->extradata) {
175  st->codecpar->extradata_size = 0;
176  return AVERROR(ENOMEM);
177  }
178  st->codecpar->extradata_size = 9;
179  }
180 
181  avio_skip(pb, 4); // Grid
182 
183  avpriv_set_pts_info(st, 64, 1, avio_rl32(pb));
184 
185  avio_skip(pb, 20); // Shutter .. bEnableColor
186 
187  set_metadata_int(&st->metadata, "camera_version", avio_rl32(pb), 0);
188  set_metadata_int(&st->metadata, "firmware_version", avio_rl32(pb), 0);
189  set_metadata_int(&st->metadata, "software_version", avio_rl32(pb), 0);
190  set_metadata_int(&st->metadata, "recording_timezone", avio_rl32(pb), 0);
191 
192  CFA = avio_rl32(pb);
193 
194  set_metadata_int(&st->metadata, "brightness", avio_rl32(pb), 1);
195  set_metadata_int(&st->metadata, "contrast", avio_rl32(pb), 1);
196  set_metadata_int(&st->metadata, "gamma", avio_rl32(pb), 1);
197 
198  avio_skip(pb, 12 + 16); // Reserved1 .. AutoExpRect
199  set_metadata_float(&st->metadata, "wbgain[0].r", av_int2float(avio_rl32(pb)), 1);
200  set_metadata_float(&st->metadata, "wbgain[0].b", av_int2float(avio_rl32(pb)), 1);
201  avio_skip(pb, 36); // WBGain[1].. WBView
202 
204 
205  if (compression == CC_RGB) {
206  if (biBitCount == 8) {
208  } else if (biBitCount == 16) {
210  } else if (biBitCount == 24) {
212  } else if (biBitCount == 48) {
214  } else {
215  avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
216  return AVERROR_INVALIDDATA;
217  }
218  } else if (compression == CC_UNINT) {
219  switch (CFA & 0xFFFFFF) {
220  case CFA_BAYER:
221  if (biBitCount == 8) {
223  } else if (biBitCount == 16) {
225  } else {
226  avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
227  return AVERROR_INVALIDDATA;
228  }
229  break;
230  case CFA_BAYERFLIP:
231  if (biBitCount == 8) {
233  } else if (biBitCount == 16) {
235  } else {
236  avpriv_request_sample(avctx, "unsupported biBitCount %i", biBitCount);
237  return AVERROR_INVALIDDATA;
238  }
239  break;
240  default:
241  avpriv_request_sample(avctx, "unsupported Color Field Array (CFA) %i", CFA & 0xFFFFFF);
242  return AVERROR_INVALIDDATA;
243  }
244  } else { //CC_LEAD
245  avpriv_request_sample(avctx, "unsupported compression %i", compression);
246  return AVERROR_INVALIDDATA;
247  }
248 
249  avio_skip(pb, 668); // Conv8Min ... Sensor
250 
251  set_metadata_int(&st->metadata, "shutter_ns", avio_rl32(pb), 0);
252 
253  avio_skip(pb, 24); // EDRShutterNs ... ImHeightAcq
254 
255 #define DESCRIPTION_SIZE 4096
257  if (!description)
258  return AVERROR(ENOMEM);
260  if (i < DESCRIPTION_SIZE)
262  if (description[0])
264  else
266 
267  avio_skip(pb, 1176); // RisingEdge ... cmUser
268 
269  set_metadata_int(&st->metadata, "enable_crop", avio_rl32(pb), 1);
270  set_metadata_int(&st->metadata, "crop_left", avio_rl32(pb), 1);
271  set_metadata_int(&st->metadata, "crop_top", avio_rl32(pb), 1);
272  set_metadata_int(&st->metadata, "crop_right", avio_rl32(pb), 1);
273  set_metadata_int(&st->metadata, "crop_bottom", avio_rl32(pb), 1);
274 
275  /* parse image offsets */
276  avio_seek(pb, offImageOffsets, SEEK_SET);
277  for (i = 0; i < st->duration; i++) {
278  int64_t pos = avio_rl64(pb);
279  if (avio_feof(pb) || pos < 0)
280  return AVERROR_INVALIDDATA;
281 
283  }
284 
285  return 0;
286 }
287 
289 {
290  CineDemuxContext *cine = avctx->priv_data;
291  AVStream *st = avctx->streams[0];
292  FFStream *const sti = ffstream(st);
293  AVIOContext *pb = avctx->pb;
294  int n, size, ret;
295  int64_t ret64;
296 
297  if (cine->pts >= sti->nb_index_entries)
298  return AVERROR_EOF;
299 
300  ret64 = avio_seek(pb, sti->index_entries[cine->pts].pos, SEEK_SET);
301  if (ret64 < 0)
302  return ret64;
303  n = avio_rl32(pb);
304  if (n < 8)
305  return AVERROR_INVALIDDATA;
306  avio_skip(pb, n - 8);
307  size = avio_rl32(pb);
308  if (avio_feof(pb) || size < 0)
309  return AVERROR_INVALIDDATA;
310 
311  if (cine->maxsize && (uint64_t)sti->index_entries[cine->pts].pos + size + n > cine->maxsize)
312  size = cine->maxsize - sti->index_entries[cine->pts].pos - n;
313 
314  ret = av_get_packet(pb, pkt, size);
315  if (ret < 0)
316  return ret;
317 
318  if (ret != size)
319  cine->maxsize = (uint64_t)sti->index_entries[cine->pts].pos + n + ret;
320 
321  pkt->pts = cine->pts++;
322  pkt->stream_index = 0;
324  return 0;
325 }
326 
327 static int cine_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
328 {
329  CineDemuxContext *cine = avctx->priv_data;
330 
332  return AVERROR(ENOSYS);
333 
334  if (!(avctx->pb->seekable & AVIO_SEEKABLE_NORMAL))
335  return AVERROR(EIO);
336 
337  cine->pts = timestamp;
338  return 0;
339 }
340 
342  .p.name = "cine",
343  .p.long_name = NULL_IF_CONFIG_SMALL("Phantom Cine"),
344  .priv_data_size = sizeof(CineDemuxContext),
349 };
AVCodecParameters::extradata
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
Definition: codec_par.h:69
CC_RGB
@ CC_RGB
Gray.
Definition: cinedec.c:43
AV_PIX_FMT_BAYER_GBRG16LE
@ AV_PIX_FMT_BAYER_GBRG16LE
bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian
Definition: pixfmt.h:293
AV_PIX_FMT_BGR48LE
@ AV_PIX_FMT_BGR48LE
packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as lit...
Definition: pixfmt.h:146
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
AVCodecParameters::codec_type
enum AVMediaType codec_type
General type of the encoded data.
Definition: codec_par.h:51
AVSEEK_FLAG_FRAME
#define AVSEEK_FLAG_FRAME
seeking based on frame number
Definition: avformat.h:2501
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
int64_t
long long int64_t
Definition: coverity.c:34
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:65
ff_cine_demuxer
const FFInputFormat ff_cine_demuxer
Definition: cinedec.c:341
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:28
AVFormatContext::streams
AVStream ** streams
A list of all streams in the file.
Definition: avformat.h:1368
AVSEEK_FLAG_BYTE
#define AVSEEK_FLAG_BYTE
seeking based on position in bytes
Definition: avformat.h:2499
AV_PIX_FMT_BGR24
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:76
AVCodecParameters::codec_tag
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
Definition: codec_par.h:59
AVDictionary
Definition: dict.c:34
BMP_RGB
@ BMP_RGB
Definition: bmp.h:26
intfloat.h
AV_PKT_FLAG_KEY
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: packet.h:594
CC_UNINT
@ CC_UNINT
Uninterpolated color image (CFA field indicates color ordering)
Definition: cinedec.c:45
cine_read_header
static int cine_read_header(AVFormatContext *avctx)
Definition: cinedec.c:95
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
AVINDEX_KEYFRAME
#define AVINDEX_KEYFRAME
Definition: avformat.h:610
DESCRIPTION_SIZE
#define DESCRIPTION_SIZE
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:463
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:867
ffstream
static av_always_inline FFStream * ffstream(AVStream *st)
Definition: internal.h:358
av_int2float
static av_always_inline float av_int2float(uint32_t i)
Reinterpret a 32-bit integer as a float.
Definition: intfloat.h:40
read_seek
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:151
av_add_index_entry
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
Definition: seek.c:122
CineDemuxContext::maxsize
uint64_t maxsize
Definition: cinedec.c:38
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:807
avio_rl16
unsigned int avio_rl16(AVIOContext *s)
Definition: aviobuf.c:714
AV_DICT_DONT_STRDUP_VAL
#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
description
Tag description
Definition: snow.txt:206
pkt
AVPacket * pkt
Definition: movenc.c:60
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
set_metadata_float
static int set_metadata_float(AVDictionary **dict, const char *key, float value, int allow_zero)
Definition: cinedec.c:85
intreadwrite.h
AV_PIX_FMT_BAYER_RGGB16LE
@ AV_PIX_FMT_BAYER_RGGB16LE
bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian
Definition: pixfmt.h:291
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:553
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:453
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:134
CFA_VRI
@ CFA_VRI
GBRG/RGGB.
Definition: cinedec.c:51
CFA_BAYERFLIP
@ CFA_BAYERFLIP
RG/GB.
Definition: cinedec.c:54
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
key
const char * key
Definition: hwcontext_opencl.c:189
cine_read_packet
static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt)
Definition: cinedec.c:288
AV_PIX_FMT_BAYER_RGGB8
@ AV_PIX_FMT_BAYER_RGGB8
bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples
Definition: pixfmt.h:286
AVFormatContext
Format I/O context.
Definition: avformat.h:1300
internal.h
bmp.h
AVStream::codecpar
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Definition: avformat.h:771
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:540
NULL
#define NULL
Definition: coverity.c:32
AVFormatContext::pb
AVIOContext * pb
I/O context.
Definition: avformat.h:1342
FFStream::nb_index_entries
int nb_index_entries
Definition: internal.h:190
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:451
AVStream::metadata
AVDictionary * metadata
Definition: avformat.h:828
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
cine_read_probe
static int cine_read_probe(const AVProbeData *p)
Definition: cinedec.c:62
AVCodecParameters::extradata_size
int extradata_size
Size of the extradata content in bytes.
Definition: codec_par.h:73
avio_rl32
unsigned int avio_rl32(AVIOContext *s)
Definition: aviobuf.c:730
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
AVIOContext::seekable
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
Definition: avio.h:261
FFStream
Definition: internal.h:132
avio_get_str
int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen)
Read a string from pb into buf.
Definition: aviobuf.c:866
size
int size
Definition: twinvq_data.h:10344
CineDemuxContext
Definition: cinedec.c:36
FFInputFormat::p
AVInputFormat p
The public AVInputFormat.
Definition: demux.h:46
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:545
version
version
Definition: libkvazaar.c:321
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:532
AVCodecParameters::height
int height
Definition: codec_par.h:135
AV_PIX_FMT_BAYER_GBRG8
@ AV_PIX_FMT_BAYER_GBRG8
bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples
Definition: pixfmt.h:287
value
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 value
Definition: writing_filters.txt:86
CC_LEAD
@ CC_LEAD
LEAD (M)JPEG.
Definition: cinedec.c:44
demux.h
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:91
ret
ret
Definition: filter_design.txt:187
AVStream
Stream structure.
Definition: avformat.h:748
avio_seek
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
Definition: aviobuf.c:231
pos
unsigned int pos
Definition: spdifenc.c:414
CineDemuxContext::pts
uint64_t pts
Definition: cinedec.c:37
avformat.h
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
AVIO_SEEKABLE_NORMAL
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
Definition: avio.h:41
CFA_NONE
@ CFA_NONE
GRAY.
Definition: cinedec.c:50
AVIndexEntry::pos
int64_t pos
Definition: avformat.h:603
CFA_VRIV6
@ CFA_VRIV6
BGGR/GRBG.
Definition: cinedec.c:52
AVPacket::stream_index
int stream_index
Definition: packet.h:541
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:318
FFStream::index_entries
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
Definition: internal.h:188
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:167
av_strdup
char * av_strdup(const char *s)
Duplicate a string.
Definition: mem.c:272
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AV_PIX_FMT_GRAY16LE
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
Definition: pixfmt.h:105
AVCodecParameters::bits_per_coded_sample
int bits_per_coded_sample
The number of bits per sample in the codedwords.
Definition: codec_par.h:110
mem.h
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:36
AVCodecParameters::format
int format
Definition: codec_par.h:92
av_free
#define av_free(p)
Definition: tableprint_vlc.h:33
set_metadata_int
static int set_metadata_int(AVDictionary **dict, const char *key, int value, int allow_zero)
Definition: cinedec.c:77
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:516
av_dict_set
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:88
FFInputFormat
Definition: demux.h:42
avio_rl64
uint64_t avio_rl64(AVIOContext *s)
Definition: aviobuf.c:738
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
CFA_BAYER
@ CFA_BAYER
GB/RG.
Definition: cinedec.c:53
snprintf
#define snprintf
Definition: snprintf.h:34
AVFormatContext::priv_data
void * priv_data
Format private data.
Definition: avformat.h:1328
cine_read_seek
static int cine_read_seek(AVFormatContext *avctx, int stream_index, int64_t timestamp, int flags)
Definition: cinedec.c:327
avio_feof
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition: aviobuf.c:346