61 for (i = 0; i <
size; i++) {
65 if (buf[i + 1] ==
DQT) {
68 "Only 8-bit precision is supported.\n");
71 nb_qtables =
AV_RB16(&buf[i + 2]) / 65;
72 if (i + 4 + nb_qtables * 65 > size) {
77 qtables = &buf[i + 4];
78 }
else if (buf[i + 1] ==
SOF0) {
79 if (buf[i + 14] != 17 || buf[i + 17] != 17) {
81 "Only 1x1 chroma blocks are supported. Aborted!\n");
84 }
else if (buf[i + 1] ==
SOS) {
89 "Insufficient data. Aborted!\n");
100 for (i = size - 2; i >= 0; i--) {
101 if (buf[i] == 0xff && buf[i + 1] ==
EOI) {
112 if (off == 0 && nb_qtables)
113 hdr_size += 4 + 64 * nb_qtables;
119 bytestream_put_byte(&p, 0);
120 bytestream_put_be24(&p, off);
121 bytestream_put_byte(&p, type);
122 bytestream_put_byte(&p, 255);
123 bytestream_put_byte(&p, w);
124 bytestream_put_byte(&p, h);
126 if (off == 0 && nb_qtables) {
128 bytestream_put_byte(&p, 0);
129 bytestream_put_byte(&p, 0);
130 bytestream_put_be16(&p, 64 * nb_qtables);
132 for (i = 0; i < nb_qtables; i++)
#define AV_LOG_WARNING
Something somehow does not look correct.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
MJPEG encoder and decoder.
AVStream ** streams
A list of all streams in the file.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
AVCodecContext * codec
Codec context associated with this stream.
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
int width
picture width / height.
#define FF_CEIL_RSHIFT(a, b)
the normal 2^n-1 "JPEG" YUV ranges
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
void * priv_data
Format private data.