MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_buffer_replace

Function av_buffer_replace

libavutil/buffer.c:233–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233int av_buffer_replace(AVBufferRef **pdst, const AVBufferRef *src)
234{
235 AVBufferRef *dst = *pdst;
236 AVBufferRef *tmp;
237
238 if (!src) {
239 av_buffer_unref(pdst);
240 return 0;
241 }
242
243 if (dst && dst->buffer == src->buffer) {
244 /* make sure the data pointers match */
245 dst->data = src->data;
246 dst->size = src->size;
247 return 0;
248 }
249
250 tmp = av_buffer_ref(src);
251 if (!tmp)
252 return AVERROR(ENOMEM);
253
254 av_buffer_unref(pdst);
255 *pdst = tmp;
256 return 0;
257}
258
259AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
260 AVBufferRef* (*alloc)(void *opaque, size_t size),

Callers 15

frame_copy_propsFunction · 0.85
av_frame_replaceFunction · 0.85
av_frame_side_data_cloneFunction · 0.85
av_packet_copy_propsFunction · 0.85
flashsv_encode_frameFunction · 0.85
ff_h2645_sei_ctx_replaceFunction · 0.85
nvdec_retrieve_dataFunction · 0.85
libx265_encode_frameFunction · 0.85
setup_frameFunction · 0.85

Calls 2

av_buffer_unrefFunction · 0.85
av_buffer_refFunction · 0.85

Tested by

no test coverage detected