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

江西建设厅网站官网爱客影院wordpress

江西建设厅网站官网,爱客影院wordpress,公司网站制作教学,智能建站实验报告The chain function 链函数是所有数据处理都在其中进行的函数。在简单过滤器的情况下#xff08;本节示例的情况#xff09;#xff0c;_chain()函数大多是线性函数——因此对于每个传入的缓冲区#xff0c;也将输出一个缓冲区。下面是一个非常简单的chain函数的实现: sta…The chain function 链函数是所有数据处理都在其中进行的函数。在简单过滤器的情况下本节示例的情况_chain()函数大多是线性函数——因此对于每个传入的缓冲区也将输出一个缓冲区。下面是一个非常简单的chain函数的实现: static GstFlowReturn gst_my_filter_chain (GstPad *pad,GstObject *parent,GstBuffer *buf);[..]static void gst_my_filter_init (GstMyFilter * filter) { [..]/* configure chain function on the pad before adding* the pad to the element */gst_pad_set_chain_function (filter-sinkpad,gst_my_filter_chain); [..] }static GstFlowReturn gst_my_filter_chain (GstPad *pad,GstObject *parent,GstBuffer *buf) {GstMyFilter *filter GST_MY_FILTER (parent);if (!filter-silent)g_print (Have data of size % G_GSIZE_FORMAT bytes!\n,gst_buffer_get_size (buf));return gst_pad_push (filter-srcpad, buf); } 显然上面的代码没什么用。你通常会在那里处理数据而不是打印出数据所在的位置。但请记住缓冲区并不总是可写的。 在更高级的元素(进行事件处理的元素)中你可能需要另外指定一个事件处理函数在发送流事件时调用该函数(如caps、end-of-stream、newsegment、tags等)。 static void gst_my_filter_init (GstMyFilter * filter) { [..]gst_pad_set_event_function (filter-sinkpad,gst_my_filter_sink_event); [..] }static gboolean gst_my_filter_sink_event (GstPad *pad,GstObject *parent,GstEvent *event) {GstMyFilter *filter GST_MY_FILTER (parent);switch (GST_EVENT_TYPE (event)) {case GST_EVENT_CAPS:/* we should handle the format here */break;case GST_EVENT_EOS:/* end-of-stream, we should close down all stream leftovers here */gst_my_filter_stop_processing (filter);break;default:break;}return gst_pad_event_default (pad, parent, event); }static GstFlowReturn gst_my_filter_chain (GstPad *pad,GstObject *parent,GstBuffer *buf) {GstMyFilter *filter GST_MY_FILTER (parent);GstBuffer *outbuf;outbuf gst_my_filter_process_data (filter, buf);gst_buffer_unref (buf);if (!outbuf) {/* something went wrong - signal an error */GST_ELEMENT_ERROR (GST_ELEMENT (filter), STREAM, FAILED, (NULL), (NULL));return GST_FLOW_ERROR;}return gst_pad_push (filter-srcpad, outbuf); } 在某些情况下元素还可以控制输入数据速率。在这种情况下你可能想写一个所谓的基于循环的元素。源元素(只有源source pads)也可以是基于get-based的元素。这些概念将在本指南的高级部分和专门讨论源source pads的部分中进行解释。 The event function event函数会通知你datastream中发生的特殊事件(例如caps、end-of-stream、newsegment、tags等)。事件可以upstream和downstream传递所以你可以通过sink pad和source pad接收它们。 下面是一个非常简单的事件函数我们将其安装在元素的sink pads上。 static gboolean gst_my_filter_sink_event (GstPad *pad,GstObject *parent,GstEvent *event);[..]static void gst_my_filter_init (GstMyFilter * filter) { [..]/* configure event function on the pad before adding* the pad to the element */gst_pad_set_event_function (filter-sinkpad,gst_my_filter_sink_event); [..] }static gboolean gst_my_filter_sink_event (GstPad *pad,GstObject *parent,GstEvent *event) {gboolean ret;GstMyFilter *filter GST_MY_FILTER (parent);switch (GST_EVENT_TYPE (event)) {case GST_EVENT_CAPS:/* we should handle the format here *//* push the event downstream */ret gst_pad_push_event (filter-srcpad, event);break;case GST_EVENT_EOS:/* end-of-stream, we should close down all stream leftovers here */gst_my_filter_stop_processing (filter);ret gst_pad_event_default (pad, parent, event);break;default:/* just call the default handler */ret gst_pad_event_default (pad, parent, event);break;}return ret; } 对于未知事件最好调用默认的事件处理程序gst_pad_event_default()。根据事件类型默认处理程序将转发事件或简单地取消引用它。默认情况下CAPS事件是不转发的因此我们需要在事件处理程序中执行此操作。 The query function 通过query函数元素将收到查询并必须响应查询。这些查询包括位置、持续时间等还包括元素支持的格式和调度模式。查询可以在上游和下游传输所以你可以在sink pad和source pad上接收它们。 下面是我们在元素的source pad上安装的一个非常简单的查询函数。 static gboolean gst_my_filter_src_query (GstPad *pad,GstObject *parent,GstQuery *query);[..]static void gst_my_filter_init (GstMyFilter * filter) { [..]/* configure event function on the pad before adding* the pad to the element */gst_pad_set_query_function (filter-srcpad,gst_my_filter_src_query); [..] }static gboolean gst_my_filter_src_query (GstPad *pad,GstObject *parent,GstQuery *query) {gboolean ret;GstMyFilter *filter GST_MY_FILTER (parent);switch (GST_QUERY_TYPE (query)) {case GST_QUERY_POSITION:/* we should report the current position */[...]break;case GST_QUERY_DURATION:/* we should report the duration here */[...]break;case GST_QUERY_CAPS:/* we should report the supported caps here */[...]break;default:/* just call the default handler */ret gst_pad_query_default (pad, parent, query);break;}return ret; } 对于未知的查询最好调用默认的查询处理程序gst_pad_query_default()。根据查询类型默认处理程序将转发查询或简单地取消引用它。
http://www.dnsts.com.cn/news/226940.html

相关文章:

  • 地方志网站建设自查报告网站搜索引擎优化技术
  • 网站推广优化如何做口红做网站多少钱
  • 网站建设的阶段html5网站布局教程
  • 建设银行网站可以查询存折吗电子商务的网站怎么做
  • 网站没有收录了免费网站加速器
  • iis7 建立网站音乐展示网站建设平台
  • 怎么做网站访问截取ip建设银行360网站登录不了
  • 科汛kesioncms网站系统北京比较大的网站建设公司
  • 中性衣服印花图案设计网站济南做外贸网站
  • 招聘网站怎么做介绍wordpress怎么更改后台路径
  • 建设软件资源网站wordpress门户cms
  • 想自己搭建网站得怎么做私域平台运营分为几个步骤
  • 网站设计制作都有哪些淘宝运营培训视频教程
  • 国内人做韩国网站一般都卖什么东西wordpress文章放视频
  • 建网站手机版招聘软件开发工程师
  • 网站的手机站页面重复深圳互联网公司
  • 南阳做网站多少费用男女一起做暖暖网站
  • 问题反馈的网站怎么做学网站开发推荐书
  • 小型购物网站做网站前台和后台是什么
  • 福州免费做网站和wordpress类似的开源博客
  • 找人做方案的网站新乡网站的建设
  • 网站建设公司工资设置免费网站优化怎么做
  • 有做思维图的网站吗wordpress静态网址
  • 贵阳网站建设方案报价普通话
  • 泰国金木棉做网站网站公司发布网站需要备案
  • 盐城公司做网站网站开发方案及报价
  • 网站建设教程皆赞湖南岚鸿完成网站正在建设中 html 模板
  • 建设网银登录网站购物网站含有哪些模块
  • 网站二级目录怎么做在线妇科免费咨询
  • 专业的网站制作团队开发网上商城公司