FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
img2dec.c File Reference
#include <sys/stat.h>
#include "libavutil/avstring.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/parseutils.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
#include "img2.h"

Go to the source code of this file.

Macros

#define _BSD_SOURCE
 
#define OFFSET(x)   offsetof(VideoDemuxData, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 
#define IMAGEAUTO_DEMUXER(imgname, codecid)
 

Functions

static int infer_size (int *width_ptr, int *height_ptr, int size)
 
static int is_glob (const char *path)
 
static int find_image_range (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.
 
static int img_read_probe (AVProbeData *p)
 
int ff_img_read_header (AVFormatContext *s1)
 
int ff_img_read_packet (AVFormatContext *s1, AVPacket *pkt)
 
static int img_read_close (struct AVFormatContext *s1)
 
static int img_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 
static int bmp_probe (AVProbeData *p)
 
static int dpx_probe (AVProbeData *p)
 
static int exr_probe (AVProbeData *p)
 
static int j2k_probe (AVProbeData *p)
 
static int jpegls_probe (AVProbeData *p)
 
static int pictor_probe (AVProbeData *p)
 
static int png_probe (AVProbeData *p)
 
static int sgi_probe (AVProbeData *p)
 
static int sunrast_probe (AVProbeData *p)
 
static int tiff_probe (AVProbeData *p)
 
static int webp_probe (AVProbeData *p)
 

Variables

static const int sizes [][2]
 
static const AVOption options []
 

Macro Definition Documentation

#define _BSD_SOURCE

Definition at line 23 of file img2dec.c.

#define OFFSET (   x)    offsetof(VideoDemuxData, x)

Definition at line 504 of file img2dec.c.

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 505 of file img2dec.c.

#define IMAGEAUTO_DEMUXER (   imgname,
  codecid 
)
Value:
static const AVClass imgname ## _class = {\
.class_name = AV_STRINGIFY(imgname) " demuxer",\
.item_name = av_default_item_name,\
.option = options,\
.version = LIBAVUTIL_VERSION_INT,\
};\
AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
.name = AV_STRINGIFY(imgname) "_pipe",\
.long_name = NULL_IF_CONFIG_SMALL("piped " AV_STRINGIFY(imgname) " sequence"),\
.priv_data_size = sizeof(VideoDemuxData),\
.read_probe = imgname ## _probe,\
.priv_class = & imgname ## _class,\
.raw_codec_id = codecid,\
};

Definition at line 680 of file img2dec.c.

Function Documentation

static int infer_size ( int *  width_ptr,
int *  height_ptr,
int  size 
)
static

Definition at line 60 of file img2dec.c.

Referenced by ff_img_read_packet().

static int is_glob ( const char *  path)
static

Definition at line 75 of file img2dec.c.

Referenced by ff_img_read_header(), and img_read_probe().

static int find_image_range ( int *  pfirst_index,
int *  plast_index,
const char *  path,
int  start_index,
int  start_index_range 
)
static

Get index range of image files matched by path.

Parameters
pfirst_indexpointer to index updated with the first number in the range
plast_indexpointer to index updated with the last number in the range
pathpath which has to be matched by the image files in the range
start_indexminimum accepted value for the first index in the range
Returns
-1 if no image file could be found

Definition at line 105 of file img2dec.c.

Referenced by ff_img_read_header().

static int img_read_probe ( AVProbeData p)
static

Definition at line 158 of file img2dec.c.

int ff_img_read_header ( AVFormatContext s1)

Definition at line 173 of file img2dec.c.

Referenced by ff_img_read_header().

int ff_img_read_packet ( AVFormatContext s1,
AVPacket pkt 
)

Definition at line 354 of file img2dec.c.

Referenced by ff_img_read_packet().

static int img_read_close ( struct AVFormatContext s1)
static

Definition at line 473 of file img2dec.c.

static int img_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

Definition at line 484 of file img2dec.c.

static int bmp_probe ( AVProbeData p)
static

Definition at line 564 of file img2dec.c.

static int dpx_probe ( AVProbeData p)
static

Definition at line 584 of file img2dec.c.

static int exr_probe ( AVProbeData p)
static

Definition at line 593 of file img2dec.c.

static int j2k_probe ( AVProbeData p)
static

Definition at line 602 of file img2dec.c.

static int jpegls_probe ( AVProbeData p)
static

Definition at line 612 of file img2dec.c.

static int pictor_probe ( AVProbeData p)
static

Definition at line 621 of file img2dec.c.

static int png_probe ( AVProbeData p)
static

Definition at line 630 of file img2dec.c.

static int sgi_probe ( AVProbeData p)
static

Definition at line 639 of file img2dec.c.

static int sunrast_probe ( AVProbeData p)
static

Definition at line 651 of file img2dec.c.

static int tiff_probe ( AVProbeData p)
static

Definition at line 660 of file img2dec.c.

static int webp_probe ( AVProbeData p)
static

Definition at line 670 of file img2dec.c.

Variable Documentation

const int sizes[][2]
static
Initial value:
= {
{ 640, 480 },
{ 720, 480 },
{ 720, 576 },
{ 352, 288 },
{ 352, 240 },
{ 160, 128 },
{ 512, 384 },
{ 640, 352 },
{ 640, 240 },
}

Definition at line 48 of file img2dec.c.

Referenced by aac_encode_init(), encode_frame(), infer_size(), ra144_decode_frame(), ra144_encode_frame(), setup_partitions(), svq1_decode_init(), and x8_vlc_init().

const AVOption options[]
static
Initial value:
= {
{ "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, DEC },
{ "loop", "force loop over input file sequence", OFFSET(loop), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, DEC },
{ "pattern_type", "set pattern type", OFFSET(pattern_type), AV_OPT_TYPE_INT, {.i64=PT_GLOB_SEQUENCE}, 0, INT_MAX, DEC, "pattern_type"},
{ "glob_sequence","select glob/sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB_SEQUENCE}, INT_MIN, INT_MAX, DEC, "pattern_type" },
{ "glob", "select glob pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_GLOB }, INT_MIN, INT_MAX, DEC, "pattern_type" },
{ "sequence", "select sequence pattern type", 0, AV_OPT_TYPE_CONST, {.i64=PT_SEQUENCE }, INT_MIN, INT_MAX, DEC, "pattern_type" },
{ "pixel_format", "set video pixel format", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "start_number", "set first number in the sequence", OFFSET(start_number), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC },
{ "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 },
{ "video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, DEC },
{ "frame_size", "force frame size in bytes", OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC },
{ "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" },
{ "none", "none", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, 0, 2, DEC, "ts_type" },
{ "sec", "second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 1 }, 0, 2, DEC, "ts_type" },
{ "ns", "nano second precision", 0, AV_OPT_TYPE_CONST, {.i64 = 2 }, 0, 2, DEC, "ts_type" },
{ NULL },
}

Definition at line 506 of file img2dec.c.