Go to the documentation of this file.
42 WebPPicture *pic =
NULL;
44 WebPMemoryWriter mw = { 0 };
50 WebPMemoryWriterInit(&mw);
51 pic->custom_ptr = &mw;
52 pic->writer = WebPMemoryWrite;
54 ret = WebPEncode(&
s->config, pic);
65 memcpy(
pkt->
data, mw.mem, mw.size);
70 #if (WEBP_ENCODER_ABI_VERSION > 0x0203)
71 WebPMemoryWriterClear(&mw);
98 .p.wrapper_name =
"libwebp",
int ff_libwebp_error_to_averror(int err)
static const FFCodecDefault defaults[]
av_cold int ff_libwebp_encode_init_common(AVCodecContext *avctx)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
AVCodec p
The public AVCodec.
#define FF_CODEC_ENCODE_CB(func)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define CODEC_LONG_NAME(str)
const FFCodec ff_libwebp_encoder
const FFCodecDefault ff_libwebp_defaults[]
int(* init)(AVBSFContext *ctx)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
const char * name
Name of the codec implementation.
static av_cold int libwebp_encode_init(AVCodecContext *avctx)
main external API structure.
static int libwebp_encode_close(AVCodecContext *avctx)
int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags)
Get a buffer for a packet.
int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s, const AVFrame *frame, AVFrame **alt_frame_ptr, WebPPicture **pic_ptr)
This structure stores compressed data.
enum AVPixelFormat ff_libwebpenc_pix_fmts[]
LibWebPContextCommon LibWebPContext
const AVClass ff_libwebpenc_class