FFmpeg之AVFilterPad

news/2024/7/10 20:54:50 标签: ffmpeg

AVFilterPad起一个输入和输出接口的作用

结构体


/**
 * A filter pad used for either input or output.
 */
struct AVFilterPad {
    /**
     * Pad name. The name is unique among inputs and among outputs, but an
     * input may have the same name as an output. This may be NULL if this
     * pad has no need to ever be referenced by name.
     */
    const char *name;

    /**
     * AVFilterPad type.
     */
    enum AVMediaType type;

    /**
     * The filter expects writable frames from its input link,
     * duplicating data buffers if needed.
     *
     * input pads only.
     */
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE                  (1 << 0)

    /**
     * The pad's name is allocated and should be freed generically.
     */
#define AVFILTERPAD_FLAG_FREE_NAME                       (1 << 1)

    /**
     * A combination of AVFILTERPAD_FLAG_* flags.
     */
    int flags;

    /**
     * Callback functions to get a video/audio buffers. If NULL,
     * the filter system will use ff_default_get_video_buffer() for video
     * and ff_default_get_audio_buffer() for audio.
     *
     * The state of the union is determined by type.
     *
     * Input pads only.
     */
    union {
        AVFrame *(*video)(AVFilterLink *link, int w, int h);
        AVFrame *(*audio)(AVFilterLink *link, int nb_samples);
    } get_buffer;

    /**
     * Filtering callback. This is where a filter receives a frame with
     * audio/video data and should do its processing.
     *
     * Input pads only.
     *
     * @return >= 0 on success, a negative AVERROR on error. This function
     * must ensure that frame is properly unreferenced on error if it
     * hasn't been passed on to another filter.
     */
    int (*filter_frame)(AVFilterLink *link, AVFrame *frame);

    /**
     * Frame request callback. A call to this should result in some progress
     * towards producing output over the given link. This should return zero
     * on success, and another value on error.
     *
     * Output pads only.
     */
    int (*request_frame)(AVFilterLink *link);

    /**
     * Link configuration callback.
     *
     * For output pads, this should set the link properties such as
     * width/height. This should NOT set the format property - that is
     * negotiated between filters by the filter system using the
     * query_formats() callback before this function is called.
     *
     * For input pads, this should check the properties of the link, and update
     * the filter's internal state as necessary.
     *
     * For both input and output filters, this should return zero on success,
     * and another value on error.
     */
    int (*config_props)(AVFilterLink *link);
};

函数


/**
 * Get the name of an AVFilterPad.
 *
 * @param pads an array of AVFilterPads
 * @param pad_idx index of the pad in the array; it is the caller's
 *                responsibility to ensure the index is valid
 *
 * @return name of the pad_idx'th pad in pads
 */
const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx);

/**
 * Get the type of an AVFilterPad.
 *
 * @param pads an array of AVFilterPads
 * @param pad_idx index of the pad in the array; it is the caller's
 *                responsibility to ensure the index is valid
 *
 * @return type of the pad_idx'th pad in pads
 */
enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx);
/**
 * Append a new input/output pad to the filter's list of such pads.
 *
 * The *_free_name versions will set the AVFILTERPAD_FLAG_FREE_NAME flag
 * ensuring that the name will be freed generically (even on insertion error).
 */
int ff_append_inpad (AVFilterContext *f, AVFilterPad *p);
int ff_append_outpad(AVFilterContext *f, AVFilterPad *p);
int ff_append_inpad_free_name (AVFilterContext *f, AVFilterPad *p);
int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p);

http://www.niftyadmin.cn/n/5258864.html

相关文章

JAVA IO:NIO

1.阻塞 IO 模型 ​ 最传统的一种 IO 模型&#xff0c;即在读写数据过程中会发生阻塞现象。当用户线程发出 IO 请求之后&#xff0c;内核会去查看数据是否就绪&#xff0c;如果没有就绪就会等待数据就绪&#xff0c;而用户线程就会处于阻塞状态&#xff0c;用户线程交出 CPU。当…

【计算机视觉】Harris角点检测

角点指的是窗口延任意方向移动&#xff0c;都有很大变化量的点。 用数学公式表示为&#xff1a; 这个公式表示移动后的窗口&#xff0c;与移动前的窗口对应元素相减的平方&#xff0c;为每个像素点的权重 反映了如何移动窗口&#xff0c;以及移动窗口后的响应值 为了让 和 直…

解决设备备品备件管理问题,易点易动来帮忙!

设备备品备件管理是企业运营中一个重要但常常被忽视的环节。许多企业面临以下问题&#xff1a; 备件信息不明确&#xff0c;难以及时获取所需备件&#xff1b; 1&#xff09;备件库存管理混乱&#xff0c;导致过多或过少的备件存储&#xff1b; 2&#xff09;备件使用记录不完…

【数据结构(九)】二叉树基础(1)

文章目录 1. 数组、链表、树的存储方式分析1.1. 数组的存储方式1.2. 链式存储方式1.3. 树的存储方式 2. 树的相关概念2.1. 树的常用术语2.2. 二叉树的概念 3. 二叉树遍历3.1. 思路分析3.1.1. 代码实现3.2. 问题拓展 4. 二叉树查找指定节点4.1. 思路分析4.2. 代码实现 5. 二叉树…

官宣 | HelpLook已入驻企业微信应用市场

HelpLook正式入驻企业微信第三方应用市场。 HelpLook支持自定义域名与AI站内搜索&#xff0c;能够帮助企业微信用户搭建所见即所得的企业知识库、产品帮助中心、用户手册、企业博客。 | 怎么找到HelpLook并开始使用 在企业微信的第三方应用就可直接搜索HelpLook&#xff0c;添…

对话订阅蜂创始人毛炜:科学定价在TO B营销领域的价值被大大低估

“ 营销4P理论里面唯一被忽视的是价格 ” 整理 | 梦婕 编辑 | 云舒 出品&#xff5c;极新 随着市场竞争日益激烈&#xff0c;企业需要不断优化自身业务流程以提高效率和降低成本。其中&#xff0c;报价环节作为企业与客户沟通的关键一环&#xff0c;其准确性和时效性直接影…

C语言 字符串操作函数

strncpy() 用于将一个字符串的一部分拷贝到另一个字符串中。 char* strncpy(char* destination, const char* source, size_t num);参数&#xff1a;destination 是目标字符串的指针&#xff0c;表示将要拷贝到的位置source 是源字符串的指针&#xff0c;表示要拷贝的字符串num…

网神 SecGate3600 authManageSet.cgi信息泄露漏洞复现

漏洞概述 网神SecGate 3600 authManageSet.cgi 接口存在敏感信息泄露漏洞&#xff0c;未授权得攻击者可以通过此漏洞获取控制台管理员用户名密码等凭据&#xff0c;可登录控制整个后台&#xff0c;使系统处于极不安全的状态 复现环境 FOFA&#xff1a;body"sec_gate_im…