Hi, I have problem with clutter1.0.6 behaviours and
gstreamer-gnonlinear-plugin. I think I'm using gnonlinear proper way (Who can confirm this?), because it works. If I add clutter and clutter_actor it still works. When I add clutter_behaviour, application doesn't work anymore. Application: I'm playing two different length wav-clip starting on same time. Expected: Shorter ends and another continues playing. What happens: When shorter ends, there are silence moment (cap). Sometimes it is short, sometimes long, and sometimes there are many caps. If I'm using alsasink, there are no message, with pulsesink I got this: pulse pulsesink.c:523:gst_pulsering_stream_underflow_cb:<sink-actual-sink-pulse> Got underflow (This message comes even when it works.) And as I said application works if I disable all clutter_behaviours. Therefor I first thought it was fault of clutter, but after rethinking I decided post it to here too. Any advice is welcome. (Do this happens to you? Is this clutter's fault? Is this gstreamer's fault? Is this gnonlinear's fault?) I made simple application which triggers this bug and it is easy to reproduce, you can download it from here (1.6M): http://cc.oulu.fi/~rantalai/clutter_gnonlin_bug.tar.gz You need libclutter-1.0-dev and libgstreamer0.10-dev to compile it and gstreamer0.10-gnonlin to run it. make ./works.sh /trigger_bug.sh -Aapo Rantalainen And the application: #include <gst/gst.h> #include <glib.h> #include <stdbool.h> #include <clutter/clutter.h> // Variables GstElement *conv1, *conv2; GstPad *audiopad; GstBus *bus; GMainLoop *loop; GstFormat fmt; gint64 pos, len; GstElement *pipeline; static gboolean my_bus_callback (GstBus *bus, GstMessage *msg, gpointer data) { switch (GST_MESSAGE_TYPE (msg)) { case GST_MESSAGE_EOS: g_print ("\nEnd of stream\n"); break; case GST_MESSAGE_ERROR: { gchar *debug; GError *error; gst_message_parse_error (msg, &error, &debug); g_free (debug); g_printerr ("Error: %s\n", error->message); g_error_free (error); break; } default: break; } return TRUE; } static void gnl_OnNewPad(GstElement *elem, GstPad *pad, gpointer data) { GstPad *convsink; convsink = gst_element_get_compatible_pad(conv1, pad, gst_pad_get_caps(pad)); if(convsink) printf("Compatible pad found...\n"); else printf("Compatible pad not found!\n"); gst_pad_link(pad, convsink); if(GST_PAD_LINK_SUCCESSFUL(GST_PAD_LINK_OK)) printf("Linking successfully completed\n"); printf("Element name: %s\n", gst_element_get_name(elem)); gst_object_unref(convsink); } static void gnl_OnNewPad2(GstElement *elem, GstPad *pad, gpointer data) { GstPad *convsink; convsink = gst_element_get_compatible_pad(conv2, pad, gst_pad_get_caps(pad)); if(convsink) printf("Compatible pad found...\n"); else printf("Compatible pad not found!\n"); gst_pad_link(pad, convsink); if(GST_PAD_LINK_SUCCESSFUL(GST_PAD_LINK_OK)) printf("Linking successfully completed\n"); printf("Element name: %s\n", gst_element_get_name(elem)); gst_object_unref(convsink); } gint player_init (gchar *location1, gchar *location2) { GstElement *dec, *track1, *track2, *adder, *audio1, *audio1_2, *audio2, *sink; gst_init (NULL, NULL); /* setup */ pipeline = gst_pipeline_new ("pipeline"); bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_add_watch (bus, my_bus_callback, NULL); gst_object_unref (bus); /* track 1 */ track1 = gst_element_factory_make("gnlcomposition", "track1"); gst_bin_add(GST_BIN (pipeline), track1); g_signal_connect (track1, "pad-added", G_CALLBACK (gnl_OnNewPad), NULL); /* add audio file to composition / track 1 */ audio1_2 = gst_element_factory_make("gnlfilesource", "audio1_2"); gst_bin_add(GST_BIN (track1), audio1_2); g_object_set(G_OBJECT (audio1_2), "location", location1, NULL); g_object_set(G_OBJECT (audio1_2), "start", 2 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio1_2), "duration", 5 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio1_2), "media-start", 0 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio1_2), "media-duration", 30 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio1_2), "priority", 0, NULL); /* track 2 */ track2 = gst_element_factory_make("gnlcomposition", "track2"); gst_bin_add(GST_BIN (pipeline), track2); g_signal_connect (track2, "pad-added", G_CALLBACK (gnl_OnNewPad2), NULL); /* add audio file to composition / track 2 */ audio2 = gst_element_factory_make("gnlfilesource", "audio2"); gst_bin_add(GST_BIN (track2), audio2); g_object_set(G_OBJECT (audio2), "location", location2, NULL); g_object_set(G_OBJECT (audio2), "start", 2 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio2), "duration", 6 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio2), "media-start", 0 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio2), "media-duration", 50 * GST_SECOND, NULL); g_object_set(G_OBJECT (audio2), "priority", 0, NULL); conv1 = gst_element_factory_make("audioconvert", "conv1"); conv2 = gst_element_factory_make("audioconvert", "conv2"); adder = gst_element_factory_make("adder", "adder"); if(!adder) printf("Couldn't create adder element!"); sink = gst_element_factory_make("autoaudiosink", "sink"); /* add elements to pipeline */ gst_bin_add_many(GST_BIN(pipeline), conv1, conv2, adder, sink, NULL); /* adder combines multiple channels (in our case tracks) to single output */ gst_element_link(conv1, adder); gst_element_link(conv2, adder); gst_element_link(adder, sink); return 0; } int main (int argc, char *argv[]) { if (argc<3) { printf("Usage: give 1.wav 2.wav [trigger_bug]\n"); printf("last parameter can be anything\n"); exit(0); } g_thread_init(NULL); clutter_init (&argc, &argv); clutter_threads_init(); GMainLoop *loop= g_main_loop_new (NULL, FALSE); ClutterActor *stage; ClutterActor *actor; stage = clutter_stage_get_default (); actor = clutter_texture_new_from_file("forest.png", NULL); clutter_container_add_actor(CLUTTER_CONTAINER(stage), actor); clutter_actor_set_position (actor, 150, 150); /////////////////////////////////////////// /* Make a timeline */ ClutterTimeline *timeline; ClutterBehaviour *behave; ClutterAlpha *behaviours_alpha; timeline = clutter_timeline_new (2000); g_object_set(timeline, "loop", TRUE, NULL); behaviours_alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); behave = clutter_behaviour_rotate_new (behaviours_alpha, CLUTTER_X_AXIS, CLUTTER_ROTATE_CW, 0.0, 360.0); clutter_behaviour_apply (behave, actor); if (argc==4) clutter_timeline_start (timeline); /////////////////////////////////////////// clutter_actor_show_all(stage); player_init(argv[1],argv[2]); gst_element_set_state(pipeline, GST_STATE_PLAYING); //g_main_loop_run (loop); clutter_main(); return 0; } ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Administrator
|
On Fri, 2009-11-13 at 15:20 +0200, Aapo Rantalainen wrote:
> /* add audio file to composition / track 1 */ > audio1_2 = gst_element_factory_make("gnlfilesource", "audio1_2"); > gst_bin_add(GST_BIN (track1), audio1_2); > g_object_set(G_OBJECT (audio1_2), "location", location1, NULL); > g_object_set(G_OBJECT (audio1_2), "start", 2 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio1_2), "duration", 5 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio1_2), "media-start", 0 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio1_2), "media-duration", 30 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio1_2), "priority", 0, NULL); You are playing 30s of media in 5s (i.e. the file will be played back 6 times faster). > > > /* track 2 */ > track2 = gst_element_factory_make("gnlcomposition", "track2"); > gst_bin_add(GST_BIN (pipeline), track2); > g_signal_connect (track2, "pad-added", G_CALLBACK (gnl_OnNewPad2), NULL); > > /* add audio file to composition / track 2 */ > audio2 = gst_element_factory_make("gnlfilesource", "audio2"); > gst_bin_add(GST_BIN (track2), audio2); > g_object_set(G_OBJECT (audio2), "location", location2, NULL); > g_object_set(G_OBJECT (audio2), "start", 2 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio2), "duration", 6 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio2), "media-start", 0 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio2), "media-duration", 50 * GST_SECOND, NULL); > g_object_set(G_OBJECT (audio2), "priority", 0, NULL); You are playing 50s of media in 6s (i.e. the file will be played back 50/6 times faster). In addition to that, no sound will be outputted for the first 2s (since your start values are 2 * GST_SECOND). You might want to debug your aplication by first using: 'start' to 0 'media-duration' and 'duration' to the same values (resulting in regular playback speed) Edward > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hi, thanks for reply. I see I have values duration 5s and
media-duration 30s, but it is still played regular speed. I changed them, but it doesn't affect anything. And even I change start times of first clip to 100s and second clip to 1000s they starts still same time and straight I start program. So looks like I'm using gnonlin wrongly. I'm ready to throw this solution away, I just need use gnonlin and clutter together. -Aapo Rantalainen 2009/11/13 Edward Hervey <[hidden email]>: > On Fri, 2009-11-13 at 15:20 +0200, Aapo Rantalainen wrote: > >> /* add audio file to composition / track 1 */ >> audio1_2 = gst_element_factory_make("gnlfilesource", "audio1_2"); >> gst_bin_add(GST_BIN (track1), audio1_2); >> g_object_set(G_OBJECT (audio1_2), "location", location1, NULL); >> g_object_set(G_OBJECT (audio1_2), "start", 2 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio1_2), "duration", 5 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio1_2), "media-start", 0 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio1_2), "media-duration", 30 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio1_2), "priority", 0, NULL); > > You are playing 30s of media in 5s (i.e. the file will be played back > 6 times faster). > >> >> >> /* track 2 */ >> track2 = gst_element_factory_make("gnlcomposition", "track2"); >> gst_bin_add(GST_BIN (pipeline), track2); >> g_signal_connect (track2, "pad-added", G_CALLBACK (gnl_OnNewPad2), NULL); >> >> /* add audio file to composition / track 2 */ >> audio2 = gst_element_factory_make("gnlfilesource", "audio2"); >> gst_bin_add(GST_BIN (track2), audio2); >> g_object_set(G_OBJECT (audio2), "location", location2, NULL); >> g_object_set(G_OBJECT (audio2), "start", 2 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio2), "duration", 6 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio2), "media-start", 0 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio2), "media-duration", 50 * GST_SECOND, NULL); >> g_object_set(G_OBJECT (audio2), "priority", 0, NULL); > > You are playing 50s of media in 6s (i.e. the file will be played back > 50/6 times faster). > > > In addition to that, no sound will be outputted for the first 2s > (since your start values are 2 * GST_SECOND). > > You might want to debug your aplication by first using: > 'start' to 0 > 'media-duration' and 'duration' to the same values (resulting in > regular playback speed) > > Edward ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hi, I added silence to tracks and now I got starting time working (is
this stupid workaround or it is meant to used this way?). Still different 'duration' and 'media-duration' doesn't change playback speed (I'm not interesting speeding playback, just thinking do this works like expected). Am I right that glncomposition plays only one gnlfilesource at a time (which has the highest priority)? So in this example-application when I try play two wavs together (same time) I need two gnlfilesource and one adder-element? I got code cleaner and updated it: http://cc.oulu.fi/~rantalai/clutter_gnonlin_bug.tar.gz Can somebody confirm this bug? And I repeat my fundamental problem: this code works if there are no any clutter_behaviours in use, but sound playback will broke if there are clutter_behaviour. Is there any simple gnonlin example? (HelloGnonlin.c?) -Aapo Rantalainen ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |