GstElement *pipeline;
GstElement *src;
GstElement *queue;
- GstElement *caps;
GstElement *sink;
gboolean done;
gshort *buffer;
ge.src=gst_element_factory_make("appsrc", "source");
g_assert(ge.src);
-ge.caps=gst_element_factory_make("capsfilter", "caps");
-g_assert(ge.caps);
-
ge.srccaps=gst_caps_new_simple ("audio/x-raw-int",
"depth", G_TYPE_INT, 16,
"signed", G_TYPE_BOOLEAN, TRUE,
ge.sink=gst_element_factory_make(AUDIO_SINK, "sink");
g_assert(ge.sink);
-g_object_set(ge.caps, "caps", ge.srccaps, NULL);
-
gst_bin_add_many (GST_BIN(ge.pipeline), ge.src, ge.queue, ge.sink, NULL);
if (!gst_element_link_filtered(ge.src, ge.queue, ge.srccaps)) {
- g_warning ("Failed to link elements 1!");
+ g_warning ("Failed to link source to queue with caps.");
return FALSE;
}
+gst_caps_unref(ge.srccaps);
-if (!gst_element_link_filtered(ge.queue, ge.sink, ge.srccaps)) {
- g_warning ("Failed to link elements 2!");
+if (!gst_element_link(ge.queue, ge.sink)) {
+ g_warning ("Failed to link queue to sink.");
return FALSE;
}