Unable to get GstClock from GstElement

svenyonson steve at svenyonson.com
Thu Feb 12 10:13:04 PST 2015


I am trying to port the sample python code from noraisin.net (synchronized
playback across machines) to Android devices. I have the tutorial 5 working,
and am now trying to integrate the relevant pieces from the python code:

    // Create our own GLib Main Context and make it the default one
    data->context = g_main_context_new ();
    g_main_context_push_thread_default(data->context);

    // Build pipeline
    data->pipeline = gst_parse_launch("playbin", &error);
    if (error) {
        gchar *message = g_strdup_printf("Unable to build pipeline: %s",
error->message);
        g_clear_error (&error);
        set_ui_message(message, data);
        g_free (message);
        return NULL;
    }

    GstPipeline* pipeline = GST_PIPELINE_CAST(data->pipeline);
    GstElement* element = data->pipeline;

    gchar* uri = "http://docs.gstreamer.com/media/sintel_trailer-368p.ogv";

    g_object_set(data->pipeline, "uri", uri, NULL);

    // Set the pipeline to READY, so it can already accept a window handle,
if we have one
    data->target_state = GST_STATE_READY;
    gst_element_set_state(data->pipeline, GST_STATE_READY);

    // Add sync stuff from tutorial
    GstClock* clock = gst_element_get_clock(data->pipeline);

    GST_DEBUG ("gst_element_get_clock... (GstClock:%p)", clock);

When I run this code, clock is 0x0.





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Unable-to-get-GstClock-from-GstElement-tp4670705.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list