Go to the documentation of this file.
30 const uint8_t *buf = avpkt->
data;
31 const uint8_t *buf_end = avpkt->
data + avpkt->
size;
37 if (buf_end - buf < 14)
42 bytes_per_pixel =
AV_RL16(buf+12) >> 3;
44 if (bytes_per_pixel != 2) {
51 if (buf_end - buf <
offset)
58 if (buf_end - buf <
w * bytes_per_pixel)
72 for (y = 0; y <
h && buf_end - buf >=
w * bytes_per_pixel; y++) {
73 memcpy(ptr, buf,
w*bytes_per_pixel);
75 buf +=
w*bytes_per_pixel;
#define AV_LOG_WARNING
Something somehow does not look correct.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
const AVCodec ff_ptx_decoder
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
@ AV_PICTURE_TYPE_I
Intra.
enum AVPictureType pict_type
Picture type of the frame.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
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 offset
static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
main external API structure.
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.
#define avpriv_request_sample(...)
@ AV_PIX_FMT_BGR555LE
packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
This structure stores compressed data.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.