Go to the documentation of this file.
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",
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.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
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