31 if (i > 1 && line[i - 2] ==
'\r')
47 while (*p !=
'\0' && *p !=
':')
83 char line[128] = { 0 };
94 ret =
get_line(pb, line,
sizeof(line));
113 char boundary[70 + 2 + 1];
118 ret =
get_line(s->
pb, boundary,
sizeof(boundary));
122 if (strncmp(boundary,
"--", 2))
141 long int val = strtol(value,
NULL, 10);
143 if (val == LONG_MIN || val == LONG_MAX)
153 int found_content_type = 0;
170 if (strncmp(line,
"--", 2))
190 "Unexpected %s : %s\n",
194 found_content_type = 1;
202 if (!found_content_type || size < 0) {
227 .mime_type =
"multipart/x-mixed-replace",
228 .extensions =
"mjpg",
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int get_line(AVIOContext *pb, char *line, int line_size)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static av_const int av_isspace(int c)
Locale-independent conversion of ASCII isspace.
static int split_tag_value(char **tag, char **value, char *line)
static int parse_multipart_header(AVFormatContext *s)
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int mpjpeg_read_header(AVFormatContext *s)
AVIOContext * avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, int(*read_packet)(void *opaque, uint8_t *buf, int buf_size), int(*write_packet)(void *opaque, uint8_t *buf, int buf_size), int64_t(*seek)(void *opaque, int64_t offset, int whence))
Allocate and initialize an AVIOContext for buffered I/O.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int av_strcasecmp(const char *a, const char *b)
AVInputFormat ff_mpjpeg_demuxer
static int mpjpeg_read_probe(AVProbeData *p)
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
AVIOContext * pb
I/O context.
static int check_content_type(char *line)
int error
contains the error code or 0 if no error happened
This structure contains the data a format has to probe a file.
static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
int eof_reached
true if eof reached
AVCodecParameters * codecpar
static int parse_content_length(const char *value)
This structure stores compressed data.