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) {
95 for (i = size - 2; i >= 0; i--) {
96 if (buf[i] == 0xff && buf[i + 1] ==
EOI) {
107 if (off == 0 && nb_qtables)
108 hdr_size += 4 + 64 * nb_qtables;
114 bytestream_put_byte(&p, 0);
115 bytestream_put_be24(&p, off);
116 bytestream_put_byte(&p, type);
117 bytestream_put_byte(&p, 255);
118 bytestream_put_byte(&p, w);
119 bytestream_put_byte(&p, h);
121 if (off == 0 && nb_qtables) {
123 bytestream_put_byte(&p, 0);
124 bytestream_put_byte(&p, 0);
125 bytestream_put_be16(&p, 64 * nb_qtables);
127 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.
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 PIX_FMT_YUV422P and setting color_...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void av_log(void *avcl, int level, const char *fmt,...)
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 PIX_FMT_YUV420P and setting color_...
void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
int width
picture width / height.
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.