FFmpeg
Data Structures | Macros | Functions | Variables
mpjpegdec.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avformat.h"
#include "demux.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
 
const FFInputFormat ff_mpjpeg_demuxer
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 359 of file mpjpegdec.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 360 of file mpjpegdec.c.

Function Documentation

◆ trim_right()

static void trim_right ( char *  p)
static

Definition at line 39 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 51 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 65 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 167 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 102 of file mpjpegdec.c.

◆ mpjpeg_read_probe()

static int mpjpeg_read_probe ( const AVProbeData p)
static

Definition at line 110 of file mpjpegdec.c.

◆ mpjpeg_read_header()

static int mpjpeg_read_header ( AVFormatContext s)
static

Definition at line 126 of file mpjpegdec.c.

◆ parse_content_length()

static int parse_content_length ( const char *  value)
static

Definition at line 156 of file mpjpegdec.c.

Referenced by parse_multipart_header().

◆ mpjpeg_get_boundary()

static char* mpjpeg_get_boundary ( AVIOContext pb)
static

Definition at line 244 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 287 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 361 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 366 of file mpjpegdec.c.

◆ ff_mpjpeg_demuxer

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

Definition at line 373 of file mpjpegdec.c.

AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
DEC
#define DEC
Definition: mpjpegdec.c:360
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
OFFSET
#define OFFSET(x)
Definition: mpjpegdec.c:359
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:42
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:540
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
mpjpeg_demuxer_class
static const AVClass mpjpeg_demuxer_class
Definition: mpjpegdec.c:366
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
mpjpeg_read_probe
static int mpjpeg_read_probe(const AVProbeData *p)
Definition: mpjpegdec.c:110
mpjpeg_read_close
static int mpjpeg_read_close(AVFormatContext *s)
Definition: mpjpegdec.c:102
mpjpeg_read_packet
static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: mpjpegdec.c:287
mpjpeg_options
static const AVOption mpjpeg_options[]
Definition: mpjpegdec.c:361
MPJPEGDemuxContext
Definition: mpjpegdec.c:31
mpjpeg_read_header
static int mpjpeg_read_header(AVFormatContext *s)
Definition: mpjpegdec.c:126
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327