ffmpeg 1.0 filter模块AVFilterPad结构的权限属性min_perms/rej_perms分析


2014 10 19
ffmpeg 1.0 filter模块AVFilterPad结构的权限属性min_perms/rej_perms分析:
1.注释翻译
    输入pad:
    输入buffer最小权限要求.
    如果buffer权限不够,则filter系统自动将其copy到一个能提供相应权限的新buffer
    输出pad:
    将要输出的buffer的保护权限.
    任何想要在link上输出的buffer必须具备这些权限.
    这些使用assert来检查的。这可以优化buffer分配。
    /**
     * Input pads:
     * Minimum required permissions on incoming buffers. Any buffer with
     * insufficient permissions will be automatically copied by the filter
     * system to a new buffer which provides the needed access permissions.
     *
     * Output pads:
     * Guaranteed permissions on outgoing buffers. Any buffer pushed on the
     * link must have at least these permissions; this fact is checked by
     * asserts. It can be used to optimize buffer allocation.
     */
    int min_perms;


    输入pad:如果输入buffer有这些权限,则输入pad拒绝。如果buffer有这些拒绝权限,
    则filter系统自动将其copy到一个没有这些权限的新buffer。  
    输出pad:输出buffer自动删除这些拒绝权限。这可以用来优化buffer分配。  
     /**
     * Input pads:
     * Permissions which are not accepted on incoming buffers. Any buffer
     * which has any of these permissions set will be automatically copied
     * by the filter system to a new buffer which does not have those
     * permissions. This can be used to easily disallow buffers with
     * AV_PERM_REUSE.
     *
     * Output pads:
     * Permissions which are automatically removed on outgoing buffers. It
     * can be used to optimize buffer allocation.
     */
    int rej_perms;

2.实现
在video.c文件ff_start_frame函数里实现:

  min_perms[输出]://任何想要在link上输出的buffer必须具备这些权限
    av_assert1((picref->perms & src->min_perms) == src->min_perms);
  rej_perms[输出]://输出buffer自动删除这些拒绝权限
    picref->perms &= ~ src->rej_perms;

 

 

  min_perms[输入]/rej_perms[输入]:

    //min_perms:输入buffer最小权限要求.  如果buffer权限不够,则filter系统自动将其copy到一个能提供相应权限的新buffer

    //min_perms:如果输入buffer有这些权限,则输入pad拒绝。如果buffer有这些拒绝权限,则filter系统自动将其copy到一个没有这些权限的新buffer
    if ((dst->min_perms & perms) != dst->min_perms || dst->rej_perms & perms) {

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值