using media-configure signal to find GstElement object

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


Hi,

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.

https://drive.google.com/file/d/1G-EDrNAoLxuLo51EycDQ5lonkBgkw5tt/view?usp=sharing

I tried to access the filesrc elements with code below

void
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?

Thanks

REgards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220311/0ca98d5c/attachment.htm>


More information about the gstreamer-devel mailing list