当前位置:网站首页>Avframe Memory Management API
Avframe Memory Management API
2022-06-28 08:34:00 【,,,, Nanshan light rain】
int av_frame_ref(AVFrame *dst, const AVFrame *src)
It's like copying ,src Copied to the dst, But it's just that src The reference of the data inside is added 1, Then add the reference to dst in
AVFrame *av_frame_clone(const AVFrame *src);
Work with av_frame_ref similar , increase src Reference count of , But it will also initialize av_frame_clone object
void av_frame_unref(AVFrame* frame)
take frame The reference count is subtracted by one .
av_frame_free(): Release AVFrame Structure space of . This function is interesting . Because it not only frees up the space of the structure , Also involves AVFrame Medium uint8_t *data[AV_NUM_DATA_POINTERS]; Field release problem ., If AVFrame Medium uint8_t *data[AV_NUM_DATA_POINTERS] Citation in ==1, Then release data Space .
av_frame_unref() Function is for frame Of buf Array One by one call av_buffer_unref().av_buffer_unref I told you before . Is that the reference count becomes 0, Let go data, Otherwise, only the memory of the structure itself will be released . Be careful , Premise is buf[i] It can't be null.
void av_frame_unref(AVFrame *frame)
{
int i;
if (!frame)
return;
wipe_side_data(frame);
for (i = 0; i < FF_ARRAY_ELEMS(frame->buf); i++)
av_buffer_unref(&frame->buf[i]);
for (i = 0; i < frame->nb_extended_buf; i++)
av_buffer_unref(&frame->extended_buf[i]);
av_freep(&frame->extended_buf);
av_dict_free(&frame->metadata);
#if FF_API_FRAME_QP
FF_DISABLE_DEPRECATION_WARNINGS
av_buffer_unref(&frame->qp_table_buf);
FF_ENABLE_DEPRECATION_WARNINGS
#endif
av_buffer_unref(&frame->hw_frames_ctx);
av_buffer_unref(&frame->opaque_ref);
av_buffer_unref(&frame->private_ref);
get_frame_defaults(frame);
}
————————————————
Copyright notice : This paper is about CSDN Blogger 「oooooome」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/oooooome/article/details/111993911
https://blog.csdn.net/oooooome/article/details/111993911?ops_request_misc=&request_id=&biz_id=102&utm_term=av_frame_unref&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduweb~default-7-111993911.nonecase&spm=1018.2226.3001.4187
边栏推荐
猜你喜欢

Discussion on the application of GIS 3D system in mining industry

【.NET6】gRPC服务端和客户端开发案例,以及minimal API服务、gRPC服务和传统webapi服务的访问效率大对决

TCP

Infinite penetration test

关于在cmd中MySQL不能插中文数据的原因

B_ QuRT_ User_ Guide(27)

罗氏线圈工作原理

第六届智能家居亚洲峰会暨精品展(Smart Home Asia 2022)将于10月在沪召开

AI chief architect 8-aica-gao Xiang, in-depth understanding and practice of propeller 2.0

利尔达低代码数据大屏,铲平数据应用开发门槛
随机推荐
叠加阶梯图和线图及合并线图和针状图
AI chief architect 8-aica-gao Xiang, in-depth understanding and practice of propeller 2.0
Cloudcompare & PCL point cloud clipping (based on closed surfaces or polygons)
[untitled]
PMP从报考到拿证基本操作,了解PMP必看篇
Sword finger offer 03 Duplicate number in array
个人究竟如何开户炒股?在线开户安全么?
Usage record of Xintang nuc980: self made development board (based on nuc980dk61yc)
duilib 入门基础十二 样式类
块级元素上下左右居中的两个小技巧
TCP那点事
与普通探头相比,差分探头有哪些优点
11grac turn off archive log
On the solution of insufficient swap partition
Kali installation configuration
Unity gets the coordinate point in front of the current object at a certain angle and distance
The 6th smart home Asia 2022 will be held in Shanghai in October
RAC enable archive log
Oracle view all tablespaces in the current library
广州:金融新活水 文企新机遇