FFmpeg
Data Structures | Macros | Functions | Variables
mpjpegdec.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"

Go to the source code of this file.

Data Structures

struct  MPJPEGDemuxContext
 

Macros

#define OFFSET(x)   offsetof(MPJPEGDemuxContext, x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static void trim_right (char *p)
 
static int get_line (AVIOContext *pb, char *line, int line_size)
 
static int split_tag_value (char **tag, char **value, char *line)
 
static int parse_multipart_header (AVIOContext *pb, int *size, const char *expected_boundary, void *log_ctx)
 
static int mpjpeg_read_close (AVFormatContext *s)
 
static int mpjpeg_read_probe (const AVProbeData *p)
 
static int mpjpeg_read_header (AVFormatContext *s)
 
static int parse_content_length (const char *value)
 
static char * mpjpeg_get_boundary (AVIOContext *pb)
 
static int mpjpeg_read_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVOption mpjpeg_options []
 
static const AVClass mpjpeg_demuxer_class
 
AVInputFormat ff_mpjpeg_demuxer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 375 of file mpjpegdec.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 377 of file mpjpegdec.c.

Function Documentation

◆ trim_right()

static void trim_right ( char *  p)
static

Definition at line 40 of file mpjpegdec.c.

Referenced by get_line(), and split_tag_value().

◆ get_line()

static int get_line ( AVIOContext pb,
char *  line,
int  line_size 
)
static

Definition at line 52 of file mpjpegdec.c.

Referenced by mpjpeg_read_header(), and parse_multipart_header().

◆ split_tag_value()

static int split_tag_value ( char **  tag,
char **  value,
char *  line 
)
static

Definition at line 68 of file mpjpegdec.c.

Referenced by parse_multipart_header().

◆ parse_multipart_header()

static int parse_multipart_header ( AVIOContext pb,
int size,
const char *  expected_boundary,
void *  log_ctx 
)
static

Definition at line 175 of file mpjpegdec.c.

Referenced by mpjpeg_read_packet(), and mpjpeg_read_probe().

◆ mpjpeg_read_close()

static int mpjpeg_read_close ( AVFormatContext s)
static

Definition at line 106 of file mpjpegdec.c.

◆ mpjpeg_read_probe()

static int mpjpeg_read_probe ( const AVProbeData p)
static

Definition at line 114 of file mpjpegdec.c.

◆ mpjpeg_read_header()

static int mpjpeg_read_header ( AVFormatContext s)
static

Definition at line 134 of file mpjpegdec.c.

◆ parse_content_length()

static int parse_content_length ( const char *  value)
static

Definition at line 164 of file mpjpegdec.c.

Referenced by parse_multipart_header().

◆ mpjpeg_get_boundary()

static char* mpjpeg_get_boundary ( AVIOContext pb)
static

Definition at line 253 of file mpjpegdec.c.

Referenced by mpjpeg_read_packet().

◆ mpjpeg_read_packet()

static int mpjpeg_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 297 of file mpjpegdec.c.

Variable Documentation

◆ mpjpeg_options

const AVOption mpjpeg_options[]
static
Initial value:
= {
{ "strict_mime_boundary", "require MIME boundaries match", OFFSET(strict_mime_boundary), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
{ NULL }
}

Definition at line 378 of file mpjpegdec.c.

◆ mpjpeg_demuxer_class

const AVClass mpjpeg_demuxer_class
static
Initial value:
= {
.class_name = "MPJPEG demuxer",
.item_name = av_default_item_name,
.option = mpjpeg_options,
}

Definition at line 384 of file mpjpegdec.c.

◆ ff_mpjpeg_demuxer

AVInputFormat ff_mpjpeg_demuxer
Initial value:
= {
.name = "mpjpeg",
.long_name = NULL_IF_CONFIG_SMALL("MIME multipart JPEG"),
.mime_type = "multipart/x-mixed-replace",
.extensions = "mjpg",
.priv_data_size = sizeof(MPJPEGDemuxContext),
.priv_class = &mpjpeg_demuxer_class,
}

Definition at line 391 of file mpjpegdec.c.

AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:467
DEC
#define DEC
Definition: mpjpegdec.c:377
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
OFFSET
#define OFFSET(x)
Definition: mpjpegdec.c:375
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:530
NULL
#define NULL
Definition: coverity.c:32
read_probe
static int read_probe(const AVProbeData *pd)
Definition: jvdec.c:55
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
mpjpeg_demuxer_class
static const AVClass mpjpeg_demuxer_class
Definition: mpjpegdec.c:384
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:188
mpjpeg_read_probe
static int mpjpeg_read_probe(const AVProbeData *p)
Definition: mpjpegdec.c:114
mpjpeg_read_close
static int mpjpeg_read_close(AVFormatContext *s)
Definition: mpjpegdec.c:106
mpjpeg_read_packet
static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: mpjpegdec.c:297
mpjpeg_options
static const AVOption mpjpeg_options[]
Definition: mpjpegdec.c:378
MPJPEGDemuxContext
Definition: mpjpegdec.c:31
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_reading.c:42
mpjpeg_read_header
static int mpjpeg_read_header(AVFormatContext *s)
Definition: mpjpegdec.c:134
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:240
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:565