FFmpeg
Loading...
Searching...
No Matches
jpegmpfdec.c File Reference

Demuxer for the JPEG Multi-Picture Format file format. More...

#include <stdlib.h>
#include <string.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/gain_map.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/exif.h"
#include "libavcodec/mjpeg.h"
#include "avformat.h"
#include "demux.h"
#include "jpegmpf.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  MPFDemuxImage
 
struct  MPFDemuxContext
 

Macros

#define CHECK_IDENT(strc)
 
#define OFFSET(x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static int mpf_probe (const AVProbeData *p)
 
static int grow_header (AVFormatContext *ctx, int size)
 
static int parse_mp_index (AVFormatContext *ctx, const uint8_t *data, int len, int64_t tiff_base)
 
static int parse_app2 (AVFormatContext *ctx, int offset, int len)
 
static int cmp_image_start (const void *a, const void *b)
 
static int add_gain_map_group (AVFormatContext *ctx, const MPFDemuxImage *base, const MPFDemuxImage *gain)
 
static int mpf_read_header (AVFormatContext *ctx)
 
static int mpf_read_packet (AVFormatContext *ctx, AVPacket *pkt)
 
static int mpf_read_seek (AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
 
static int mpf_read_close (AVFormatContext *ctx)
 

Variables

static const AVOption mpf_options []
 
static const AVClass mpf_class
 
const FFInputFormat ff_jpeg_mpf_demuxer
 

Detailed Description

Demuxer for the JPEG Multi-Picture Format file format.

Definition in file jpegmpfdec.c.

Macro Definition Documentation

◆ CHECK_IDENT

#define CHECK_IDENT ( strc)
Value:
(len >= sizeof(strc) && !memcmp(gb->buffer, strc, sizeof(strc)))
int len

Definition at line 72 of file jpegmpfdec.c.

Referenced by mpf_probe(), and parse_app2().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 509 of file jpegmpfdec.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 510 of file jpegmpfdec.c.

Function Documentation

◆ mpf_probe()

static int mpf_probe ( const AVProbeData * p)
static

Definition at line 74 of file jpegmpfdec.c.

◆ grow_header()

static int grow_header ( AVFormatContext * ctx,
int size )
static

Definition at line 125 of file jpegmpfdec.c.

Referenced by mpf_read_header().

◆ parse_mp_index()

static int parse_mp_index ( AVFormatContext * ctx,
const uint8_t * data,
int len,
int64_t tiff_base )
static

Definition at line 137 of file jpegmpfdec.c.

Referenced by parse_app2().

◆ parse_app2()

static int parse_app2 ( AVFormatContext * ctx,
int offset,
int len )
static

Definition at line 227 of file jpegmpfdec.c.

Referenced by mpf_read_header().

◆ cmp_image_start()

static int cmp_image_start ( const void * a,
const void * b )
static

Definition at line 252 of file jpegmpfdec.c.

Referenced by mpf_read_header().

◆ add_gain_map_group()

static int add_gain_map_group ( AVFormatContext * ctx,
const MPFDemuxImage * base,
const MPFDemuxImage * gain )
static

Definition at line 260 of file jpegmpfdec.c.

Referenced by mpf_read_header().

◆ mpf_read_header()

static int mpf_read_header ( AVFormatContext * ctx)
static

Definition at line 281 of file jpegmpfdec.c.

◆ mpf_read_packet()

static int mpf_read_packet ( AVFormatContext * ctx,
AVPacket * pkt )
static

Definition at line 429 of file jpegmpfdec.c.

◆ mpf_read_seek()

static int mpf_read_seek ( AVFormatContext * ctx,
int stream_index,
int64_t timestamp,
int flags )
static

Definition at line 481 of file jpegmpfdec.c.

◆ mpf_read_close()

static int mpf_read_close ( AVFormatContext * ctx)
static

Definition at line 501 of file jpegmpfdec.c.

Variable Documentation

◆ mpf_options

const AVOption mpf_options[]
static
Initial value:
= {
{ "framerate", "set the video framerate", OFFSET(framerate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, INT_MAX, DEC },
{ "loop", "loop over the images in the file", OFFSET(loop), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
{ NULL },
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
static int loop
Definition ffplay.c:367
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition opt.h:314
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
#define DEC
Definition librsvgdec.c:149
float framerate
Definition av1_levels.c:29

Definition at line 511 of file jpegmpfdec.c.

◆ mpf_class

const AVClass mpf_class
static
Initial value:
= {
.class_name = "jpeg_mpf demuxer",
.item_name = av_default_item_name,
.option = mpf_options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:247
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const AVOption mpf_options[]
Definition jpegmpfdec.c:511

Definition at line 517 of file jpegmpfdec.c.

◆ ff_jpeg_mpf_demuxer

const FFInputFormat ff_jpeg_mpf_demuxer
Initial value:
= {
.p.name = "jpeg_mpf",
.p.long_name = NULL_IF_CONFIG_SMALL("JPEG Multi-Picture Format"),
.p.priv_class = &mpf_class,
.p.extensions = "mpo",
.priv_data_size = sizeof(MPFDemuxContext),
}
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
static int read_probe(const AVProbeData *p)
Definition cdg.c:30
#define FF_INFMT_FLAG_INIT_CLEANUP
For an FFInputFormat with this flag set read_close() needs to be called by the caller upon read_heade...
Definition demux.h:35
#define FF_INFMT_FLAG_ID3V2_AUTO
Automatically parse ID3v2 metadata.
Definition demux.h:45
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:580
static int mpf_read_header(AVFormatContext *ctx)
Definition jpegmpfdec.c:281
static int mpf_probe(const AVProbeData *p)
Definition jpegmpfdec.c:74
static const AVClass mpf_class
Definition jpegmpfdec.c:517
static int mpf_read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition jpegmpfdec.c:429
static int mpf_read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition jpegmpfdec.c:481
static int mpf_read_close(AVFormatContext *ctx)
Definition jpegmpfdec.c:501
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:97
static av_cold int read_close(AVFormatContext *ctx)
Definition libcdio.c:143
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition libcdio.c:151

Definition at line 524 of file jpegmpfdec.c.