34 uint8_t **poutbuf,
int *poutbuf_size,
35 const uint8_t *buf,
int buf_size,
int keyframe)
38 unsigned dqt = 0, dht = 0, sof0 = 0;
49 bytestream_put_byte(&poutbufp, 0xff);
50 bytestream_put_byte(&poutbufp,
SOI);
51 bytestream_put_byte(&poutbufp, 0xff);
52 bytestream_put_byte(&poutbufp,
APP1);
53 bytestream_put_be16(&poutbufp, 42);
54 bytestream_put_be32(&poutbufp, 0);
56 bytestream_put_be32(&poutbufp, buf_size + 44);
57 bytestream_put_be32(&poutbufp, buf_size + 44);
58 bytestream_put_be32(&poutbufp, 0);
60 for (i = 0; i < buf_size - 1; i++) {
63 case DQT: dqt = i + 46;
break;
64 case DHT: dht = i + 46;
break;
65 case SOF0: sof0 = i + 46;
break;
67 bytestream_put_be32(&poutbufp, dqt);
68 bytestream_put_be32(&poutbufp, dht);
69 bytestream_put_be32(&poutbufp, sof0);
70 bytestream_put_be32(&poutbufp, i + 46);
71 bytestream_put_be32(&poutbufp, i + 46 +
AV_RB16(buf + i + 2));
73 *poutbuf_size = poutbufp - *poutbuf;
78 memcpy(*poutbuf, buf, buf_size);
79 *poutbuf_size = buf_size;