43 WebPPicture *pic =
NULL;
45 WebPMemoryWriter mw = { 0 };
51 WebPMemoryWriterInit(&mw);
52 pic->custom_ptr = &mw;
53 pic->writer = WebPMemoryWrite;
55 ret = WebPEncode(&
s->config, pic);
66 memcpy(
pkt->data, mw.mem, mw.size);
71#if (WEBP_ENCODER_ABI_VERSION > 0x0203)
72 WebPMemoryWriterClear(&mw);
100 .p.wrapper_name =
"libwebp",
const FFCodec ff_libwebp_encoder
static const FFCodecDefault defaults[]
#define CODEC_PIXFMTS_ARRAY(array)
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_ENCODE_CB(func)
#define CODEC_LONG_NAME(str)
int(* init)(AVBSFContext *ctx)
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
LibWebPContextCommon LibWebPContext
static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
static int libwebp_encode_close(AVCodecContext *avctx)
static av_cold int libwebp_encode_init(AVCodecContext *avctx)
int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s, const AVFrame *frame, AVFrame **alt_frame_ptr, WebPPicture **pic_ptr)
const AVClass ff_libwebpenc_class
enum AVPixelFormat ff_libwebpenc_pix_fmts[]
av_cold int ff_libwebp_encode_init_common(AVCodecContext *avctx)
int ff_libwebp_error_to_averror(int err)
const FFCodecDefault ff_libwebp_defaults[]
WebP encoder using libwebp: common structs and methods.
Memory handling functions.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
main external API structure.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.