当前位置: 首页 > news >正文

手机网站开发流程图wordpress 30分钟过期

手机网站开发流程图,wordpress 30分钟过期,wordpress经典主题下载,wordpress 导航栏插件FFmpeg实现了一个AVBufferPool #xff0c;这个pool可以用来提前做些内存分配等#xff0c;在ffmpeg cuvid插件中hwcontext_cuda.c文件夹中可以看到这个Pool的用法。 下面是关键结构体的定义#xff0c;可以看到几个比较重要的函数指针#xff0c;比如#xff1a; void …FFmpeg实现了一个AVBufferPool 这个pool可以用来提前做些内存分配等在ffmpeg cuvid插件中hwcontext_cuda.c文件夹中可以看到这个Pool的用法。 下面是关键结构体的定义可以看到几个比较重要的函数指针比如 void (*free)(void *opaque, uint8_t *data);这个是用来释放AVBuffer 中的data数据的可以由用户来指定。 /*** The buffer was av_realloc()ed, so it is reallocatable.*/ #define BUFFER_FLAG_REALLOCATABLE (1 0)struct AVBuffer {uint8_t *data; /** data described by this buffer */buffer_size_t size; /** size of data in bytes *//*** number of existing AVBufferRef instances referring to this buffer*/atomic_uint refcount;/*** a callback for freeing the data*/void (*free)(void *opaque, uint8_t *data);/*** an opaque pointer, to be used by the freeing callback*/void *opaque;/*** A combination of AV_BUFFER_FLAG_**/int flags;/*** A combination of BUFFER_FLAG_**/int flags_internal; }; 下面是Pool的元素BufferPoolEntry可以看到一个next指针其实就是一个单向链表。 其中free用来释放buffer typedef struct BufferPoolEntry {uint8_t *data;/** Backups of the original opaque/free of the AVBuffer corresponding to* data. They will be used to free the buffer when the pool is freed.*/void *opaque;void (*free)(void *opaque, uint8_t *data);AVBufferPool *pool;struct BufferPoolEntry *next; } BufferPoolEntry; 下面是一个bufferPoll的定义其中有一个refcount作为ref来使用另外有两个alloc函数和pool_free struct AVBufferPool {AVMutex mutex;BufferPoolEntry *pool;/** This is used to track when the pool is to be freed.* The pointer to the pool itself held by the caller is considered to* be one reference. Each buffer requested by the caller increases refcount* by one, returning the buffer to the pool decreases it by one.* refcount reaches zero when the buffer has been uninited AND all the* buffers have been released, then its safe to free the pool and all* the buffers in it.*/atomic_uint refcount;buffer_size_t size;void *opaque;AVBufferRef* (*alloc)(buffer_size_t size);AVBufferRef* (*alloc2)(void *opaque, buffer_size_t size);void (*pool_free)(void *opaque); };下面的注释其实已经说明了该怎么去使用buffer poll。 /*** defgroup lavu_bufferpool AVBufferPool* ingroup lavu_data** {* AVBufferPool is an API for a lock-free thread-safe pool of AVBuffers.** Frequently allocating and freeing large buffers may be slow. AVBufferPool is* meant to solve this in cases when the caller needs a set of buffers of the* same size (the most obvious use case being buffers for raw video or audio* frames).** At the beginning, the user must call av_buffer_pool_init() to create the* buffer pool. Then whenever a buffer is needed, call av_buffer_pool_get() to* get a reference to a new buffer, similar to av_buffer_alloc(). This new* reference works in all aspects the same way as the one created by* av_buffer_alloc(). However, when the last reference to this buffer is* unreferenced, it is returned to the pool instead of being freed and will be* reused for subsequent av_buffer_pool_get() calls.** When the caller is done with the pool and no longer needs to allocate any new* buffers, av_buffer_pool_uninit() must be called to mark the pool as freeable.* Once all the buffers are released, it will automatically be freed.** Allocating and releasing buffers with this API is thread-safe as long as* either the default alloc callback is used, or the user-supplied one is* thread-safe.*//*** The buffer pool. This structure is opaque and not meant to be accessed* directly. It is allocated with av_buffer_pool_init() and freed with* av_buffer_pool_uninit().*/ typedef struct AVBufferPool AVBufferPool;/*** Allocate and initialize a buffer pool.** param size size of each buffer in this pool* param alloc a function that will be used to allocate new buffers when the* pool is empty. May be NULL, then the default allocator will be used* (av_buffer_alloc()).* return newly created buffer pool on success, NULL on error.*/ #if FF_API_BUFFER_SIZE_T AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size)); #else AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size)); #endif/*** Allocate and initialize a buffer pool with a more complex allocator.** param size size of each buffer in this pool* param opaque arbitrary user data used by the allocator* param alloc a function that will be used to allocate new buffers when the* pool is empty. May be NULL, then the default allocator will be* used (av_buffer_alloc()).* param pool_free a function that will be called immediately before the pool* is freed. I.e. after av_buffer_pool_uninit() is called* by the caller and all the frames are returned to the pool* and freed. It is intended to uninitialize the user opaque* data. May be NULL.* return newly created buffer pool on success, NULL on error.*/ #if FF_API_BUFFER_SIZE_T AVBufferPool *av_buffer_pool_init2(int size, void *opaque,AVBufferRef* (*alloc)(void *opaque, int size), #else AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,AVBufferRef* (*alloc)(void *opaque, size_t size), #endifvoid (*pool_free)(void *opaque));/*** Mark the pool as being available for freeing. It will actually be freed only* once all the allocated buffers associated with the pool are released. Thus it* is safe to call this function while some of the allocated buffers are still* in use.** param pool pointer to the pool to be freed. It will be set to NULL.*/ void av_buffer_pool_uninit(AVBufferPool **pool);/*** Allocate a new AVBuffer, reusing an old buffer from the pool when available.* This function may be called simultaneously from multiple threads.** return a reference to the new buffer on success, NULL on error.*/ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);/*** Query the original opaque parameter of an allocated buffer in the pool.** param ref a buffer reference to a buffer returned by av_buffer_pool_get.* return the opaque parameter set by the buffer allocator function of the* buffer pool.** note the opaque parameter of ref is used by the buffer pool implementation,* therefore you have to use this function to access the original opaque* parameter of an allocated buffer.*/ void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref);使用的流程就是上面几个函数。 文章开头也说了hwcontext_cuda.c中使用AVBufferPool其实是AVHWFramesContext 里面有一个bufferpool.它的使用。
http://www.sadfv.cn/news/227246/

相关文章:

  • p2p网站建设报价宿州建设公司网站
  • 旅游酒店网站建设背景分析做户外照明有哪些网站
  • 哪个网站可以上传设计的作品百度推广后台登陆首页
  • 网站建设数据库实训体会网页设计师简历
  • 上海建设教育网站网站做互动
  • 网站开发容易找工作吗建站公司前景
  • 怎样做公司官方网站学广告设计需要什么学历
  • 西安电商平台网站最好看免费观看高清大全老师补课
  • 网站根 html建网站有报价单吗
  • 中国城乡建设部网站广西建设网站网址多少钱
  • 佛山市手机网站建设哪家好网络营销策划推广公司有哪些
  • 汽车网站建设开题报告毕业设计做网站怎样做特别一点
  • 网站建设与运营的论文怎么做好营销型网站
  • 皮具网站建设策划书怎样检查wordpress主题是否右后门
  • 婚礼案例网站手机网站 布局
  • 手机网站开发成本国外网站网站app
  • 做做网站app下载2023控制面板网站
  • 做超市商品海报免费海报模版网站清远网站制作
  • 惠州外包网站建设网站制作软件dw的全称
  • wordpress站点地图优化新媒体运营
  • 个人网站建设教程pdf网站建设怎么问问题
  • 销售网站有哪些建设银行网站信息补充
  • 中国空间站研究项目wordpress 三栏怎么弄
  • 如何制作一个自己的网站?wordpress图片优化加速
  • 灵宝网站制作工作室高端网站建设谷美
  • 做网站在线支付系统多少钱别人的wordpress打开很快
  • 西安商城网站建设制作做旅游视频网站
  • 做ppt用的音效网站网站运营建设
  • 重庆巴南区网站开发河北省承德市建设局网站上不去
  • 私募基金网站怎么做seo更改wordpress菜单字体大小