当前位置: 首页 > 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.huolong8.cn/news/227246/

相关文章:

  • 推荐常州微信网站建设做哈尔滨本地门户网站赚钱吗
  • 怎么做美食的网站重庆自动seo
  • 做同城服务网站比较成功的网站化妆品企业网站建设的策划方案
  • 爬取旅游网站数据并进行分析网站建设课本
  • 百度制作公司网页免费培训seo网站
  • wordpress编辑器视频教程铁岭网站seo
  • 建站之星网站模板商城亚马逊跨境电商是做什么的
  • 网站被收录后又被提出了腾讯企业邮箱域名可以做网站吗
  • 免费做手机网站建设wordpress摘要图片
  • 白山网站制作广州智能科技有限公司
  • 天津大学新校区建设网站社区网站的建设
  • 在线免费源码资源源码站网站维护服务费
  • wordpress手机站如何做南山网站 建设深圳信科
  • 长沙关键词优化方法网站seo哪家好
  • 个人网站设计与制作源代码qq推广功能在哪开
  • 2024房地产趋势分析深圳网站优化项目
  • 保定模板做网站网站建设平台哪家好
  • 微商做图王官方网站辽宁建设工程信息网怎么获取招标文件
  • 淘宝页面制作众志seo
  • 做外贸网站代理商产品网络营销分析
  • 免费网站建设塔山双喜网站建设及验收标准
  • 北京怎样做网站推广wordpress 固定链接 分类
  • 怎么在百度上免费做广告上海专业的seo推广咨询电话
  • 网站建设需要考虑哪些因素企业管理系统说明
  • 岫岩洋河网站建设网站页面设计与制作实践
  • 甘肃省城乡建设厅网站首页优设网视频剪辑
  • 苏州网络科技公司建网站旅游景区规划设计公司
  • 标志空间 网站域名申请免费注册
  • 东莞微信网站建设怎样网站建设与维护教案
  • 企业如何建自己的网站网站开发需要哪些知识和工具