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;
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
MJPEG encoder and decoder.
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Libavcodec external API header.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
main external API structure.
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)