21 #include "libavutil/avstring.h"
38 while (!width || !height) {
39 ptr += strcspn(ptr,
"#");
40 if (ptr >= avpkt->
data + avpkt->
size) {
44 if (strncmp(ptr,
"#define", 7) != 0) {
46 "Unexpected preprocessor directive.\n");
50 ptr += strcspn(ptr,
"_") + 1;
52 if (strncmp(ptr,
"width", 5) == 0) {
53 ptr += strcspn(ptr,
" ");
54 width = strtol(ptr,
NULL, 10);
55 }
else if (strncmp(ptr,
"height", 6) == 0) {
56 ptr += strcspn(ptr,
" ");
57 height = strtol(ptr,
NULL, 10);
61 "Ignoring preprocessor directive.\n");
72 ptr += strcspn(ptr,
"{");
74 linesize = (avctx->
width + 7) / 8;
75 for (i = 0; i < avctx->
height; i++) {
78 if (ptr >= avpkt->
data + avpkt->
size) {
86 ptr += strcspn(ptr,
"x") - 1;
87 val = strtol(ptr, (
char **)&endptr, 16);
89 if (endptr - ptr == 4) {
93 }
else if (endptr - ptr == 6) {
100 "Unexpected data at %.8s.\n", ptr);
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
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...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int xbm_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Libavcodec external API header.
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb...
common internal api header.
int key_frame
1 -> keyframe, 0-> not
const uint8_t ff_reverse[256]
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.