Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Gst;
- namespace MeeGst
- {
- static PadTemplate src_template;
- static PadTemplate sink_template;
- static void init_template(){
- src_template = new PadTemplate("src",PadDirection.SRC,PadPresence.ALWAYS,new Caps.any ());
- sink_template = new PadTemplate("sink",PadDirection.SINK,PadPresence.ALWAYS,new Caps.any ());
- }
- public class MyFilter : Element
- {
- public MyFilter(){
- }
- public signal void test_changed(string value);
- construct {
- init_template();
- set_static_metadata ("MyFilter","ugly","my first plugin","Bibi");
- add_pad_template (src_template);
- add_pad_template (sink_template);
- sinkpad = new Pad.from_template (sink_template, "sink");
- srcpad = new Pad.from_template (src_template, "src");
- notify.connect(spec => {
- if(spec.name == "test"){
- test_changed(test);
- }
- });
- }
- public string test { get; set; }
- public Pad sinkpad;
- public Pad srcpad;
- }
- static bool myfilter_init (Gst.Plugin plugin){
- return Gst.Element.register (plugin, "myfilter", 0, typeof(MyFilter));
- }
- public static bool init(string[] args){
- Gst.init (ref args);
- return Plugin.register_static (1,0,"myfilter","Custom filter",myfilter_init,"0.1","LGPL","GStreamer","MeeGst","http://gstreamer.net/");
- }
- }
- /***/
- using MeeGst;
- void main(string[] args){
- init(args);
- var filter = Gst.ElementFactory.make("myfilter","filter");
- filter["test"] = "value";
- }
- /**
- * (main:12967): GStreamer-WARNING **: Element factory metadata for 'myfilter' has no valid long-name field
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement