handle error messages by providing visual feedback to the user

I am trying to provide a visual feedback on the OSD by displaying some message on screen whenever signal is lost or there is EOS. The OSD is a tiled display.
could someone please help me with how to invoke a function when one of the tiled display goes off due to error or EOS?

Refer to test1 ->osd_sink_pad_buffer_probe() :
I am not sure if this func can get EOS event. You can test it.

GstEvent *event = gst_pad_probe_info_get_event(info);
if (GST_EVENT_TYPE(event) == GST_EVENT_EOS) {

}

And then set “display_meta->text_params”