Go to the documentation of this file.
31 const uint8_t *qtables[4] = {
NULL };
39 int default_huffman_tables = 0;
42 s->timestamp =
s->cur_timestamp;
53 if (buf[
i + 1] ==
DQT) {
55 if (buf[
i + 4] & 0xF0)
57 "Only 8-bit precision is supported.\n");
65 if (nb_qtables +
tables > 4) {
70 for (j = 0; j <
tables; j++)
71 qtables[nb_qtables + j] = buf +
i + 5 + j * 65;
73 }
else if (buf[
i + 1] ==
SOF0) {
74 if (buf[
i + 14] != 17 || buf[
i + 17] != 17) {
76 "Only 1x1 chroma blocks are supported. Aborted!\n");
87 if (buf[
i + 11] == 33) {
90 }
else if (buf[
i + 11] == 34) {
96 }
else if (buf[
i + 1] ==
DHT) {
98 default_huffman_tables |= 1 << 4;
101 if (
i + dht_size >=
size)
104 switch (buf[
i + 1]) {
109 default_huffman_tables |= 1;
121 default_huffman_tables |= 1 << 1;
133 default_huffman_tables |= 1 << 2;
145 default_huffman_tables |= 1 << 3;
158 }
else if (buf[
i + 1] ==
SOS) {
163 "Insufficient data. Aborted!\n");
173 "Invalid RTP/JPEG type\n");
177 if (default_huffman_tables && default_huffman_tables != 31) {
179 "RFC 2435 requires standard Huffman tables for jpeg\n");
182 if (nb_qtables && nb_qtables != 2)
184 "RFC 2435 suggests two quantization tables, %d provided\n",
191 for (
i =
size - 2;
i >= 0;
i--) {
192 if (buf[
i] == 0xff && buf[
i + 1] ==
EOI) {
203 if (off == 0 && nb_qtables)
204 hdr_size += 4 + 64 * nb_qtables;
210 bytestream_put_byte(&p, 0);
211 bytestream_put_be24(&p, off);
212 bytestream_put_byte(&p,
type);
213 bytestream_put_byte(&p, 255);
214 bytestream_put_byte(&p,
w);
215 bytestream_put_byte(&p,
h);
217 if (off == 0 && nb_qtables) {
219 bytestream_put_byte(&p, 0);
220 bytestream_put_byte(&p, 0);
221 bytestream_put_be16(&p, 64 * nb_qtables);
223 for (
i = 0;
i < nb_qtables;
i++)
#define AV_LOG_WARNING
Something somehow does not look correct.
AVStream ** streams
A list of all streams in the file.
const uint8_t ff_mjpeg_val_dc[]
void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m)
const uint8_t ff_mjpeg_bits_ac_chrominance[]
Writing a table generator This documentation is preliminary Parts of the API are not good and should be changed Basic concepts A table generator consists of two *_tablegen c and *_tablegen h The h file will provide the variable declarations and initialization code for the tables
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_CEIL_RSHIFT(a, b)
AVCodecParameters * codecpar
Codec parameters associated with this stream.
void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size)
const uint8_t ff_mjpeg_val_ac_chrominance[]
const uint8_t ff_mjpeg_val_ac_luminance[]
const uint8_t ff_mjpeg_bits_ac_luminance[]
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define i(width, name, range_min, range_max)
const uint8_t ff_mjpeg_bits_dc_chrominance[]
const FF_VISIBILITY_PUSH_HIDDEN uint8_t ff_mjpeg_bits_dc_luminance[]
void * priv_data
Format private data.
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