/*
* GStreamer
* Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* Copyright (C) YEAR AUTHOR_NAME AUTHOR_EMAIL
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Alternatively, the contents of this file may be used under the
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* which case the following provisions apply instead of the ones
* mentioned above:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION:element-plugin
*
* FIXME:Describe plugin here.
*
* <refsect2>
* <title>Example launch line</title>
* |[
* gst-launch -v -m fakesrc ! plugin ! fakesink silent=TRUE
* ]|
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gst/gst.h>
#include "gstplugin.h"
GST_DEBUG_CATEGORY_STATIC (gst_plugin_template_debug);
#define GST_CAT_DEFAULT gst_plugin_template_debug
/* Filter signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_SILENT
};
/* the capabilities of the inputs and outputs.
*
* describe the real formats here.
*/
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("ANY")
);
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("ANY")
);
GST_BOILERPLATE (GstPluginTemplate, gst_plugin_template, GstElement,
GST_TYPE_ELEMENT);
static void gst_plugin_template_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_plugin_template_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static gboolean gst_plugin_template_set_caps (GstPad * pad, GstCaps * caps);
static GstFlowReturn gst_plugin_template_chain (GstPad * pad, GstBuffer * buf);
/* GObject vmethod implementations */
static void
gst_plugin_template_base_init (gpointer gclass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass);
gst_element_class_set_details_simple(element_class,
"Plugin",
"FIXME:Generic",
"FIXME:Generic Template Element",
"AUTHOR_NAME AUTHOR_EMAIL");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_factory));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory));
}
/* initialize the plugin's class */
static void
gst_plugin_template_class_init (GstPluginTemplateClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
gobject_class->set_property = gst_plugin_template_set_property;
gobject_class->get_property = gst_plugin_template_get_property;
g_object_class_install_property (gobject_class, PROP_SILENT,
g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
FALSE, G_PARAM_READWRITE));
}
/* initialize the new element
* instantiate pads and add them to element
* set pad calback functions
* initialize instance structure
*/
static void
gst_plugin_template_init (GstPluginTemplate * filter,
GstPluginTemplateClass * gclass)
{
filter->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
gst_pad_set_setcaps_function (filter->sinkpad,
GST_DEBUG_FUNCPTR(gst_plugin_template_set_caps));
gst_pad_set_getcaps_function (filter->sinkpad,
GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));
gst_pad_set_chain_function (filter->sinkpad,
GST_DEBUG_FUNCPTR(gst_plugin_template_chain));
filter->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
gst_pad_set_getcaps_function (filter->srcpad,
GST_DEBUG_FUNCPTR(gst_pad_proxy_getcaps));
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
filter->silent = FALSE;
}
static void
gst_plugin_template_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstPluginTemplate *filter = GST_PLUGIN_TEMPLATE (object);
switch (prop_id) {
case PROP_SILENT:
filter->silent = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_plugin_template_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstPluginTemplate *filter = GST_PLUGIN_TEMPLATE (object);
switch (prop_id) {
case PROP_SILENT:
g_value_set_boolean (value, filter->silent);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/* GstElement vmethod implementations */
/* this function handles the link with other elements */
static gboolean
gst_plugin_template_set_caps (GstPad * pad, GstCaps * caps)
{
GstPluginTemplate *filter;
GstPad *otherpad;
filter = GST_PLUGIN_TEMPLATE (gst_pad_get_parent (pad));
otherpad = (pad == filter->srcpad) ? filter->sinkpad : filter->srcpad;
gst_object_unref (filter);
return gst_pad_set_caps (otherpad, caps);
}
/* chain function
* this function does the actual processing
*/
static GstFlowReturn
gst_plugin_template_chain (GstPad * pad, GstBuffer * buf)
{
GstPluginTemplate *filter;
filter = GST_PLUGIN_TEMPLATE (GST_OBJECT_PARENT (pad));
if (filter->silent == FALSE)
g_print ("I'm plugged, therefore I'm in.\n");
/* just push out the incoming buffer without touching it */
return gst_pad_push (filter->srcpad, buf);
}
/* entry point to initialize the plug-in
* initialize the plug-in itself
* register the element factories and other features
*/
static gboolean
plugin_init (GstPlugin * plugin)
{
/* debug category for fltering log messages
*
* exchange the string 'Template plugin' with your description
*/
GST_DEBUG_CATEGORY_INIT (gst_plugin_template_debug, "plugin",
0, "Template plugin");
return gst_element_register (plugin, "plugin", GST_RANK_NONE,
GST_TYPE_PLUGIN_TEMPLATE);
}
/* gstreamer looks for th
没有合适的资源?快使用搜索试试~ 我知道了~
gst-template gstreamer插件模板
5星 · 超过95%的资源 需积分: 9 104 下载量 142 浏览量
2009-07-09
14:40:54
上传
评论
收藏 33KB GZ 举报
温馨提示
共38个文件
am:5个
c:5个
sh:4个
开发gstreamer插件的参照模板,提高gstreamer插件的开发速度
资源推荐
资源详情
资源评论
收起资源包目录
gst-template.tar.gz (38个子文件)
gst-template-d72e16c63b39728ffc1f96251d6953ffd99abff5
.gitmodules 104B
COPYING.MIT 1023B
gst-plugin
tools
make_element 2KB
m4
as-version.m4 2KB
as-compiler-flag.m4 435B
Makefile.am 47B
autogen.sh 3KB
Makefile.am 57B
src
gstaudiofilter.c 8KB
gstplugin.c 8KB
gsttransform.c 6KB
Makefile.am 1KB
gstplugin.h 3KB
gsttransform.h 2KB
README 1KB
AUTHORS 46B
.gitignore 102B
gst-autogen.sh 9KB
NEWS 18B
ChangeLog 6KB
COPYING 27B
configure.ac 4KB
COPYING.LIB 25KB
README 832B
common
gst-app
autogen.sh 3KB
Makefile.am 58B
src
main.c 4KB
Makefile.am 461B
play.h 2KB
gst-app.h 2KB
play.c 6KB
README 665B
AUTHORS 46B
gst-autogen.sh 9KB
NEWS 18B
ChangeLog 1KB
COPYING 27B
configure.ac 4KB
共 38 条
- 1
dyzhu
- 粉丝: 3
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 青岛大学人工智能实验二 利用α-β搜索的博弈树算法编写一字棋游戏
- ### 1、项目介绍 本项目Scrapy进行数据爬取,并使用Django框架+PyEcharts实现可视化大屏 效果如下:
- # 微信小程序-健康菜谱 基于微信小程序的一个查找检索菜谱的应用 ### 效果 !动态图(./res/gif/demo
- zabbix-get命令包资源
- 289ssm-mysql-jsp 计算机课程实验管理系统.zip(可运行源码+数据库文件+文档)
- 毕业设计,基于PyQt5实现的可视化界面的Python车牌自动识别系统源码
- 20-天天果园项目.rar
- 26-朴素贝叶斯分类.rar
- 没有安Matlab 也可以 生成FIR抽头系数工具.py
- 自助购药小程序源代码含文档
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页