using media-configure signal to find GstElement object

Howling wong watertreader at
Fri Mar 11 00:42:46 UTC 2022


I have used  example (test-onvif-server.c) in gst-rtsp-server library and modify additional codes(basically copying out the onvif related codes, make a copy, rename their class and modify them). Mainly for the code to be able to handle seeking for replay of files

I have logged down the pipe line structure while calling media-configure signal.

I tried to access the filesrc elements with code below

media_configure_callback (GstRTSPMediaFactory * factory,
              GstRTSPMedia * media,
                       gpointer user_data)
    g_print("Media Configure Signal Asserted");

    // Construct a custom media to retrieve the app pipeline
    GstElement* pipeline = gst_rtsp_media_get_element (media);
    GstElement* bin1     =  gst_bin_get_by_name(GST_BIN (pipeline), "replaybin0");
    GstElement* usrc     = gst_bin_get_by_name_recurse_up (GST_BIN (bin1), "filesrc0");

    /// temporary hard coding the file location
    g_object_set(G_OBJECT (usrc), "location", "/media/SD/video/20220304_124332_124612.mp4",NULL);
    gst_object_unref (usrc);
    gst_object_unref (pipeline);


To my surprise, gst_bin_get_by_name() could not locate "replaybin0". However the function could locate "pay0". I have tried the other media-constructed signal. The result is similar.

Replaybin is a child of GstBin ( G_DECLARE_FINAL_TYPE (ReplayBin, replay_bin, REPLAY, BIN, GstBin ). I am not particular good at OOP, especially in C. Shouldn't Replaybin inherit methods from GstBin?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list