diff --git a/src/dcall.c b/src/dcall.c index afb4f92..8df815b 100644 --- a/src/dcall.c +++ b/src/dcall.c @@ -5,14 +5,14 @@ #include #include #include +#include struct dcall_elements { GstElement *pipeline; GstElement *rx_tap, *rx_jitterbuffer, *rx_depay, *rx_opusdec, *rx_resample, *rx_echocancel, *rx_sink; GstElement *tx_tap, *tx_echocancel, *tx_queue, *tx_resample, *tx_opusenc, *tx_pay, *tx_sink; char* remote_host; - guint bus_watch_id; - guint16 prev_seqnum; + guint64 grtppktlost; }; int create_rx_chain(struct dcall_elements* de) { @@ -101,24 +101,24 @@ static GstPadProbeReturn jitter_buffer_sink_event(GstPad *pad, GstPadProbeInfo * struct dcall_elements *de = user_data; GstEvent *event = NULL; - g_print("Entering rtpjitterbuffer sink pad handler for events...\n"); + //g_print("Entering rtpjitterbuffer sink pad handler for events...\n"); event = gst_pad_probe_info_get_event (info); if (event == NULL) return GST_PAD_PROBE_OK; - g_print("We successfully extracted an event from the pad... \n"); + //g_print("We successfully extracted an event from the pad... \n"); const GstStructure *struc = NULL; struc = gst_event_get_structure(event); if (struc == NULL) return GST_PAD_PROBE_OK; - g_print("We successfully extracted a structure from the event... \n"); + //g_print("We successfully extracted a structure from the event... \n"); const gchar* struc_name = NULL; struc_name = gst_structure_get_name(struc); if (struc_name == NULL) return GST_PAD_PROBE_OK; - g_print("We extracted the structure \"%s\"...\n", struc_name); + //g_print("We extracted the structure \"%s\"...\n", struc_name); if (strcmp(struc_name, "GstRTPPacketLost") != 0) return GST_PAD_PROBE_OK; - g_print("And that's the structure we want !\n"); + //g_print("And that's the structure we want !\n"); guint seqnum = 0, retry = 0; guint64 timestamp = 0, duration = 0; @@ -127,6 +127,7 @@ static GstPadProbeReturn jitter_buffer_sink_event(GstPad *pad, GstPadProbeInfo * gst_structure_get_uint64(struc, "timestamp", ×tamp); gst_structure_get_uint64(struc, "duration", &duration); g_print("GstRTPPacketLost{seqnum=%d, retry=%d, duration=%ld, timestamp=%ld}\n", seqnum, retry, duration, timestamp); + de->grtppktlost++; return GST_PAD_PROBE_OK; } @@ -138,9 +139,12 @@ gboolean stop_handler(gpointer user_data) { } int main(int argc, char *argv[]) { + setenv("GST_DEBUG_FILE", "dcall.log", 0); + setenv("GST_DEBUG", "3,opusdec:5", 0); + GMainLoop *loop; struct dcall_elements de = { - .prev_seqnum = 0 + .grtppktlost = 0 }; /* Check input arguments */