GNOME Bugzilla – Bug 788917
rtspsrc: Handling RTSP messages for debugging
Last modified: 2017-11-01 09:38:03 UTC
Hello. I'm an engineer in Tizen TV. I want to print all RTSP messages using specific log module for debugging.(not std out) Rtspsrc supports "debug" property to print all RTSP messages. But I can not use it because it supports only std out using g_print. Is there any way to resolve this ? Please advice to me. Is it possible that rtspsrc supports bellow? 1. Emitting signal about all RTSP messages like "handle-request" signal. - If support, Application can access and print all RTSP messages.
Ideally these should be printed in the GStreamer debug logs instead, that's a bug in GstRTSPConnection if that doesn't happen. Do you want to provide a patch?
Yes, I want to provide a patch. As per your opinion, how about rtspmessage supports to print by the Gstreamer debug log. and rtspsrc supports "print-all-messages" property. If the property is enabled, All RTSP messages are prtined using bellow. GstRTSPResult gst_rtsp_message_print (GstRTSPMessage * msg, GstObject * obj) { /* print rtsp message by gstreamer debug log instead of g_print */ GST_DEBUG_OBJECT(obj, ""); } Please let me know your opinion for this way.
or in the other way, If "debug" property in rtspsrc is enabled, the log is printed additionally like below. if (src->debug) { gst_rtsp_message_dump (&message); gst_rtsp_message_print (&message, src); } Please give me advice about the ways to resolve. Thanks.
I will make a patch below. Because we need to print all messages by our system log module... And I think the property is very useful for debugging. Emitting signal about all RTSP messages like "handle-request" signal. - If support, Application can access and print all RTSP messages.
Created attachment 361910 [details] [review] rtspsrc: Add 'handle-all-messages' signal Please review the patch for emitting signal about all rtsp messages.
Hello Mr. Sebastian Dröge Please let me know your opinion.
It should use the normal GStreamer debugging system instead of printing directly to stdout/stderr, or having yet another special API.
Created attachment 362516 [details] [review] Add an API for RTSP message log.
Created attachment 362517 [details] [review] Add debug logs for RTSP messages.
The new patceh use normal gstreamer debugging system. Please confirm this way is ok or not. In addtion, the application can change log callback function if rtspsrc supports to set property for log_func.
Comment on attachment 362517 [details] [review] Add debug logs for RTSP messages. Please make this work without adding additional API, and replace the current printing to stdout/stderr with that. Thanks!
The rtspsrc already print to stdout/stderr using gst_rtsp_message_dump. Do you mean that replace gst_rtsp_message_dump to gstreamer debug log in rtspsrc ? Sorry, could you know me more detail?
(In reply to Sangkyu Park (sangkyup) from comment #13) > The rtspsrc already print to stdout/stderr using gst_rtsp_message_dump. It should not do that and instead use the GStreamer debugging system > Do you mean that replace gst_rtsp_message_dump to gstreamer debug log in > rtspsrc ? Yes
typedef struct _RTSPKeyValue { GstRTSPHeaderField field; gchar *value; gchar *custom_key; /* custom header string (field is INVALID then) */ } RTSPKeyValue; static void key_value_foreach (GArray * array, GFunc func, gpointer user_data) The above are static declaration in gstrtspmessage.c. But they are needed in rtspsrc when printing key values. Is it possible that changed to global declaration?
Created attachment 362533 [details] [review] Replace to print RTSP message from stdout to gstreamer debug log. Please check the way is ok or not.. Printing key values in header is skipped due to static declaration in gstrtspmessage.c.
Review of attachment 362533 [details] [review]: You could copy/modify the code for printing the headers, it's simple enough ::: gst/rtsp/gstrtspsrc.c @@ +176,1 @@ #define DEBUG_SDP(__self,msg) if (__self->debug) gst_sdp_message_dump (msg) Same problem for the SDP
(In reply to Sebastian Dröge (slomo) from comment #17) > Review of attachment 362533 [details] [review] [review]: > > You could copy/modify the code for printing the headers, it's simple enough But crash issue will be happend if the static declation for RTSPKeyValue in gstrtspmessage.c is chaneged later. > > ::: gst/rtsp/gstrtspsrc.c > @@ +176,1 @@ > #define DEBUG_SDP(__self,msg) if (__self->debug) gst_sdp_message_dump (msg) > > Same problem for the SDP OK, I will change it now. How about is log level changed from debug to info ? Because "debug" property is set to TRUE from user.
Created attachment 362538 [details] [review] Replace to print RTSP/SDP message from stdout to gstreamer log.
Created attachment 362539 [details] Replace to print RTSP/SDP message from stdout to gstreamer log. - Added NULL check. - Changed descreption for debug property.
Created attachment 362540 [details] [review] Replace to print RTSP/SDP message from stdout to gstreamer log. - Added NULL check. - Changed descreption for debug property.
Created attachment 362541 [details] [review] fixed build error.
Created attachment 362542 [details] [review] sorry, updated modification for build error.
Created attachment 362592 [details] [review] Replace to print RTSP/SDP message from stdout to gstreamer log. - Add to print RTSP header keys. This is working fine.
Review of attachment 362592 [details] [review]: Looks mostly good, thanks :) ::: gst/rtsp/gstrtspsrc.c @@ +470,1 @@ DEFAULT_DEBUG, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); Let's deprecate this one now and always add it to the log. TRACE or LOG Check threshold of the category before doing so
Created attachment 362710 [details] [review] Replace to print RTSP/SDP message from stdout to gstreamer Replace to print RTSP/SDP message from stdout to gstreamer log. - 'debug' property is deprecated - All RTSP messages are printed to gstreamer log as 'log' level.
Comment on attachment 362710 [details] [review] Replace to print RTSP/SDP message from stdout to gstreamer Add an early return to these new functions. > if (gst_debug_category_get_threshold (GST_CAT_DEFAULT) < GST_LEVEL_LOG) > return; We don't want to iterate over everything and create output just to not print it :)
Created attachment 362726 [details] [review] added to check threshold.
I didn't know to check threshold of category. Thanks for good tip.
commit 257f7c906351a115ef7516e23789d615bca7f6b0 (HEAD -> master) Author: Sangkyu Park <sk1122.park@samsung.com> Date: Mon Oct 30 19:15:56 2017 +0900 rtspsrc: Print RTSP/SDP messages to gstreamer log instead of stdout - 'debug' property is deprecated - All RTSP messages are printed to gstreamer log with 'log' level. https://bugzilla.gnome.org/show_bug.cgi?id=788917