short_description:Base class for mixers and muxers, manages a set of input pads and aggregates their streams
这个插件是混合类的基类,用于将多个流混合起来,GstVideoAggregator,flvmux,qtmux都是它的子类。
流的接入与删除用到request_new_pad和release_pad函数,如下是函数的定义。
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_aggregator_request_new_pad);
gstelement_class->release_pad =
GST_DEBUG_FUNCPTR (gst_aggregator_release_pad);
每个pad都会对应chain函数,主要是将buffer放到queue里。
gst_aggregator_pad_chain{
gst_aggregator_pad_chain_internal
{
g_queue_push_tail (&aggpad->priv->data, buffer); //这里会把buffer放到队列里。
aggpad->priv->num_buffers++;
}
}
src pad被激活后,会调用gst_aggregator_start_srcpad_task->gst_aggregator_aggregate_func->klass->aggregate,aggregate需要子类去实现,去做具体的积累任务。
以flv为例:
/* Returns NULL, or a reference to the pad with the
* buffer with lowest running time */
gst_flv_mux_find_best_pad 遍历所有的pad,找最小的运行时间。
未完待续。。。。。。