1 2 | GstElementFactory *factory; factory = gst_element_factory_find ("mad"); |
1 2 | GstElement *element; element = gst_element_factory_create (factory, "decoder"); |
1 | gst_element_unref (element); |
1 2 | GstPad *srcpad; srcpad = gst_element_get_pad (element, "src"); |
1 2 3 4 5 6 7 | GList *pads; pads = gst_element_get_pad_list (element); while (pads) { GstPad *pad = GST_PAD (pads->data); g_print ("pad name is: %s\n", gst_pad_get_name (pad)); pads = g_list_next (pads); } |
1 2 3 4 5 6 7 | struct _GstCaps { gchar *name; /* the name of this caps */ guint16 id; /* type id (major type) */ guint refcount; /* caps are refcounted */ GstProps *properties; /* properties for this capability */ GstCaps *next; /* caps can be chained together */ }; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | Pads: SINK template: ’sink’ Availability: Always Capabilities: ’mad_sink’: MIME type: ’audio/mp3’: SRC template: ’src’ Availability: Always Capabilities: ’mad_src’: MIME type: ’audio/raw’: format: String: int endianness: Integer: 1234 width: Integer: 16 depth: Integer: 16 channels: Integer range: 1 - 2 law: Integer: 0 signed: Boolean: TRUE rate: Integer range: 11025 - 48000 |
1 2 3 4 5 6 7 8 9 | GstCaps *caps; caps = gst_pad_get_caps (pad); g_print ("pad name is: %s\n", gst_pad_get_name (pad)); while (caps) { g_print (" Capability name is %s, MIME type is %s\n", gst_caps_get_name (cap), gst_caps_get_mime (cap)); caps = caps->next; } |
1 2 3 4 5 | GstElement *thread, *pipeline; // 创建线程对象,同时为其指定唯一的名称。 thread = gst_element_factory_make ("thread", NULL); // 根据给出的名称,创建一个特定的管道对象。 pipeline = gst_pipeline_new ("pipeline_name"); |
1 2 3 4 5 | GstElement *element; GstElement *bin; bin = gst_bin_new ("bin_name"); element = gst_element_factory_make ("mpg123", "decoder"); gst_bin_add (GST_BIN (bin), element); |
1 2 | GstElement *element; element = gst_bin_get_by_name (GST_BIN (bin), "decoder"); |
1 2 | GstElement *element; gst_bin_remove (GST_BIN (bin), element); |
1 2 3 4 5 6 | GstElement *bin; GstElement *element; element = gst_element_factory_create ("mad", "decoder"); bin = gst_bin_new ("bin_name"); gst_bin_add (GST_BIN (bin), element); gst_element_add_ghost_pad (bin, gst_element_get_pad (element, "sink"), "sink"); |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |