Go to the documentation of this file.
41 WebPPicture *pic =
NULL;
43 WebPMemoryWriter mw = { 0 };
49 WebPMemoryWriterInit(&mw);
50 pic->custom_ptr = &mw;
51 pic->writer = WebPMemoryWrite;
53 ret = WebPEncode(&
s->config, pic);
64 memcpy(
pkt->
data, mw.mem, mw.size);
69 #if (WEBP_ENCODER_ABI_VERSION > 0x0203)
70 WebPMemoryWriterClear(&mw);
102 .wrapper_name =
"libwebp",
int ff_libwebp_error_to_averror(int err)
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.
static const AVCodecDefault defaults[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#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.
static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
const char * name
Name of the codec implementation.
const AVCodec ff_libwebp_encoder
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
const AVCodecDefault ff_libwebp_defaults[]