77 while (*p !=
'\0' && *p !=
':') {
103 const char* expected_boundary,
138 ret =
get_line(s->
pb, boundary,
sizeof(boundary));
141 }
while (!boundary[0]);
143 if (strncmp(boundary,
"--", 2))
162 long int val = strtol(value,
NULL, 10);
164 if (val == LONG_MIN || val == LONG_MAX)
173 const char* expected_boundary,
177 int found_content_type = 0;
183 ret =
get_line(pb, line,
sizeof(line));
191 ret =
get_line(pb, line,
sizeof(line));
200 "Expected boundary '%s' not found, instead found a line of %"SIZE_SPECIFIER" bytes\n",
210 ret =
get_line(pb, line,
sizeof(line));
230 "Unexpected %s : %s\n",
234 found_content_type = 1;
240 "Invalid Content-Length value : %s\n",
260 while (start !=
NULL && *start !=
'\0') {
261 start = strchr(start,
';');
271 end = strchr(start,
';');
273 len = end - start - 1;
279 if ( len>2 && *start ==
'"' && start[len-1] ==
'"' ) {
304 if (boundary !=
NULL) {
367 #define OFFSET(x) offsetof(MPJPEGDemuxContext, x) 369 #define DEC AV_OPT_FLAG_DECODING_PARAM 386 .mime_type =
"multipart/x-mixed-replace",
387 .extensions =
"mjpg",
393 .priv_class = &mpjpeg_demuxer_class,
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
int64_t pos
byte position in stream, -1 if unknown
static int get_line(AVIOContext *pb, char *line, int line_size)
static int read_chunk(AVFormatContext *s)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
const char * av_default_item_name(void *ptr)
Return the context name.
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)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int av_stristart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str independent of case.
static av_cold int end(AVCodecContext *avctx)
GLsizei GLboolean const GLfloat * value
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_cold int read_close(AVFormatContext *ctx)
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
static int mpjpeg_read_header(AVFormatContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int mpjpeg_read_close(AVFormatContext *s)
#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.
static const AVClass mpjpeg_demuxer_class
int buf_size
Size of buf except extra allocated bytes.
char * av_asprintf(const char *fmt,...)
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)
Locale-independent case-insensitive compare.
#define AV_OPT_SEARCH_CHILDREN
Search in possible children of the given object first.
AVInputFormat ff_mpjpeg_demuxer
int ff_get_line(AVIOContext *s, char *buf, int maxlen)
Read a whole line of text from AVIOContext.
static int read_header(FFV1Context *f)
static int mpjpeg_read_probe(const AVProbeData *p)
static int parse_multipart_header(AVIOContext *pb, int *size, const char *expected_boundary, void *log_ctx)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
char * av_strdup(const char *s)
Duplicate a string.
AVIOContext * pb
I/O context.
Describe the class of an AVClass context structure.
int error
contains the error code or 0 if no error happened
This structure contains the data a format has to probe a file.
#define flags(name, subs,...)
static void trim_right(char *p)
static const AVOption mpjpeg_options[]
int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
Ensures that the requested seekback buffer size will be available.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
int ffio_init_context(AVIOContext *s, 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))
static int mpjpeg_read_packet(AVFormatContext *s, AVPacket *pkt)
int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val)
int eof_reached
true if was unable to read due to error or eof
void * priv_data
Format private data.
static char * mpjpeg_get_boundary(AVIOContext *pb)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
static int parse_content_length(const char *value)
static double val(void *priv, double ch)
This structure stores compressed data.
char * av_strndup(const char *s, size_t len)
Duplicate a substring of a string.