GstCaps filter issue
doon
don-prog at mail.ru
Wed Jul 22 17:57:55 PDT 2015
I trying to create filter using caps:
* GMainLoop *loop;
GstElement *pipeline, *source, *demuxer, *decoder, *typefind, *conv,
*sink;;
GstBus *bus;
guint bus_watch_id;
loop = g_main_loop_new(NULL, FALSE);
pipeline = gst_pipeline_new ("audio-player");
source = gst_element_factory_make ("filesrc", "file-source");
typefind = gst_element_factory_make ("typefind", "typefinder");
demuxer = gst_element_factory_make ("oggdemux", "ogg-demuxer");
decoder = gst_element_factory_make ("vorbisdec", "vorbis-decoder");
conv = gst_element_factory_make ("audioconvert", "converter");
sink = gst_element_factory_make ("autoaudiosink", "audio-output");
if (!pipeline || !source || !demuxer || !decoder || !conv || !sink) {
g_printerr ("Не удалось создать один из элементов конвейера. Работа
приложения завершена.\n");
return -1;
}
g_signal_connect (typefind, "have-type", G_CALLBACK (cb_typefound), loop);
g_object_set(G_OBJECT(source), "location", name_of_file, NULL);
bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));
bus_watch_id = gst_bus_add_watch(bus, bus_call, loop);
gst_object_unref(bus);
gst_bin_add_many(GST_BIN(pipeline), source, typefind, demuxer, decoder,
conv, sink, NULL);
GstCaps *my_caps = gst_caps_new_simple ("audio/x-raw","rate", G_TYPE_INT,
384,NULL);
gboolean test=false;
test = gst_element_link_filtered(source,typefind, my_caps);
test = gst_element_link(typefind, demuxer);
test = gst_element_link_many(decoder, conv,sink, NULL);
g_signal_connect(demuxer, "pad-added", G_CALLBACK(on_pad_added),
decoder);*
But get error:
*Debug: gsttypefindelement.c(1169): gst_type_find_element_loop ():
/GstPipeline:a
udio-player/GstTypeFindElement:typefinder:
stream stopped, reason not-linked*
Var test == 1 after gst_element_link_filtered(source,typefind, my_caps);
test == 0 after gst_element_link(typefind, demuxer);
test == 1 after gst_element_link_many(decoder, conv,sink, NULL);
If I just change gst_element_link_filtered on gst_element_link all going ok
and file plays.
What am I doing wrong?
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/GstCaps-filter-issue-tp4672796.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list