FFmpeg
img2dec.c
Go to the documentation of this file.
1 /*
2  * Image format
3  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4  * Copyright (c) 2004 Michael Niedermayer
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 #define _DEFAULT_SOURCE
26 #define _BSD_SOURCE
27 #include <sys/stat.h>
28 #include "libavutil/avstring.h"
29 #include "libavutil/log.h"
30 #include "libavutil/opt.h"
31 #include "libavutil/pixdesc.h"
32 #include "libavutil/parseutils.h"
33 #include "libavutil/intreadwrite.h"
34 #include "libavcodec/gif.h"
35 #include "avformat.h"
36 #include "avio_internal.h"
37 #include "internal.h"
38 #include "img2.h"
39 #include "os_support.h"
41 #include "libavcodec/mjpeg.h"
42 #include "libavcodec/vbn.h"
43 #include "libavcodec/xwd.h"
44 #include "subtitles.h"
45 
46 #if HAVE_GLOB
47 /* Locally define as 0 (bitwise-OR no-op) any missing glob options that
48  are non-posix glibc/bsd extensions. */
49 #ifndef GLOB_NOMAGIC
50 #define GLOB_NOMAGIC 0
51 #endif
52 #ifndef GLOB_BRACE
53 #define GLOB_BRACE 0
54 #endif
55 
56 #endif /* HAVE_GLOB */
57 
58 static const int sizes[][2] = {
59  { 640, 480 },
60  { 720, 480 },
61  { 720, 576 },
62  { 352, 288 },
63  { 352, 240 },
64  { 160, 128 },
65  { 512, 384 },
66  { 640, 352 },
67  { 640, 240 },
68 };
69 
70 static int infer_size(int *width_ptr, int *height_ptr, int size)
71 {
72  int i;
73 
74  for (i = 0; i < FF_ARRAY_ELEMS(sizes); i++) {
75  if ((sizes[i][0] * sizes[i][1]) == size) {
76  *width_ptr = sizes[i][0];
77  *height_ptr = sizes[i][1];
78  return 0;
79  }
80  }
81 
82  return -1;
83 }
84 
85 static int is_glob(const char *path)
86 {
87 #if HAVE_GLOB
88  size_t span = 0;
89  const char *p = path;
90 
91  while (p = strchr(p, '%')) {
92  if (*(++p) == '%') {
93  ++p;
94  continue;
95  }
96  if (span = strspn(p, "*?[]{}"))
97  break;
98  }
99  /* Did we hit a glob char or get to the end? */
100  return span != 0;
101 #else
102  return 0;
103 #endif
104 }
105 
106 /**
107  * Get index range of image files matched by path.
108  *
109  * @param pfirst_index pointer to index updated with the first number in the range
110  * @param plast_index pointer to index updated with the last number in the range
111  * @param path path which has to be matched by the image files in the range
112  * @param start_index minimum accepted value for the first index in the range
113  * @return -1 if no image file could be found
114  */
115 static int find_image_range(AVIOContext *pb, int *pfirst_index, int *plast_index,
116  const char *path, int start_index, int start_index_range)
117 {
118  char buf[1024];
119  int range, last_index, range1, first_index;
120 
121  /* find the first image */
122  for (first_index = start_index; first_index < start_index + start_index_range; first_index++) {
123  if (av_get_frame_filename(buf, sizeof(buf), path, first_index) < 0) {
124  *pfirst_index =
125  *plast_index = 1;
126  if (pb || avio_check(buf, AVIO_FLAG_READ) > 0)
127  return 0;
128  return -1;
129  }
130  if (avio_check(buf, AVIO_FLAG_READ) > 0)
131  break;
132  }
133  if (first_index == start_index + start_index_range)
134  goto fail;
135 
136  /* find the last image */
137  last_index = first_index;
138  for (;;) {
139  range = 0;
140  for (;;) {
141  if (!range)
142  range1 = 1;
143  else
144  range1 = 2 * range;
145  if (av_get_frame_filename(buf, sizeof(buf), path,
146  last_index + range1) < 0)
147  goto fail;
148  if (avio_check(buf, AVIO_FLAG_READ) <= 0)
149  break;
150  range = range1;
151  /* just in case... */
152  if (range >= (1 << 30))
153  goto fail;
154  }
155  /* we are sure than image last_index + range exists */
156  if (!range)
157  break;
158  last_index += range;
159  }
160  *pfirst_index = first_index;
161  *plast_index = last_index;
162  return 0;
163 
164 fail:
165  return -1;
166 }
167 
168 static int img_read_probe(const AVProbeData *p)
169 {
170  if (p->filename && ff_guess_image2_codec(p->filename)) {
172  return AVPROBE_SCORE_MAX;
173  else if (is_glob(p->filename))
174  return AVPROBE_SCORE_MAX;
175  else if (p->filename[strcspn(p->filename, "*?{")]) // probably PT_GLOB
176  return AVPROBE_SCORE_EXTENSION + 2; // score chosen to be a tad above the image pipes
177  else if (p->buf_size == 0)
178  return 0;
179  else if (av_match_ext(p->filename, "raw") || av_match_ext(p->filename, "gif"))
180  return 5;
181  else
183  }
184  return 0;
185 }
186 
188 {
189  VideoDemuxData *s = s1->priv_data;
190  int first_index = 1, last_index = 1;
191  AVStream *st;
193 
194  s1->ctx_flags |= AVFMTCTX_NOHEADER;
195 
196  st = avformat_new_stream(s1, NULL);
197  if (!st) {
198  return AVERROR(ENOMEM);
199  }
200 
201  if (s->pixel_format &&
202  (pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) {
203  av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n",
204  s->pixel_format);
205  return AVERROR(EINVAL);
206  }
207 
208  av_strlcpy(s->path, s1->url, sizeof(s->path));
209  s->img_number = 0;
210  s->img_count = 0;
211 
212  /* find format */
213  if (s1->iformat->flags & AVFMT_NOFILE)
214  s->is_pipe = 0;
215  else {
216  s->is_pipe = 1;
218  }
219 
220  if (s->ts_from_file == 2) {
221 #if !HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
222  av_log(s1, AV_LOG_ERROR, "POSIX.1-2008 not supported, nanosecond file timestamps unavailable\n");
223  return AVERROR(ENOSYS);
224 #endif
225  avpriv_set_pts_info(st, 64, 1, 1000000000);
226  } else if (s->ts_from_file)
227  avpriv_set_pts_info(st, 64, 1, 1);
228  else {
229  avpriv_set_pts_info(st, 64, s->framerate.den, s->framerate.num);
230  st->avg_frame_rate = st->r_frame_rate = s->framerate;
231  }
232 
233  if (s->width && s->height) {
234  st->codecpar->width = s->width;
235  st->codecpar->height = s->height;
236  }
237 
238  if (!s->is_pipe) {
239  if (s->pattern_type == PT_DEFAULT) {
240  if (s1->pb) {
241  s->pattern_type = PT_NONE;
242  } else
243  s->pattern_type = PT_GLOB_SEQUENCE;
244  }
245 
246  if (s->pattern_type == PT_GLOB_SEQUENCE) {
247  s->use_glob = is_glob(s->path);
248  if (s->use_glob) {
249 #if HAVE_GLOB
250  char *p = s->path, *q, *dup;
251  int gerr;
252 #endif
253 
254  av_log(s1, AV_LOG_WARNING, "Pattern type 'glob_sequence' is deprecated: "
255  "use pattern_type 'glob' instead\n");
256 #if HAVE_GLOB
257  dup = q = av_strdup(p);
258  while (*q) {
259  /* Do we have room for the next char and a \ insertion? */
260  if ((p - s->path) >= (sizeof(s->path) - 2))
261  break;
262  if (*q == '%' && strspn(q + 1, "%*?[]{}"))
263  ++q;
264  else if (strspn(q, "\\*?[]{}"))
265  *p++ = '\\';
266  *p++ = *q++;
267  }
268  *p = 0;
269  av_free(dup);
270 
271  gerr = glob(s->path, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL, &s->globstate);
272  if (gerr != 0) {
273  return AVERROR(ENOENT);
274  }
275  first_index = 0;
276  last_index = s->globstate.gl_pathc - 1;
277 #endif
278  }
279  }
280  if ((s->pattern_type == PT_GLOB_SEQUENCE && !s->use_glob) || s->pattern_type == PT_SEQUENCE) {
281  if (find_image_range(s1->pb, &first_index, &last_index, s->path,
282  s->start_number, s->start_number_range) < 0) {
284  "Could find no file with path '%s' and index in the range %d-%d\n",
285  s->path, s->start_number, s->start_number + s->start_number_range - 1);
286  return AVERROR(ENOENT);
287  }
288  } else if (s->pattern_type == PT_GLOB) {
289 #if HAVE_GLOB
290  int gerr;
291  gerr = glob(s->path, GLOB_NOCHECK|GLOB_BRACE|GLOB_NOMAGIC, NULL, &s->globstate);
292  if (gerr != 0) {
293  return AVERROR(ENOENT);
294  }
295  first_index = 0;
296  last_index = s->globstate.gl_pathc - 1;
297  s->use_glob = 1;
298 #else
300  "Pattern type 'glob' was selected but globbing "
301  "is not supported by this libavformat build\n");
302  return AVERROR(ENOSYS);
303 #endif
304  } else if (s->pattern_type != PT_GLOB_SEQUENCE && s->pattern_type != PT_NONE) {
306  "Unknown value '%d' for pattern_type option\n", s->pattern_type);
307  return AVERROR(EINVAL);
308  }
309  s->img_first = first_index;
310  s->img_last = last_index;
311  s->img_number = first_index;
312  /* compute duration */
313  if (!s->ts_from_file) {
314  st->start_time = 0;
315  st->duration = last_index - first_index + 1;
316  }
317  }
318 
319  if (s1->video_codec_id) {
321  st->codecpar->codec_id = s1->video_codec_id;
322  } else if (s1->audio_codec_id) {
324  st->codecpar->codec_id = s1->audio_codec_id;
325  } else if (s1->iformat->raw_codec_id) {
327  st->codecpar->codec_id = s1->iformat->raw_codec_id;
328  } else {
329  const char *str = strrchr(s->path, '.');
330  s->split_planes = str && !av_strcasecmp(str + 1, "y");
332  if (s1->pb) {
333  int probe_buffer_size = 2048;
334  uint8_t *probe_buffer = av_realloc(NULL, probe_buffer_size + AVPROBE_PADDING_SIZE);
335  const AVInputFormat *fmt = NULL;
336  void *fmt_iter = NULL;
337  AVProbeData pd = { 0 };
338 
339  if (!probe_buffer)
340  return AVERROR(ENOMEM);
341 
342  probe_buffer_size = avio_read(s1->pb, probe_buffer, probe_buffer_size);
343  if (probe_buffer_size < 0) {
344  av_free(probe_buffer);
345  return probe_buffer_size;
346  }
347  memset(probe_buffer + probe_buffer_size, 0, AVPROBE_PADDING_SIZE);
348 
349  pd.buf = probe_buffer;
350  pd.buf_size = probe_buffer_size;
351  pd.filename = s1->url;
352 
353  while ((fmt = av_demuxer_iterate(&fmt_iter))) {
354  if (fmt->read_header != ff_img_read_header ||
355  !fmt->read_probe ||
356  (fmt->flags & AVFMT_NOFILE) ||
357  !fmt->raw_codec_id)
358  continue;
359  if (fmt->read_probe(&pd) > 0) {
360  st->codecpar->codec_id = fmt->raw_codec_id;
361  break;
362  }
363  }
364  if (s1->flags & AVFMT_FLAG_CUSTOM_IO) {
365  avio_seek(s1->pb, 0, SEEK_SET);
366  av_freep(&probe_buffer);
367  } else
368  ffio_rewind_with_probe_data(s1->pb, &probe_buffer, probe_buffer_size);
369  }
370  if (st->codecpar->codec_id == AV_CODEC_ID_NONE)
372  if (st->codecpar->codec_id == AV_CODEC_ID_LJPEG)
374  if (st->codecpar->codec_id == AV_CODEC_ID_ALIAS_PIX) // we cannot distingiush this from BRENDER_PIX
376  }
377  if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &&
379  st->codecpar->format = pix_fmt;
380 
381  return 0;
382 }
383 
384 /**
385  * Add this frame's source path and basename to packet's sidedata
386  * as a dictionary, so it can be used by filters like 'drawtext'.
387  */
388 static int add_filename_as_pkt_side_data(char *filename, AVPacket *pkt) {
389  AVDictionary *d = NULL;
390  char *packed_metadata = NULL;
391  size_t metadata_len;
392  int ret;
393 
394  av_dict_set(&d, "lavf.image2dec.source_path", filename, 0);
395  av_dict_set(&d, "lavf.image2dec.source_basename", av_basename(filename), 0);
396 
397  packed_metadata = av_packet_pack_dictionary(d, &metadata_len);
398  av_dict_free(&d);
399  if (!packed_metadata)
400  return AVERROR(ENOMEM);
402  packed_metadata, metadata_len);
403  if (ret < 0) {
404  av_freep(&packed_metadata);
405  return ret;
406  }
407  return 0;
408 }
409 
411 {
412  VideoDemuxData *s = s1->priv_data;
413  char filename_bytes[1024];
414  char *filename = filename_bytes;
415  int i, res;
416  int size[3] = { 0 }, ret[3] = { 0 };
417  AVIOContext *f[3] = { NULL };
418  AVCodecParameters *par = s1->streams[0]->codecpar;
419 
420  if (!s->is_pipe) {
421  /* loop over input */
422  if (s->loop && s->img_number > s->img_last) {
423  s->img_number = s->img_first;
424  }
425  if (s->img_number > s->img_last)
426  return AVERROR_EOF;
427  if (s->pattern_type == PT_NONE) {
428  av_strlcpy(filename_bytes, s->path, sizeof(filename_bytes));
429  } else if (s->use_glob) {
430 #if HAVE_GLOB
431  filename = s->globstate.gl_pathv[s->img_number];
432 #endif
433  } else {
434  if (av_get_frame_filename(filename_bytes, sizeof(filename_bytes),
435  s->path,
436  s->img_number) < 0 && s->img_number > 1)
437  return AVERROR(EIO);
438  }
439  for (i = 0; i < 3; i++) {
440  if (s1->pb &&
441  !strcmp(filename_bytes, s->path) &&
442  !s->loop &&
443  !s->split_planes) {
444  f[i] = s1->pb;
445  } else if (s1->io_open(s1, &f[i], filename, AVIO_FLAG_READ, NULL) < 0) {
446  if (i >= 1)
447  break;
448  av_log(s1, AV_LOG_ERROR, "Could not open file : %s\n",
449  filename);
450  return AVERROR(EIO);
451  }
452  size[i] = avio_size(f[i]);
453 
454  if (!s->split_planes)
455  break;
456  filename[strlen(filename) - 1] = 'U' + i;
457  }
458 
459  if (par->codec_id == AV_CODEC_ID_NONE) {
460  AVProbeData pd = { 0 };
461  const AVInputFormat *ifmt;
463  int ret;
464  int score = 0;
465 
467  if (ret < 0)
468  return ret;
469  memset(header + ret, 0, sizeof(header) - ret);
470  avio_skip(f[0], -ret);
471  pd.buf = header;
472  pd.buf_size = ret;
473  pd.filename = filename;
474 
475  ifmt = av_probe_input_format3(&pd, 1, &score);
476  if (ifmt && ifmt->read_packet == ff_img_read_packet && ifmt->raw_codec_id)
477  par->codec_id = ifmt->raw_codec_id;
478  }
479 
480  if (par->codec_id == AV_CODEC_ID_RAWVIDEO && !par->width)
481  infer_size(&par->width, &par->height, size[0]);
482  } else {
483  f[0] = s1->pb;
484  if (avio_feof(f[0]) && s->loop && s->is_pipe)
485  avio_seek(f[0], 0, SEEK_SET);
486  if (avio_feof(f[0]))
487  return AVERROR_EOF;
488  if (s->frame_size > 0) {
489  size[0] = s->frame_size;
490  } else if (!ffstream(s1->streams[0])->parser) {
491  size[0] = avio_size(s1->pb);
492  } else {
493  size[0] = 4096;
494  }
495  }
496 
497  res = av_new_packet(pkt, size[0] + size[1] + size[2]);
498  if (res < 0) {
499  goto fail;
500  }
501  pkt->stream_index = 0;
503  if (s->ts_from_file) {
504  struct stat img_stat;
505  if (stat(filename, &img_stat)) {
506  res = AVERROR(EIO);
507  goto fail;
508  }
509  pkt->pts = (int64_t)img_stat.st_mtime;
510 #if HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
511  if (s->ts_from_file == 2)
512  pkt->pts = 1000000000*pkt->pts + img_stat.st_mtim.tv_nsec;
513 #endif
514  av_add_index_entry(s1->streams[0], s->img_number, pkt->pts, 0, 0, AVINDEX_KEYFRAME);
515  } else if (!s->is_pipe) {
516  pkt->pts = s->pts;
517  }
518 
519  if (s->is_pipe)
520  pkt->pos = avio_tell(f[0]);
521 
522  /*
523  * export_path_metadata must be explicitly enabled via
524  * command line options for path metadata to be exported
525  * as packet side_data.
526  */
527  if (!s->is_pipe && s->export_path_metadata == 1) {
528  res = add_filename_as_pkt_side_data(filename, pkt);
529  if (res < 0)
530  goto fail;
531  }
532 
533  pkt->size = 0;
534  for (i = 0; i < 3; i++) {
535  if (f[i]) {
536  ret[i] = avio_read(f[i], pkt->data + pkt->size, size[i]);
537  if (s->loop && s->is_pipe && ret[i] == AVERROR_EOF) {
538  if (avio_seek(f[i], 0, SEEK_SET) >= 0) {
539  pkt->pos = 0;
540  ret[i] = avio_read(f[i], pkt->data + pkt->size, size[i]);
541  }
542  }
543  if (!s->is_pipe && f[i] != s1->pb)
544  ff_format_io_close(s1, &f[i]);
545  if (ret[i] > 0)
546  pkt->size += ret[i];
547  }
548  }
549 
550  if (ret[0] <= 0 || ret[1] < 0 || ret[2] < 0) {
551  if (ret[0] < 0) {
552  res = ret[0];
553  } else if (ret[1] < 0) {
554  res = ret[1];
555  } else if (ret[2] < 0) {
556  res = ret[2];
557  } else {
558  res = AVERROR_EOF;
559  }
560  goto fail;
561  } else {
562  s->img_count++;
563  s->img_number++;
564  s->pts++;
565  return 0;
566  }
567 
568 fail:
569  if (!s->is_pipe) {
570  for (i = 0; i < 3; i++) {
571  if (f[i] != s1->pb)
572  ff_format_io_close(s1, &f[i]);
573  }
574  }
575  return res;
576 }
577 
578 static int img_read_close(struct AVFormatContext* s1)
579 {
580 #if HAVE_GLOB
581  VideoDemuxData *s = s1->priv_data;
582  if (s->use_glob) {
583  globfree(&s->globstate);
584  }
585 #endif
586  return 0;
587 }
588 
589 static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
590 {
591  VideoDemuxData *s1 = s->priv_data;
592  AVStream *st = s->streams[0];
593 
594  if (s1->ts_from_file) {
595  int index = av_index_search_timestamp(st, timestamp, flags);
596  if(index < 0)
597  return -1;
598  s1->img_number = ffstream(st)->index_entries[index].pos;
599  return 0;
600  }
601 
602  if (timestamp < 0 || !s1->loop && timestamp > s1->img_last - s1->img_first)
603  return -1;
604  s1->img_number = timestamp%(s1->img_last - s1->img_first + 1) + s1->img_first;
605  s1->pts = timestamp;
606  return 0;
607 }
608 
609 #define OFFSET(x) offsetof(VideoDemuxData, x)
610 #define DEC AV_OPT_FLAG_DECODING_PARAM
611 #define COMMON_OPTIONS \
612  { "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC }, \
613  { "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC }, \
614  { "video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC }, \
615  { "loop", "force loop over input file sequence", OFFSET(loop), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, DEC }, \
616  { NULL },
617 
618 #if CONFIG_IMAGE2_DEMUXER
619 const AVOption ff_img_options[] = {
620  { "pattern_type", "set pattern type", OFFSET(pattern_type), AV_OPT_TYPE_INT, {.i64=PT_DEFAULT}, 0, INT_MAX, DEC, "pattern_type"},
621  { "glob_sequence","select glob/sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB_SEQUENCE}, INT_MIN, INT_MAX, DEC, "pattern_type" },
622  { "glob", "select glob pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB }, INT_MIN, INT_MAX, DEC, "pattern_type" },
623  { "sequence", "select sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_SEQUENCE }, INT_MIN, INT_MAX, DEC, "pattern_type" },
624  { "none", "disable pattern matching", 0, AV_OPT_TYPE_CONST, {.i64=PT_NONE }, INT_MIN, INT_MAX, DEC, "pattern_type" },
625  { "start_number", "set first number in the sequence", OFFSET(start_number), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, DEC },
626  { "start_number_range", "set range for looking at the first sequence number", OFFSET(start_number_range), AV_OPT_TYPE_INT, {.i64 = 5}, 1, INT_MAX, DEC },
627  { "ts_from_file", "set frame timestamp from file's one", OFFSET(ts_from_file), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, DEC, "ts_type" },
628  { "none", "none", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 2, DEC, "ts_type" },
629  { "sec", "second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 2, DEC, "ts_type" },
630  { "ns", "nano second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 2, DEC, "ts_type" },
631  { "export_path_metadata", "enable metadata containing input path information", OFFSET(export_path_metadata), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, DEC }, \
632  COMMON_OPTIONS
633 };
634 
635 static const AVClass img2_class = {
636  .class_name = "image2 demuxer",
637  .item_name = av_default_item_name,
638  .option = ff_img_options,
639  .version = LIBAVUTIL_VERSION_INT,
640 };
642  .name = "image2",
643  .long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
644  .priv_data_size = sizeof(VideoDemuxData),
650  .flags = AVFMT_NOFILE,
651  .priv_class = &img2_class,
652 };
653 #endif
654 
655 static const AVOption img2pipe_options[] = {
656  { "frame_size", "force frame size in bytes", OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC },
658 };
659 static const AVClass imagepipe_class = {
660  .class_name = "imagepipe demuxer",
661  .item_name = av_default_item_name,
662  .option = img2pipe_options,
663  .version = LIBAVUTIL_VERSION_INT,
664 };
665 
666 #if CONFIG_IMAGE2PIPE_DEMUXER
668  .name = "image2pipe",
669  .long_name = NULL_IF_CONFIG_SMALL("piped image2 sequence"),
670  .priv_data_size = sizeof(VideoDemuxData),
673  .priv_class = &imagepipe_class,
674 };
675 #endif
676 
677 static int bmp_probe(const AVProbeData *p)
678 {
679  const uint8_t *b = p->buf;
680  int ihsize;
681 
682  if (AV_RB16(b) != 0x424d)
683  return 0;
684 
685  ihsize = AV_RL32(b+14);
686  if (ihsize < 12 || ihsize > 255)
687  return 0;
688 
689  if (!AV_RN32(b + 6)) {
690  return AVPROBE_SCORE_EXTENSION + 1;
691  }
692  return AVPROBE_SCORE_EXTENSION / 4;
693 }
694 
695 static int cri_probe(const AVProbeData *p)
696 {
697  const uint8_t *b = p->buf;
698 
699  if ( AV_RL32(b) == 1
700  && AV_RL32(b + 4) == 4
701  && AV_RN32(b + 8) == AV_RN32("DVCC"))
702  return AVPROBE_SCORE_MAX - 1;
703  return 0;
704 }
705 
706 static int dds_probe(const AVProbeData *p)
707 {
708  const uint8_t *b = p->buf;
709 
710  if ( AV_RB64(b) == 0x444453207c000000
711  && AV_RL32(b + 8)
712  && AV_RL32(b + 12))
713  return AVPROBE_SCORE_MAX - 1;
714  return 0;
715 }
716 
717 static int dpx_probe(const AVProbeData *p)
718 {
719  const uint8_t *b = p->buf;
720  int w, h;
721  int is_big = (AV_RN32(b) == AV_RN32("SDPX"));
722 
723  if (p->buf_size < 0x304+8)
724  return 0;
725  w = is_big ? AV_RB32(p->buf + 0x304) : AV_RL32(p->buf + 0x304);
726  h = is_big ? AV_RB32(p->buf + 0x308) : AV_RL32(p->buf + 0x308);
727  if (w <= 0 || h <= 0)
728  return 0;
729 
730  if (is_big || AV_RN32(b) == AV_RN32("XPDS"))
731  return AVPROBE_SCORE_EXTENSION + 1;
732  return 0;
733 }
734 
735 static int exr_probe(const AVProbeData *p)
736 {
737  const uint8_t *b = p->buf;
738 
739  if (AV_RL32(b) == 20000630)
740  return AVPROBE_SCORE_EXTENSION + 1;
741  return 0;
742 }
743 
744 static int j2k_probe(const AVProbeData *p)
745 {
746  const uint8_t *b = p->buf;
747 
748  if (AV_RB64(b) == 0x0000000c6a502020 ||
749  AV_RB32(b) == 0xff4fff51)
750  return AVPROBE_SCORE_EXTENSION + 1;
751  return 0;
752 }
753 
754 static int jpeg_probe(const AVProbeData *p)
755 {
756  const uint8_t *b = p->buf;
757  int i, state = SOI, got_header = 0;
758 
759  if (AV_RB16(b) != 0xFFD8 ||
760  AV_RB32(b) == 0xFFD8FFF7)
761  return 0;
762 
763  b += 2;
764  for (i = 0; i < p->buf_size - 3; i++) {
765  int c;
766  if (b[i] != 0xFF)
767  continue;
768  c = b[i + 1];
769  switch (c) {
770  case SOI:
771  return 0;
772  case SOF0:
773  case SOF1:
774  case SOF2:
775  case SOF3:
776  case SOF5:
777  case SOF6:
778  case SOF7:
779  i += AV_RB16(&b[i + 2]) + 1;
780  if (state != SOI)
781  return 0;
782  state = SOF0;
783  break;
784  case SOS:
785  i += AV_RB16(&b[i + 2]) + 1;
786  if (state != SOF0 && state != SOS)
787  return 0;
788  state = SOS;
789  break;
790  case EOI:
791  if (state != SOS)
792  return 0;
793  state = EOI;
794  break;
795  case DQT:
796  case APP0:
797  if (AV_RL32(&b[i + 4]) == MKTAG('J','F','I','F'))
798  got_header = 1;
799  case APP1:
800  if (AV_RL32(&b[i + 4]) == MKTAG('E','x','i','f'))
801  got_header = 1;
802  case APP2:
803  case APP3:
804  case APP4:
805  case APP5:
806  case APP6:
807  case APP7:
808  case APP8:
809  case APP9:
810  case APP10:
811  case APP11:
812  case APP12:
813  case APP13:
814  case APP14:
815  case APP15:
816  case COM:
817  i += AV_RB16(&b[i + 2]) + 1;
818  break;
819  default:
820  if ( (c > TEM && c < SOF0)
821  || c == JPG)
822  return 0;
823  }
824  }
825 
826  if (state == EOI)
827  return AVPROBE_SCORE_EXTENSION + 1;
828  if (state == SOS)
829  return AVPROBE_SCORE_EXTENSION / 2 + got_header;
830  return AVPROBE_SCORE_EXTENSION / 8 + 1;
831 }
832 
833 static int jpegls_probe(const AVProbeData *p)
834 {
835  const uint8_t *b = p->buf;
836 
837  if (AV_RB32(b) == 0xffd8fff7)
838  return AVPROBE_SCORE_EXTENSION + 1;
839  return 0;
840 }
841 
842 static int jpegxl_probe(const AVProbeData *p)
843 {
844  const uint8_t *b = p->buf;
845 
846  /* ISOBMFF-based container */
847  /* 0x4a584c20 == "JXL " */
849  return AVPROBE_SCORE_EXTENSION + 1;
850  /* Raw codestreams all start with 0xff0a */
852  return 0;
853 #if CONFIG_IMAGE_JPEGXL_PIPE_DEMUXER
854  if (ff_jpegxl_parse_codestream_header(p->buf, p->buf_size, NULL, 5) >= 0)
855  return AVPROBE_SCORE_MAX - 2;
856 #endif
857  return 0;
858 }
859 
860 static int pcx_probe(const AVProbeData *p)
861 {
862  const uint8_t *b = p->buf;
863 
864  if ( p->buf_size < 128
865  || b[0] != 10
866  || b[1] > 5
867  || b[2] > 1
868  || av_popcount(b[3]) != 1 || b[3] > 8
869  || AV_RL16(&b[4]) > AV_RL16(&b[8])
870  || AV_RL16(&b[6]) > AV_RL16(&b[10])
871  || b[64])
872  return 0;
873  b += 73;
874  while (++b < p->buf + 128)
875  if (*b)
876  return AVPROBE_SCORE_EXTENSION / 4;
877 
878  return AVPROBE_SCORE_EXTENSION + 1;
879 }
880 
881 static int qdraw_probe(const AVProbeData *p)
882 {
883  const uint8_t *b = p->buf;
884 
885  if ( p->buf_size >= 528
886  && (AV_RB64(b + 520) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
887  && AV_RB16(b + 520)
888  && AV_RB16(b + 518))
889  return AVPROBE_SCORE_MAX * 3 / 4;
890  if ( (AV_RB64(b + 8) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
891  && AV_RB16(b + 8)
892  && AV_RB16(b + 6))
893  return AVPROBE_SCORE_EXTENSION / 4;
894  return 0;
895 }
896 
897 static int pictor_probe(const AVProbeData *p)
898 {
899  const uint8_t *b = p->buf;
900 
901  if (AV_RL16(b) == 0x1234)
902  return AVPROBE_SCORE_EXTENSION / 4;
903  return 0;
904 }
905 
906 static int png_probe(const AVProbeData *p)
907 {
908  const uint8_t *b = p->buf;
909 
910  if (AV_RB64(b) == 0x89504e470d0a1a0a)
911  return AVPROBE_SCORE_MAX - 1;
912  return 0;
913 }
914 
915 static int psd_probe(const AVProbeData *p)
916 {
917  const uint8_t *b = p->buf;
918  int ret = 0;
919  uint16_t color_mode;
920 
921  if (AV_RL32(b) == MKTAG('8','B','P','S')) {
922  ret += 1;
923  } else {
924  return 0;
925  }
926 
927  if ((b[4] == 0) && (b[5] == 1)) {/* version 1 is PSD, version 2 is PSB */
928  ret += 1;
929  } else {
930  return 0;
931  }
932 
933  if ((AV_RL32(b+6) == 0) && (AV_RL16(b+10) == 0))/* reserved must be 0 */
934  ret += 1;
935 
936  color_mode = AV_RB16(b+24);
937  if ((color_mode <= 9) && (color_mode != 5) && (color_mode != 6))
938  ret += 1;
939 
940  return AVPROBE_SCORE_EXTENSION + ret;
941 }
942 
943 static int sgi_probe(const AVProbeData *p)
944 {
945  const uint8_t *b = p->buf;
946 
947  if (AV_RB16(b) == 474 &&
948  (b[2] & ~1) == 0 &&
949  (b[3] & ~3) == 0 && b[3] &&
950  (AV_RB16(b + 4) & ~7) == 0 && AV_RB16(b + 4))
951  return AVPROBE_SCORE_EXTENSION + 1;
952  return 0;
953 }
954 
955 static int sunrast_probe(const AVProbeData *p)
956 {
957  const uint8_t *b = p->buf;
958 
959  if (AV_RB32(b) == 0x59a66a95)
960  return AVPROBE_SCORE_EXTENSION + 1;
961  return 0;
962 }
963 
964 static int svg_probe(const AVProbeData *p)
965 {
966  const uint8_t *b = p->buf;
967  const uint8_t *end = p->buf + p->buf_size;
968  while (b < end && av_isspace(*b))
969  b++;
970  if (b >= end - 5)
971  return 0;
972  if (!memcmp(b, "<svg", 4))
973  return AVPROBE_SCORE_EXTENSION + 1;
974  if (memcmp(p->buf, "<?xml", 5) && memcmp(b, "<!--", 4))
975  return 0;
976  while (b < end) {
977  int inc = ff_subtitles_next_line(b);
978  if (!inc)
979  break;
980  b += inc;
981  if (b >= end - 4)
982  return 0;
983  if (!memcmp(b, "<svg", 4))
984  return AVPROBE_SCORE_EXTENSION + 1;
985  }
986  return 0;
987 }
988 
989 static int tiff_probe(const AVProbeData *p)
990 {
991  const uint8_t *b = p->buf;
992 
993  if (AV_RB32(b) == 0x49492a00 ||
994  AV_RB32(b) == 0x4D4D002a)
995  return AVPROBE_SCORE_EXTENSION + 1;
996  return 0;
997 }
998 
999 static int webp_probe(const AVProbeData *p)
1000 {
1001  const uint8_t *b = p->buf;
1002 
1003  if (AV_RB32(b) == 0x52494646 &&
1004  AV_RB32(b + 8) == 0x57454250)
1005  return AVPROBE_SCORE_MAX - 1;
1006  return 0;
1007 }
1008 
1009 static int pnm_magic_check(const AVProbeData *p, int magic)
1010 {
1011  const uint8_t *b = p->buf;
1012 
1013  return b[0] == 'P' && b[1] == magic + '0';
1014 }
1015 
1016 static inline int pnm_probe(const AVProbeData *p)
1017 {
1018  const uint8_t *b = p->buf;
1019 
1020  while (b[2] == '\r')
1021  b++;
1022  if (b[2] == '\n' && (b[3] == '#' || (b[3] >= '0' && b[3] <= '9')))
1023  return AVPROBE_SCORE_EXTENSION + 2;
1024  return 0;
1025 }
1026 
1027 static int pbm_probe(const AVProbeData *p)
1028 {
1029  return pnm_magic_check(p, 1) || pnm_magic_check(p, 4) ? pnm_probe(p) : 0;
1030 }
1031 
1032 static int pfm_probe(const AVProbeData *p)
1033 {
1034  return pnm_magic_check(p, 'F' - '0') ||
1035  pnm_magic_check(p, 'f' - '0') ? pnm_probe(p) : 0;
1036 }
1037 
1038 static int phm_probe(const AVProbeData *p)
1039 {
1040  return pnm_magic_check(p, 'H' - '0') ||
1041  pnm_magic_check(p, 'h' - '0') ? pnm_probe(p) : 0;
1042 }
1043 
1044 static inline int pgmx_probe(const AVProbeData *p)
1045 {
1046  return pnm_magic_check(p, 2) || pnm_magic_check(p, 5) ? pnm_probe(p) : 0;
1047 }
1048 
1049 static int pgm_probe(const AVProbeData *p)
1050 {
1051  int ret = pgmx_probe(p);
1052  return ret && !av_match_ext(p->filename, "pgmyuv") ? ret : 0;
1053 }
1054 
1055 static int pgmyuv_probe(const AVProbeData *p) // custom FFmpeg format recognized by file extension
1056 {
1057  int ret = pgmx_probe(p);
1058  return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
1059 }
1060 
1061 static int pgx_probe(const AVProbeData *p)
1062 {
1063  const uint8_t *b = p->buf;
1064  if (!memcmp(b, "PG ML ", 6))
1065  return AVPROBE_SCORE_EXTENSION + 1;
1066  return 0;
1067 }
1068 
1069 static int ppm_probe(const AVProbeData *p)
1070 {
1071  return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 0;
1072 }
1073 
1074 static int pam_probe(const AVProbeData *p)
1075 {
1076  return pnm_magic_check(p, 7) ? pnm_probe(p) : 0;
1077 }
1078 
1079 static int hdr_probe(const AVProbeData *p)
1080 {
1081  if (!memcmp(p->buf, "#?RADIANCE\n", 11))
1082  return AVPROBE_SCORE_MAX;
1083  return 0;
1084 }
1085 
1086 static int xbm_probe(const AVProbeData *p)
1087 {
1088  if (!memcmp(p->buf, "/* XBM X10 format */", 20))
1089  return AVPROBE_SCORE_MAX;
1090 
1091  if (!memcmp(p->buf, "#define", 7))
1092  return AVPROBE_SCORE_MAX - 1;
1093  return 0;
1094 }
1095 
1096 static int xpm_probe(const AVProbeData *p)
1097 {
1098  const uint8_t *b = p->buf;
1099 
1100  if (AV_RB64(b) == 0x2f2a2058504d202a && *(b+8) == '/')
1101  return AVPROBE_SCORE_MAX - 1;
1102  return 0;
1103 }
1104 
1105 static int xwd_probe(const AVProbeData *p)
1106 {
1107  const uint8_t *b = p->buf;
1108  unsigned width, bpp, bpad, lsize;
1109 
1110  if ( p->buf_size < XWD_HEADER_SIZE
1111  || AV_RB32(b ) < XWD_HEADER_SIZE // header size
1112  || AV_RB32(b + 4) != XWD_VERSION // version
1113  || AV_RB32(b + 8) != XWD_Z_PIXMAP // format
1114  || AV_RB32(b + 12) > 32 || !AV_RB32(b + 12) // depth
1115  || AV_RB32(b + 16) == 0 // width
1116  || AV_RB32(b + 20) == 0 // height
1117  || AV_RB32(b + 28) > 1 // byteorder
1118  || AV_RB32(b + 32) & ~56 || av_popcount(AV_RB32(b + 32)) != 1 // bitmap unit
1119  || AV_RB32(b + 36) > 1 // bitorder
1120  || AV_RB32(b + 40) & ~56 || av_popcount(AV_RB32(b + 40)) != 1 // padding
1121  || AV_RB32(b + 44) > 32 || !AV_RB32(b + 44) // bpp
1122  || AV_RB32(b + 68) > 256) // colours
1123  return 0;
1124 
1125  width = AV_RB32(b + 16);
1126  bpad = AV_RB32(b + 40);
1127  bpp = AV_RB32(b + 44);
1128  lsize = AV_RB32(b + 48);
1129  if (lsize < FFALIGN(width * bpp, bpad) >> 3)
1130  return 0;
1131 
1132  return AVPROBE_SCORE_MAX / 2 + 1;
1133 }
1134 
1135 static int gif_probe(const AVProbeData *p)
1136 {
1137  /* check magick */
1138  if (memcmp(p->buf, gif87a_sig, 6) && memcmp(p->buf, gif89a_sig, 6))
1139  return 0;
1140 
1141  /* width or height contains zero? */
1142  if (!AV_RL16(&p->buf[6]) || !AV_RL16(&p->buf[8]))
1143  return 0;
1144 
1145  return AVPROBE_SCORE_MAX - 1;
1146 }
1147 
1148 static int photocd_probe(const AVProbeData *p)
1149 {
1150  if (!memcmp(p->buf, "PCD_OPA", 7))
1151  return AVPROBE_SCORE_MAX - 1;
1152 
1153  if (p->buf_size < 0x807 || memcmp(p->buf + 0x800, "PCD_IPI", 7))
1154  return 0;
1155 
1156  return AVPROBE_SCORE_MAX - 1;
1157 }
1158 
1159 static int qoi_probe(const AVProbeData *p)
1160 {
1161  if (memcmp(p->buf, "qoif", 4))
1162  return 0;
1163 
1164  if (AV_RB32(p->buf + 4) == 0 || AV_RB32(p->buf + 8) == 0)
1165  return 0;
1166 
1167  if (p->buf[12] != 3 && p->buf[12] != 4)
1168  return 0;
1169 
1170  if (p->buf[13] > 1)
1171  return 0;
1172 
1173  return AVPROBE_SCORE_MAX - 1;
1174 }
1175 
1176 static int gem_probe(const AVProbeData *p)
1177 {
1178  const uint8_t *b = p->buf;
1179  if ( AV_RB16(b ) >= 1 && AV_RB16(b ) <= 3 &&
1180  AV_RB16(b + 2) >= 8 && AV_RB16(b + 2) <= 779 &&
1181  (AV_RB16(b + 4) > 0 && AV_RB16(b + 4) <= 32) && /* planes */
1182  (AV_RB16(b + 6) > 0 && AV_RB16(b + 6) <= 8) && /* pattern_size */
1183  AV_RB16(b + 8) &&
1184  AV_RB16(b + 10) &&
1185  AV_RB16(b + 12) &&
1186  AV_RB16(b + 14)) {
1187  if (AV_RN32(b + 16) == AV_RN32("STTT") ||
1188  AV_RN32(b + 16) == AV_RN32("TIMG") ||
1189  AV_RN32(b + 16) == AV_RN32("XIMG"))
1190  return AVPROBE_SCORE_EXTENSION + 1;
1191  return AVPROBE_SCORE_EXTENSION / 4;
1192  }
1193  return 0;
1194 }
1195 
1196 static int vbn_probe(const AVProbeData *p)
1197 {
1198  const uint8_t *b = p->buf;
1199  if (AV_RL32(b ) == VBN_MAGIC &&
1200  AV_RL32(b + 4) == VBN_MAJOR &&
1201  AV_RL32(b + 8) == VBN_MINOR)
1202  return AVPROBE_SCORE_MAX - 1;
1203  return 0;
1204 }
1205 
1206 #define IMAGEAUTO_DEMUXER_0(imgname, codecid)
1207 #define IMAGEAUTO_DEMUXER_1(imgname, codecid)\
1208 const AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
1209  .name = AV_STRINGIFY(imgname) "_pipe",\
1210  .long_name = NULL_IF_CONFIG_SMALL("piped " AV_STRINGIFY(imgname) " sequence"),\
1211  .priv_data_size = sizeof(VideoDemuxData),\
1212  .read_probe = imgname ## _probe,\
1213  .read_header = ff_img_read_header,\
1214  .read_packet = ff_img_read_packet,\
1215  .priv_class = &imagepipe_class,\
1216  .flags = AVFMT_GENERIC_INDEX, \
1217  .raw_codec_id = codecid,\
1218 };
1219 
1220 #define IMAGEAUTO_DEMUXER_2(imgname, codecid, enabled) \
1221  IMAGEAUTO_DEMUXER_ ## enabled(imgname, codecid)
1222 #define IMAGEAUTO_DEMUXER_3(imgname, codecid, config) \
1223  IMAGEAUTO_DEMUXER_2(imgname, codecid, config)
1224 #define IMAGEAUTO_DEMUXER_EXT(imgname, codecid, uppercase_name) \
1225  IMAGEAUTO_DEMUXER_3(imgname, AV_CODEC_ID_ ## codecid, \
1226  CONFIG_IMAGE_ ## uppercase_name ## _PIPE_DEMUXER)
1227 #define IMAGEAUTO_DEMUXER(imgname, codecid) \
1228  IMAGEAUTO_DEMUXER_EXT(imgname, codecid, codecid)
1229 
1230 IMAGEAUTO_DEMUXER(bmp, BMP)
1231 IMAGEAUTO_DEMUXER(cri, CRI)
1232 IMAGEAUTO_DEMUXER(dds, DDS)
1233 IMAGEAUTO_DEMUXER(dpx, DPX)
1234 IMAGEAUTO_DEMUXER(exr, EXR)
1235 IMAGEAUTO_DEMUXER(gem, GEM)
1236 IMAGEAUTO_DEMUXER(gif, GIF)
1237 IMAGEAUTO_DEMUXER_EXT(hdr, RADIANCE_HDR, HDR)
1238 IMAGEAUTO_DEMUXER_EXT(j2k, JPEG2000, J2K)
1239 IMAGEAUTO_DEMUXER_EXT(jpeg, MJPEG, JPEG)
1240 IMAGEAUTO_DEMUXER(jpegls, JPEGLS)
1241 IMAGEAUTO_DEMUXER(jpegxl, JPEGXL)
1242 IMAGEAUTO_DEMUXER(pam, PAM)
1243 IMAGEAUTO_DEMUXER(pbm, PBM)
1244 IMAGEAUTO_DEMUXER(pcx, PCX)
1245 IMAGEAUTO_DEMUXER(pfm, PFM)
1246 IMAGEAUTO_DEMUXER(pgm, PGM)
1247 IMAGEAUTO_DEMUXER(pgmyuv, PGMYUV)
1248 IMAGEAUTO_DEMUXER(pgx, PGX)
1249 IMAGEAUTO_DEMUXER(phm, PHM)
1250 IMAGEAUTO_DEMUXER(photocd, PHOTOCD)
1251 IMAGEAUTO_DEMUXER(pictor, PICTOR)
1252 IMAGEAUTO_DEMUXER(png, PNG)
1253 IMAGEAUTO_DEMUXER(ppm, PPM)
1254 IMAGEAUTO_DEMUXER(psd, PSD)
1255 IMAGEAUTO_DEMUXER(qdraw, QDRAW)
1256 IMAGEAUTO_DEMUXER(qoi, QOI)
1257 IMAGEAUTO_DEMUXER(sgi, SGI)
1258 IMAGEAUTO_DEMUXER(sunrast, SUNRAST)
1259 IMAGEAUTO_DEMUXER(svg, SVG)
1260 IMAGEAUTO_DEMUXER(tiff, TIFF)
1261 IMAGEAUTO_DEMUXER(vbn, VBN)
1262 IMAGEAUTO_DEMUXER(webp, WEBP)
1263 IMAGEAUTO_DEMUXER(xbm, XBM)
1264 IMAGEAUTO_DEMUXER(xpm, XPM)
1265 IMAGEAUTO_DEMUXER(xwd, XWD)
AV_LOG_WARNING
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:186
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
mjpeg.h
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
pam_probe
static int pam_probe(const AVProbeData *p)
Definition: img2dec.c:1074
AVInputFormat::raw_codec_id
int raw_codec_id
Raw demuxers store their codec ID here.
Definition: avformat.h:598
SOS
@ SOS
Definition: mjpeg.h:72
ff_jpegxl_parse_codestream_header
int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate)
Definition: jpegxl_parse.c:255
APP1
@ APP1
Definition: mjpeg.h:80
AVCodecParameters
This struct describes the properties of an encoded stream.
Definition: codec_par.h:47
cri_probe
static int cri_probe(const AVProbeData *p)
Definition: img2dec.c:695
avformat_new_stream
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
AV_RL64
uint64_t_TMPL AV_RL64
Definition: bytestream.h:91
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
SOF0
@ SOF0
Definition: mjpeg.h:39
pnm_magic_check
static int pnm_magic_check(const AVProbeData *p, int magic)
Definition: img2dec.c:1009
VBN_MINOR
#define VBN_MINOR
Definition: vbn.h:31
OFFSET
#define OFFSET(x)
Definition: img2dec.c:609
av_strcasecmp
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Definition: avstring.c:207
AV_CODEC_ID_RAWVIDEO
@ AV_CODEC_ID_RAWVIDEO
Definition: codec_id.h:65
av_isspace
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
Definition: avstring.h:218
pixdesc.h
w
uint8_t w
Definition: llviddspenc.c:38
webp_probe
static int webp_probe(const AVProbeData *p)
Definition: img2dec.c:999
ff_img_read_header
int ff_img_read_header(AVFormatContext *s1)
Definition: img2dec.c:187
AVPacket::data
uint8_t * data
Definition: packet.h:491
dds_probe
static int dds_probe(const AVProbeData *p)
Definition: img2dec.c:706
AVOption
AVOption.
Definition: opt.h:251
b
#define b
Definition: input.c:41
AVStream::avg_frame_rate
AVRational avg_frame_rate
Average framerate.
Definition: avformat.h:930
imagepipe_class
static const AVClass imagepipe_class
Definition: img2dec.c:659
AVFMT_FLAG_CUSTOM_IO
#define AVFMT_FLAG_CUSTOM_IO
The caller has supplied a custom AVIOContext, don't avio_close() it.
Definition: avformat.h:1241
psd_probe
static int psd_probe(const AVProbeData *p)
Definition: img2dec.c:915
ff_guess_image2_codec
enum AVCodecID ff_guess_image2_codec(const char *filename)
Definition: img2.c:115
qoi_probe
static int qoi_probe(const AVProbeData *p)
Definition: img2dec.c:1159
phm_probe
static int phm_probe(const AVProbeData *p)
Definition: img2dec.c:1038
pcx_probe
static int pcx_probe(const AVProbeData *p)
Definition: img2dec.c:860
AVDictionary
Definition: dict.c:34
AVProbeData::buf_size
int buf_size
Size of buf except extra allocated bytes.
Definition: avformat.h:455
img_read_seek
static int img_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: img2dec.c:589
av_popcount
#define av_popcount
Definition: common.h:150
av_get_frame_filename
int av_get_frame_filename(char *buf, int buf_size, const char *path, int number)
Definition: utils.c:353
avio_size
int64_t avio_size(AVIOContext *s)
Get the filesize.
Definition: aviobuf.c:370
os_support.h
AV_PKT_FLAG_KEY
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
Definition: packet.h:546
XWD_Z_PIXMAP
#define XWD_Z_PIXMAP
Definition: xwd.h:32
av_basename
const char * av_basename(const char *path)
Thread safe basename.
Definition: avstring.c:252
AVINDEX_KEYFRAME
#define AVINDEX_KEYFRAME
Definition: avformat.h:708
APP15
@ APP15
Definition: mjpeg.h:94
av_filename_number_test
int av_filename_number_test(const char *filename)
Check whether filename actually is a numbered sequence generator.
Definition: utils.c:126
AVPROBE_SCORE_MAX
#define AVPROBE_SCORE_MAX
maximum score
Definition: avformat.h:464
is_glob
static int is_glob(const char *path)
Definition: img2dec.c:85
FF_JPEGXL_CONTAINER_SIGNATURE_LE
#define FF_JPEGXL_CONTAINER_SIGNATURE_LE
Definition: jpegxl.h:26
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
av_packet_add_side_data
int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t *data, size_t size)
Wrap an existing array as a packet side data.
Definition: avpacket.c:197
ffstream
static av_always_inline FFStream * ffstream(AVStream *st)
Definition: internal.h:420
APP4
@ APP4
Definition: mjpeg.h:83
fail
#define fail()
Definition: checkasm.h:138
svg_probe
static int svg_probe(const AVProbeData *p)
Definition: img2dec.c:964
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:120
SOF3
@ SOF3
Definition: mjpeg.h:42
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
avio_tell
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
Definition: avio.h:513
IMAGEAUTO_DEMUXER
#define IMAGEAUTO_DEMUXER(imgname, codecid)
Definition: img2dec.c:1227
pgmx_probe
static int pgmx_probe(const AVProbeData *p)
Definition: img2dec.c:1044
APP13
@ APP13
Definition: mjpeg.h:92
AVPROBE_PADDING_SIZE
#define AVPROBE_PADDING_SIZE
extra allocated bytes at the end of the probe buffer
Definition: avformat.h:466
img_read_close
static int img_read_close(struct AVFormatContext *s1)
Definition: img2dec.c:578
img2pipe_options
static const AVOption img2pipe_options[]
Definition: img2dec.c:655
AVStream::duration
int64_t duration
Decoding: duration of the stream, in stream time base.
Definition: avformat.h:900
av_probe_input_format3
const AVInputFormat * av_probe_input_format3(const AVProbeData *pd, int is_opened, int *score_ret)
Guess the file format.
Definition: format.c:154
PT_NONE
@ PT_NONE
Definition: img2.h:37
loop
static int loop
Definition: ffplay.c:337
PT_GLOB
@ PT_GLOB
Definition: img2.h:35
gif89a_sig
static const uint8_t gif89a_sig[6]
Definition: gif.h:35
pictor_probe
static int pictor_probe(const AVProbeData *p)
Definition: img2dec.c:897
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
COM
@ COM
Definition: mjpeg.h:111
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:41
SOF5
@ SOF5
Definition: mjpeg.h:44
width
#define width
intreadwrite.h
s
#define s(width, name)
Definition: cbs_vp9.c:198
av_new_packet
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
Definition: avpacket.c:98
APP12
@ APP12
Definition: mjpeg.h:91
img_read_probe
static int img_read_probe(const AVProbeData *p)
Definition: img2dec.c:168
AVInputFormat::name
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:554
APP3
@ APP3
Definition: mjpeg.h:82
pix_fmt
static enum AVPixelFormat pix_fmt
Definition: demux_decode.c:41
AVProbeData::buf
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
Definition: avformat.h:454
PT_DEFAULT
@ PT_DEFAULT
Definition: img2.h:38
frame_size
int frame_size
Definition: mxfenc.c:2311
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
AVCodecParameters::width
int width
Video only.
Definition: codec_par.h:121
s1
#define s1
Definition: regdef.h:38
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
add_filename_as_pkt_side_data
static int add_filename_as_pkt_side_data(char *filename, AVPacket *pkt)
Add this frame's source path and basename to packet's sidedata as a dictionary, so it can be used by ...
Definition: img2dec.c:388
bmp_probe
static int bmp_probe(const AVProbeData *p)
Definition: img2dec.c:677
pgmyuv_probe
static int pgmyuv_probe(const AVProbeData *p)
Definition: img2dec.c:1055
AV_CODEC_ID_ALIAS_PIX
@ AV_CODEC_ID_ALIAS_PIX
Definition: codec_id.h:229
j2k_probe
static int j2k_probe(const AVProbeData *p)
Definition: img2dec.c:744
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
APP11
@ APP11
Definition: mjpeg.h:90
VideoDemuxData
Definition: img2.h:41
xpm_probe
static int xpm_probe(const AVProbeData *p)
Definition: img2dec.c:1096
APP5
@ APP5
Definition: mjpeg.h:84
if
if(ret)
Definition: filter_design.txt:179
xwd.h
FFStream::need_parsing
enum AVStreamParseType need_parsing
Definition: internal.h:391
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
gem_probe
static int gem_probe(const AVProbeData *p)
Definition: img2dec.c:1176
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
ff_img_options
const AVOption ff_img_options[]
NULL
#define NULL
Definition: coverity.c:32
sizes
static const int sizes[][2]
Definition: img2dec.c:58
ff_image2_demuxer
const AVInputFormat ff_image2_demuxer
APP9
@ APP9
Definition: mjpeg.h:88
xwd_probe
static int xwd_probe(const AVProbeData *p)
Definition: img2dec.c:1105
AVFMTCTX_NOHEADER
#define AVFMTCTX_NOHEADER
signal that no header is present (streams are added dynamically)
Definition: avformat.h:1066
photocd_probe
static int photocd_probe(const AVProbeData *p)
Definition: img2dec.c:1148
AVInputFormat::read_probe
int(* read_probe)(const AVProbeData *)
Tell if a given file has a chance of being parsed as this format.
Definition: avformat.h:615
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
AV_RN32
#define AV_RN32(p)
Definition: intreadwrite.h:362
parseutils.h
VBN_MAJOR
#define VBN_MAJOR
Definition: vbn.h:30
xbm_probe
static int xbm_probe(const AVProbeData *p)
Definition: img2dec.c:1086
AVProbeData
This structure contains the data a format has to probe a file.
Definition: avformat.h:452
VBN_MAGIC
#define VBN_MAGIC
Definition: vbn.h:29
TEM
@ TEM
Definition: mjpeg.h:113
jpegxl_probe
static int jpegxl_probe(const AVProbeData *p)
Definition: img2dec.c:842
index
int index
Definition: gxfenc.c:89
find_image_range
static int find_image_range(AVIOContext *pb, int *pfirst_index, int *plast_index, const char *path, int start_index, int start_index_range)
Get index range of image files matched by path.
Definition: img2dec.c:115
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
AVPROBE_SCORE_EXTENSION
#define AVPROBE_SCORE_EXTENSION
score for file extension
Definition: avformat.h:462
DEC
#define DEC
Definition: img2dec.c:610
PT_SEQUENCE
@ PT_SEQUENCE
Definition: img2.h:36
sunrast_probe
static int sunrast_probe(const AVProbeData *p)
Definition: img2dec.c:955
f
f
Definition: af_crystalizer.c:121
AVIOContext
Bytestream IO Context.
Definition: avio.h:166
vbn_probe
static int vbn_probe(const AVProbeData *p)
Definition: img2dec.c:1196
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
XWD_HEADER_SIZE
#define XWD_HEADER_SIZE
Definition: xwd.h:27
gif.h
size
int size
Definition: twinvq_data.h:10344
pfm_probe
static int pfm_probe(const AVProbeData *p)
Definition: img2dec.c:1032
dpx_probe
static int dpx_probe(const AVProbeData *p)
Definition: img2dec.c:717
AV_RB32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
Definition: bytestream.h:96
IMAGEAUTO_DEMUXER_EXT
#define IMAGEAUTO_DEMUXER_EXT(imgname, codecid, uppercase_name)
Definition: img2dec.c:1224
avio_check
int avio_check(const char *url, int flags)
Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url,...
Definition: avio.c:475
AVFMT_NOFILE
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:469
ff_format_io_close
int ff_format_io_close(AVFormatContext *s, AVIOContext **pb)
Definition: avformat.c:843
av_demuxer_iterate
const AVInputFormat * av_demuxer_iterate(void **opaque)
Iterate over all registered demuxers.
Definition: allformats.c:597
range
enum AVColorRange range
Definition: mediacodec_wrapper.c:2646
header
static const uint8_t header[24]
Definition: sdr2.c:67
av_packet_pack_dictionary
uint8_t * av_packet_pack_dictionary(AVDictionary *dict, size_t *size)
Pack a dictionary for use in side_data.
Definition: avpacket.c:308
AVPacket::flags
int flags
A combination of AV_PKT_FLAG values.
Definition: packet.h:497
av_dict_free
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
Definition: dict.c:225
DQT
@ DQT
Definition: mjpeg.h:73
APP6
@ APP6
Definition: mjpeg.h:85
AV_PKT_DATA_STRINGS_METADATA
@ AV_PKT_DATA_STRINGS_METADATA
A list of zero terminated key/value strings.
Definition: packet.h:173
AV_CODEC_ID_MJPEG
@ AV_CODEC_ID_MJPEG
Definition: codec_id.h:59
ff_image2pipe_demuxer
const AVInputFormat ff_image2pipe_demuxer
gif_probe
static int gif_probe(const AVProbeData *p)
Definition: img2dec.c:1135
log.h
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
EOI
@ EOI
Definition: mjpeg.h:71
avio_internal.h
gif87a_sig
static const uint8_t gif87a_sig[6]
Definition: gif.h:34
AVCodecParameters::height
int height
Definition: codec_par.h:122
img2.h
APP8
@ APP8
Definition: mjpeg.h:87
FF_JPEGXL_CODESTREAM_SIGNATURE_LE
#define FF_JPEGXL_CODESTREAM_SIGNATURE_LE
Definition: jpegxl.h:25
pgm_probe
static int pgm_probe(const AVProbeData *p)
Definition: img2dec.c:1049
AVInputFormat::read_packet
int(* read_packet)(struct AVFormatContext *, AVPacket *pkt)
Read one packet and put it in 'pkt'.
Definition: avformat.h:632
infer_size
static int infer_size(int *width_ptr, int *height_ptr, int size)
Definition: img2dec.c:70
APP7
@ APP7
Definition: mjpeg.h:86
sgi_probe
static int sgi_probe(const AVProbeData *p)
Definition: img2dec.c:943
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
pgx_probe
static int pgx_probe(const AVProbeData *p)
Definition: img2dec.c:1061
SOF2
@ SOF2
Definition: mjpeg.h:41
pnm_probe
static int pnm_probe(const AVProbeData *p)
Definition: img2dec.c:1016
avformat.h
COMMON_OPTIONS
#define COMMON_OPTIONS
Definition: img2dec.c:611
APP14
@ APP14
Definition: mjpeg.h:93
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
av_get_pix_fmt
enum AVPixelFormat av_get_pix_fmt(const char *name)
Return the pixel format corresponding to name.
Definition: pixdesc.c:2896
jpeg_probe
static int jpeg_probe(const AVProbeData *p)
Definition: img2dec.c:754
subtitles.h
png_probe
static int png_probe(const AVProbeData *p)
Definition: img2dec.c:906
jpegls_probe
static int jpegls_probe(const AVProbeData *p)
Definition: img2dec.c:833
AVInputFormat::flags
int flags
Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS, AVFMT_NOTIMESTAMPS,...
Definition: avformat.h:568
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
hdr_probe
static int hdr_probe(const AVProbeData *p)
Definition: img2dec.c:1079
APP2
@ APP2
Definition: mjpeg.h:81
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
PROBE_BUF_MIN
#define PROBE_BUF_MIN
size of probe buffer, for guessing file type from file contents
Definition: internal.h:33
ppm_probe
static int ppm_probe(const AVProbeData *p)
Definition: img2dec.c:1069
avio_read
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
Definition: aviobuf.c:659
exr_probe
static int exr_probe(const AVProbeData *p)
Definition: img2dec.c:735
AVStream::r_frame_rate
AVRational r_frame_rate
Real base framerate of the stream.
Definition: avformat.h:1007
AVIndexEntry::pos
int64_t pos
Definition: avformat.h:701
AVPacket::stream_index
int stream_index
Definition: packet.h:493
state
static struct @362 state
avio_skip
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
Definition: aviobuf.c:365
ff_img_read_packet
int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt)
Definition: img2dec.c:410
APP0
@ APP0
Definition: mjpeg.h:79
FFStream::index_entries
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
Definition: internal.h:254
pbm_probe
static int pbm_probe(const AVProbeData *p)
Definition: img2dec.c:1027
AVIO_FLAG_READ
#define AVIO_FLAG_READ
read-only
Definition: avio.h:636
av_strdup
char * av_strdup(const char *s)
Duplicate a string.
Definition: mem.c:270
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:29
vbn.h
ffio_rewind_with_probe_data
int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **buf, int buf_size)
Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file.
Definition: aviobuf.c:1196
SOI
@ SOI
Definition: mjpeg.h:70
AVCodecParameters::format
int format
Definition: codec_par.h:79
SOF1
@ SOF1
Definition: mjpeg.h:40
av_free
#define av_free(p)
Definition: tableprint_vlc.h:33
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
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
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
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
AVPacket::pos
int64_t pos
byte position in stream, -1 if unknown
Definition: packet.h:511
tiff_probe
static int tiff_probe(const AVProbeData *p)
Definition: img2dec.c:989
XWD_VERSION
#define XWD_VERSION
Definition: xwd.h:26
d
d
Definition: ffmpeg_filter.c:368
AVSTREAM_PARSE_FULL
@ AVSTREAM_PARSE_FULL
full parsing and repack
Definition: avformat.h:691
jpegxl_parse.h
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
APP10
@ APP10
Definition: mjpeg.h:89
av_strlcpy
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
Definition: avstring.c:85
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
FFStream::parser
struct AVCodecParserContext * parser
Definition: internal.h:392
PT_GLOB_SEQUENCE
@ PT_GLOB_SEQUENCE
Definition: img2.h:34
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
h
h
Definition: vp9dsp_template.c:2038
SOF7
@ SOF7
Definition: mjpeg.h:46
ff_subtitles_next_line
static av_always_inline int ff_subtitles_next_line(const char *ptr)
Get the number of characters to increment to jump to the next line, or to the end of the string.
Definition: subtitles.h:205
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
AVInputFormat::read_header
int(* read_header)(struct AVFormatContext *)
Read the format header and initialize the AVFormatContext structure.
Definition: avformat.h:622
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
AV_CODEC_ID_LJPEG
@ AV_CODEC_ID_LJPEG
Definition: codec_id.h:61
SOF6
@ SOF6
Definition: mjpeg.h:45
qdraw_probe
static int qdraw_probe(const AVProbeData *p)
Definition: img2dec.c:881
AV_RB64
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_RB64
Definition: bytestream.h:95
JPG
@ JPG
Definition: mjpeg.h:47
AV_RB16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
Definition: bytestream.h:98
av_realloc
void * av_realloc(void *ptr, size_t size)
Allocate, reallocate, or free a block of memory.
Definition: mem.c:153
av_index_search_timestamp
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
Definition: seek.c:243
avio_feof
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Definition: aviobuf.c:393