Linking elements in running state

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Linking elements in running state

Matthias Hardt
Hello,

I'm trying to link elements to streams in an already running pipeline. Now the problem is, that these elements don't have the segments start/stop... times as they didn't receive the NEW_SEGMENT event, which was sent earlier.
Is it possible to have this event sent again?

For now I tried querying the segment from the pads parent element I'm linking to, but unfortunately I don't get the correct times. And the format is GST_FORMAT_BYTES although I requested GST_FORMAT_TIME.

Maybe I'm completely wrong and it can be done another way. Any help would be appreciated.

Here is the code I am using:

/* get segment times from stream pads parent element */
GstElement *el  = gst_pad_get_parent_element(pad);
GstQuery* query = gst_query_new_segment(GST_FORMAT_TIME);
gboolean  ret   = gst_element_query(el, query);
if(ret) {
        GstFormat format;
        gdouble   rate;
        gint64    start, stop;
        gst_query_parse_segment(query, &rate, &format, &start, &stop);
        gst_query_unref(query);

        gint64 position;
        if(!gst_element_query_position(el, &format, &position))
                position = 0;

        gst_pad_push_event (pad, gst_event_new_new_segment (FALSE,
                  rate, format, start, stop, position));
        printf("configured NEWSEGMENT rate %lf, format %d, %"
                        GST_TIME_FORMAT " -- %" GST_TIME_FORMAT ", pos %"
                        GST_TIME_FORMAT "\n", rate, format, GST_TIME_ARGS(start),
                        GST_TIME_ARGS(stop), GST_TIME_ARGS(position));
}
gst_object_unref(el);



Best regards,
Matthias

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel